/* MotorLB home page — photo hero, quick picks, news strip, brand row, shortcuts.
   Self-contained (uses only the shared colour tokens) so it works on the website and in the app. */

/* ---------- Hero with rotating photos ---------- */
.hero.has-photo {
  position: relative; overflow: hidden; color: #fff; background: #0b0b0c;
  margin: 84px 16px 0; padding: 56px 0 44px; border-radius: 26px;
}
.is-app .hero.has-photo { margin: calc(66px + env(safe-area-inset-top)) 12px 0; padding: 30px 0 28px; }
.hero-photos { position: absolute; inset: 0; z-index: 0; }
.hero-photos .hp { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.4s ease; transform: scale(1.04); }
.hero-photos .hp.on { opacity: 1; animation: hp-zoom 9s ease-out forwards; }
@keyframes hp-zoom { from { transform: scale(1.04); } to { transform: scale(1.12); } }
.hero-photos::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.62) 45%, rgba(0, 0, 0, 0.86) 100%); }
.hero.has-photo .wrap { position: relative; z-index: 1; }
.hero.has-photo .eyebrow { color: rgba(255, 255, 255, 0.78); }
.hero.has-photo h1 { color: #fff; }
.hero.has-photo h1 .grad { background: none; -webkit-text-fill-color: rgba(255, 255, 255, 0.72); color: rgba(255, 255, 255, 0.72); }
.hero.has-photo .lede, .hero.has-photo .hero-note { color: rgba(255, 255, 255, 0.78); }
.hero.has-photo .btn-primary { background: #fff; color: #111; border-color: #fff; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6); }
.hero.has-photo .btn-primary:hover { color: #111; }
.hero.has-photo .btn:not(.btn-primary) { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.55); backdrop-filter: blur(6px); }
.hero-dots { position: absolute; z-index: 2; right: 16px; bottom: 14px; display: flex; gap: 6px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); transition: all 0.3s ease; }
.hero-dots i.on { width: 18px; border-radius: 3px; background: #fff; }

/* ---------- Shared section bits ---------- */
.hm-sec { padding: 34px 0 6px; }
.hm-sec .wrap { padding-left: 16px; padding-right: 16px; }
.hm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hm-head h2 { font-size: 1.35rem; letter-spacing: -0.01em; }
.hm-head a { font-size: 0.88rem; font-weight: 600; color: var(--brand); text-decoration: none; white-space: nowrap; }
.hm-scroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 16px 14px; margin: 0 -16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hm-scroll::-webkit-scrollbar { display: none; }

/* ---------- Quick-pick chips ---------- */
.qp-row { display: flex; gap: 8px; overflow-x: auto; padding: 18px 16px 4px; scrollbar-width: none; max-width: 1100px; margin: 0 auto; }
.qp-row::-webkit-scrollbar { display: none; }
.qp { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); font-size: 0.95rem; font-weight: 600; text-decoration: none; transition: transform 0.12s ease, background 0.15s ease; }
.qp:active { transform: scale(0.96); background: var(--bg-elevated); }

/* ---------- News strip ---------- */
.nw-card { flex: none; width: min(78vw, 300px); scroll-snap-align: start; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-card); overflow: hidden; text-decoration: none; color: inherit; transition: transform 0.12s ease; }
.nw-card:active { transform: scale(0.98); }
.nw-img { aspect-ratio: 16 / 10; background: var(--bg-elevated) center / cover no-repeat; position: relative; }
.nw-tag { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; backdrop-filter: blur(6px); }
.nw-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.nw-body b { font-size: 0.98rem; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nw-body span { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Brand row ---------- */
.hb { flex: none; width: 76px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--text); transition: transform 0.12s ease; }
.hb:active { transform: scale(0.94); }
.hb-box { width: 72px; height: 60px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-card); display: grid; place-items: center; padding: 10px; }
.hb-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hb-box .hb-d { display: none; }
html[data-theme="dark"] .hb:not(.no-dark) .hb-l { display: none; }
html[data-theme="dark"] .hb:not(.no-dark) .hb-d { display: block; }
.hb-name { font-size: 0.72rem; font-weight: 600; text-align: center; line-height: 1.15; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Slim stats line ---------- */
.stats.reveal { margin-top: 26px; }
.is-app .stats .wrap, .stats .wrap { padding-top: 0; padding-bottom: 0; }
.stat .num { font-size: 1.9rem; }
.stat { padding: 14px 10px; }

/* ---------- Shortcut tiles ---------- */
.sc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sc { display: flex; flex-direction: column; gap: 6px; padding: 16px; min-height: 124px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-card); color: var(--text); text-decoration: none; transition: transform 0.12s ease, border-color 0.15s ease; }
.sc:active { transform: scale(0.97); }
.sc svg { width: 28px; height: 28px; stroke: var(--brand); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sc b { font-size: 1rem; margin-top: auto; }
.sc span { font-size: 0.8rem; color: var(--text-muted); line-height: 1.35; }
.hm-end { height: 28px; }

@media (min-width: 760px) {
  .hero.has-photo { margin: 92px auto 0; max-width: 1180px; padding: 84px 0 70px; }
  .nw-card { width: 320px; }
  .sc-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .hero-photos .hp, .hero-photos .hp.on { animation: none; transition: none; } }

/* iOS WebView layering fix: keep everything the hero draws (photo zoom animation, blurred button) inside the hero
   so it can never paint over the chips / news strip below it. */
.hero.has-photo { isolation: isolate; z-index: 0; contain: paint; }
.hero.has-photo .btn:not(.btn-primary) { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255, 255, 255, 0.14); }
.hero-photos .hp.on { animation: none; transform: scale(1.04); }
.qp-row, .hm-sec, .stats, .hm-end { position: relative; z-index: 1; }

/* App: compact hero so the news strip is visible on the first screen (buttons side by side, no extra note) */
.is-app .hero.has-photo { padding: 20px 0 22px; }
.is-app .hero.has-photo .eyebrow { font-size: 0.68rem; margin-bottom: 6px; }
.is-app .hero.has-photo h1 { font-size: 1.7rem; line-height: 1.12; }
.is-app .hero.has-photo .hero-cta { flex-direction: row; gap: 8px; margin-top: 16px; }
.is-app .hero.has-photo .hero-cta .btn { flex: 1; min-height: 46px; padding: 0 8px; font-size: 0.95rem; }
.is-app .hero.has-photo .hero-note { display: none; }
.is-app .hero-dots { bottom: 8px; right: 14px; }
.is-app .qp-row { padding-top: 12px; }
.is-app .hm-sec { padding-top: 20px; }

/* Hero background: faded wall of all brand logos on a deep charcoal with a soft warm glow (replaces the news photos) */
.hero.has-photo { background: radial-gradient(120% 90% at 18% 0%, #2a241c 0%, #121214 58%, #0a0a0b 100%); }
.hero-photos .hp, .hero-dots { display: none; }
.hero-wall { position: absolute; inset: 0; background: url(../img/home-logo-wall.webp) 0 0 / 600px auto repeat; opacity: 0.2; }
.hero-photos::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 55%, rgba(0, 0, 0, 0.55) 100%); }
@media (min-width: 760px) { .hero-wall { background-size: 900px auto; } }
.hero-wall { opacity: 0.13; }
.hero-photos::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.38) 55%, rgba(0, 0, 0, 0.6) 100%); }

/* Moving logo wall: each row is a slice of the tile that slides sideways forever (seamless loop = one tile width) */
.hero-wall { --w: 600px; background: none; overflow: hidden; }
@media (min-width: 760px) { .hero-wall { --w: 900px; } }
.hero-wall .wr {
  height: calc(var(--w) * 0.0794); width: calc(100% + var(--w));
  background: url(../img/home-logo-wall.webp) 0 calc(var(--i) * var(--w) * -0.0794) / var(--w) auto repeat-x;
  animation: var(--dir) var(--d) linear infinite; will-change: transform;
}
@keyframes wall-l { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(var(--w) * -1), 0, 0); } }
@keyframes wall-r { from { transform: translate3d(calc(var(--w) * -1), 0, 0); } to { transform: translate3d(0, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .hero-wall .wr { animation: none; } }
.hero-wall { opacity: 0.16; }

/* ---------- Legal pages (privacy, terms) ---------- */
.legal { padding: 120px 0 80px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 6px 0 4px; }
.legal-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.legal h2 { font-size: 1.15rem; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--text-muted); line-height: 1.65; font-size: 0.98rem; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; margin: 8px 0; }
.legal li b, .legal p b { color: var(--text); }
.legal a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.legal-table { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 10px 0 14px; }
.legal-table > div { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 12px 16px; border-top: 1px solid var(--border); }
.legal-table > div:first-child { border-top: 0; }
.legal-table b { color: var(--text); font-size: 0.95rem; }
.legal-table span { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }
@media (min-width: 700px) { .legal-table > div { grid-template-columns: 220px 1fr; gap: 18px; } }
.is-app .legal { padding-top: calc(132px + env(safe-area-inset-env, 0px)); }
.is-app .legal { padding-top: calc(132px + env(safe-area-inset-top)); }

/* Desktop: shorter hero and a chip row that lines up with the rest */
@media (min-width: 760px) {
  .hero.has-photo { padding: 60px 0 52px; }
  .qp-row { max-width: 1180px; padding-left: 16px; padding-right: 16px; }
}
.footer-legal-links a { margin-right: 14px; }
.is-app .legal { padding-top: calc(152px + env(safe-area-inset-top)); }


/* PUBLIC BUILD v1: brand tile without a logo becomes a text chip */
.hb.hb-text { align-self: center; width: auto; white-space: nowrap; padding: 10px 16px; border: 1px solid var(--border); border-radius: 99px; background: var(--bg-card); }
.hb.hb-text .hb-name { max-width: none; font-size: 0.82rem; }
.nw-img.nw-noimg { aspect-ratio: auto; height: 56px; }
