/* Home page. Hero follows Figma page 04 Home (node 11:2) and tweaks.md #6 to #14. */

/* ---------- hero ---------- */
.hero { padding: 24px 24px 0; }
.hero-card {
  position: relative;
  height: 960px; /* Figma height; the panel at 80px type needs all of it (1680 overlapped at 880) */
  border-radius: 24px;
  overflow: hidden;
  container-type: size;
  background: var(--color-bg-inverse);
}
/* photo + Shihab's manual overlay from Figma (tweaks.md #14): black 75%, 12.8% to 52% */
.hero-photo {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,.75) 12.8%, rgba(0,0,0,0) 52%),
    url(../assets/hero/hero-mg-zs-gemini-light.jpg) center / cover no-repeat;
}
/* pin layer copies background-size: cover, so pins stay on the car at any width */
.hero-pins {
  position: absolute; left: 50%; top: 50%;
  width: max(100cqw, calc(100cqh * 1376 / 768));
  aspect-ratio: 1376 / 768;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pin { position: absolute; display: flex; align-items: center; gap: 10px; transform: translate(-16px, -50%); }
.pin-dot {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-verified); color: #fff; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(255,255,255,.28);
}
.pin-label { background: var(--color-bg-surface); border-radius: 10px; padding: 8px 14px; box-shadow: var(--shadow-medium); line-height: 1.35; }
.pin-label strong { display: block; font-size: var(--font-size-small); font-weight: var(--font-weight-semibold); }
.pin-label span { font-size: var(--font-size-caption); color: var(--color-verified); font-weight: var(--font-weight-medium); }

.hero-proof, .hero-chip { text-decoration: none; color: var(--color-text-primary); }
.hero-proof {
  position: absolute; top: 40px; right: 40px;
  display: flex; align-items: center; gap: var(--space-base);
  padding: 16px 24px 16px 16px;
  background: var(--color-bg-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-medium);
}
.hero-proof-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--color-verified-bg); color: var(--color-verified); }
.hero-proof strong { display: block; font-size: var(--font-size-body); font-weight: var(--font-weight-semibold); line-height: 1.35; }
.hero-proof span { font-size: var(--font-size-small); color: var(--color-text-secondary); line-height: 1.4; }

/* glass panel: deliberate exception to the no-glass rule, Shihab's call (tweaks.md #8) */
.hero-panel {
  position: absolute; top: 40px; left: 40px;
  width: min(700px, 46cqw);
  padding: 48px;
  color: var(--color-text-inverse);
  background: rgba(22, 24, 29, .62);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-lg);
}
.hero-eyebrow { display: inline-flex; margin-bottom: var(--space-roomy); }
.hero-title { font-size: 80px; font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; }
.hero-lead { margin-top: var(--space-comfortable); font-size: 26px; line-height: 1.45; color: rgba(255,255,255,.9); }
.btn-pill-outline {
  display: inline-flex; align-items: center; gap: 12px; margin-top: var(--space-roomy);
  min-height: 64px; padding: 0 28px; border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,.7); color: #fff; text-decoration: none;
  font-size: var(--font-size-h4); font-weight: var(--font-weight-semibold);
  transition: background-color .15s;
}
.btn-pill-outline:hover { background: rgba(255,255,255,.12); }
.hero-stats { display: flex; gap: var(--space-spacious); margin-top: var(--space-roomy); padding-top: var(--space-roomy); border-top: 1px solid rgba(255,255,255,.2); }
.hero-stats strong { display: block; font-size: var(--font-size-h2); font-weight: var(--font-weight-bold); line-height: 1.1; letter-spacing: -0.02em; }
.hero-stats span { font-size: var(--font-size-small); color: rgba(255,255,255,.72); }

/* docked search bar */
.hero-search {
  position: absolute; left: 40px; right: 40px; bottom: 32px;
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: center;
  min-height: 120px; padding: 0 24px 0 0;
  background: var(--color-bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-high);
}
.search-field { position: relative; display: flex; flex-direction: column; justify-content: center; height: 72px; padding: 0 64px 0 40px; border-right: 1px solid var(--color-border-default); }
.search-field:nth-child(3) { border-right: 0; }
.search-field label { font-size: var(--font-size-small); font-weight: var(--font-weight-semibold); color: var(--color-text-secondary); line-height: 1.3; }
.search-field select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0; margin: 2px 0 0;
  font-size: var(--font-size-h4); font-weight: var(--font-weight-semibold); line-height: 1.3; cursor: pointer;
  width: 100%; text-overflow: ellipsis;
}
.search-field select:focus-visible { outline: none; }
.search-field:focus-within { box-shadow: inset 0 0 0 3px var(--color-focus-ring); border-radius: var(--radius-sm); }
.search-field .icon { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--color-text-secondary); }
.hero-search .btn-primary { min-height: 72px; padding: 0 36px; font-size: var(--font-size-body-lg); border-radius: var(--radius-md); }
.hero-mobile-only { display: none; }

/* pins breathe: a slow ring says "this point was checked", not decoration on a loop of its own */
.pin-dot { position: relative; }
.pin-dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--color-verified); opacity: 0; animation: pin-ring 2.4s var(--ease-out, ease-out) infinite; }
.pin:nth-child(2) .pin-dot::after { animation-delay: .8s; }
.pin:nth-child(3) .pin-dot::after { animation-delay: 1.6s; }
@keyframes pin-ring { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.9); } }
.btn-pill-outline .icon { transition: transform 150ms ease-out; }
.btn-pill-outline:hover .icon { transform: translateX(4px); }
.tile { transition: transform 150ms ease-out, box-shadow 150ms ease-out; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-medium); }
.tile-checks img { transition: transform 300ms ease-out; }
.tile-checks:hover img { transform: scale(1.03); }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--layout-grid-gutter); }
.tile { background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); padding: var(--space-roomy); display: flex; flex-direction: column; gap: var(--space-md); }
.tile p { font-size: var(--font-size-small); color: var(--color-text-secondary); line-height: 1.55; }
.tile-icon { color: var(--color-text-primary); margin-bottom: auto; padding-bottom: var(--space-comfortable); }
.tile-checks { grid-column: 1 / 3; grid-row: 1 / 3; padding: 0; overflow: hidden; }
.tile-checks img { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; object-position: center 60%; }
.tile-checks-body { padding: var(--space-roomy); display: flex; flex-direction: column; gap: var(--space-comfortable); flex: 1; }
.tile-checks-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-base); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-base) var(--space-roomy); margin-top: auto; }
.check-list li { display: flex; align-items: center; gap: var(--space-md); font-size: var(--font-size-body); }
.check-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-verified-bg); color: var(--color-verified); }
.tile-ink { grid-column: 3 / 5; background: var(--color-bg-inverse); border-color: var(--color-bg-inverse); color: var(--color-text-inverse); }
.tile-ink .big { font-size: 112px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.tile-ink p { color: rgba(255,255,255,.78); }
.tile-grade .big { font-size: var(--font-size-h2); font-weight: var(--font-weight-bold); line-height: 1; white-space: nowrap; }
.tile-grade .big small { font-size: var(--font-size-caption); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); margin-left: 6px; letter-spacing: 0; white-space: nowrap; }
.tile-subtle { grid-column: 1 / 3; background: var(--color-bg-subtle); border-color: var(--color-bg-subtle); }
.tile-wide { grid-column: 3 / 5; }
.tile .badge-row { margin-bottom: auto; padding-bottom: var(--space-comfortable); }

/* ---------- how buying works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-spacious); list-style: none; margin: 0; padding: 0; }
.step-no { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--color-bg-inverse); color: var(--color-text-inverse); font-weight: var(--font-weight-bold); margin-bottom: var(--space-comfortable); }
.steps p { margin-top: var(--space-md); color: var(--color-text-secondary); }

/* ---------- showroom ---------- */
.showroom { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-spacious); align-items: center; background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); padding: var(--space-spacious); }
.showroom ul { list-style: none; margin: var(--space-comfortable) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-md); }
.showroom li { display: flex; align-items: center; gap: var(--space-md); }
.showroom-cta p { margin-bottom: var(--space-comfortable); font-size: var(--font-size-body-lg); }

/* ---------- responsive ---------- */
@media (max-width: 1599px) {
  /* the rightmost pin's label would run off the card; it sits above its dot, ending at the dot */
  .pin-flip { flex-direction: column-reverse; align-items: flex-end; gap: 8px; transform: translate(calc(-100% + 16px), calc(-100% + 16px)); }
  /* proof card never reaches into the glass panel */
  .hero-proof { max-width: calc(50cqw - 100px); }
  .hero-card { height: 880px; } /* smaller type below 1600; 760 hid the stats under the search bar at 1440x900 */
  .hero-title { font-size: 64px; }
  .hero-lead { font-size: 22px; }
  .hero-panel { padding: 40px; }
  .btn-pill-outline { font-size: var(--font-size-body); min-height: 56px; }
  .hero-stats strong { font-size: 40px; }
  .search-field { padding: 0 56px 0 28px; }
  .search-field select { font-size: 20px; }
  .tile-ink .big { font-size: 88px; }
}
@media (max-width: 1399px) {
  .hero-title { font-size: 56px; }
  .hero-panel { width: 50cqw; }
  .pin-label span { display: none; }
}
/* tablet: photo stays behind, panel and search stack, pins go */
@media (max-width: 1199px) {
  .hero-card { height: auto; container-type: normal; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
  .hero-pins, .hero-proof { display: none; }
  .hero-photo { background-position: 0 0, 88% center; }
  .hero-panel, .hero-search { position: relative; inset: auto; width: auto; }
  .hero-panel { max-width: 620px; }
  .hero-search { grid-template-columns: 1fr 1fr; padding: 16px; gap: 8px; }
  .search-field { border-right: 0; padding: 0 48px 0 16px; }
  .search-field .icon { right: 16px; }
  .hero-search .btn-primary { grid-column: 1 / -1; }
  .bento { grid-template-columns: 1fr 1fr; }
  .tile-checks, .tile-ink, .tile-subtle, .tile-wide { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 899px) {
  .steps, .showroom { grid-template-columns: 1fr; }
}
/* mobile 412: Figma page 05 Home · 412 (39:2). Photo card on top, copy on the page below, dark text */
@media (max-width: 767px) {
  .hero { padding: 16px var(--layout-page-x) 0; }
  .hero-card { padding: 0; background: none; border-radius: 0; overflow: visible; gap: 0; }
  .hero-photo { position: relative; inset: auto; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); background: url(../assets/hero/hero-mg-zs-gemini-light.jpg) 82% center / cover no-repeat; }
  .hero-mobile-only { display: flex; }
  .hero-photo .hero-eyebrow { position: absolute; top: 14px; left: 14px; margin: 0; }
  .hero-chip { position: absolute; left: 12px; right: 12px; bottom: 12px; align-items: center; gap: 12px; padding: 10px 14px; background: var(--color-bg-surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-medium); }
  .hero-chip b { display: grid; place-items: center; min-width: 40px; height: 32px; border-radius: 6px; background: var(--color-verified-bg); color: var(--color-verified); font-size: var(--font-size-caption); }
  .hero-chip strong { display: block; font-size: var(--font-size-caption); font-weight: var(--font-weight-semibold); line-height: 1.3; }
  .hero-chip span { font-size: 13px; color: var(--color-text-secondary); line-height: 1.3; }
  .hero-panel { padding: 24px 0 0; max-width: none; background: none; border: 0; border-radius: 0; color: var(--color-text-primary); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero-panel .hero-eyebrow { display: none; }
  .hero-title { font-size: var(--font-size-h1); letter-spacing: -0.03em; }
  .hero-lead { font-size: var(--font-size-body); color: var(--color-text-secondary); margin-top: var(--space-base); }
  .btn-pill-outline { width: 100%; justify-content: center; color: var(--color-text-primary); border-color: var(--color-action-secondary); font-size: var(--font-size-small); min-height: 52px; margin-top: var(--space-comfortable); }
  .btn-pill-outline:hover { background: var(--color-bg-subtle); }
  .hero-stats { order: 3; justify-content: space-between; gap: var(--space-base); border-top: 0; padding-top: 0; margin-top: var(--space-comfortable); }
  .hero-stats strong { font-size: var(--font-size-h4); }
  .hero-stats span { font-size: var(--font-size-caption); color: var(--color-text-secondary); }
  .hero-search { display: flex; flex-direction: column; align-items: stretch; margin-top: var(--space-comfortable); padding: 8px 16px 16px; border: 1px solid var(--color-border-default); box-shadow: var(--shadow-subtle); gap: 0; }
  .search-field { height: auto; padding: 14px 40px 14px 0; border-bottom: 1px solid var(--color-border-default); }
  .search-field:nth-child(3) { border-bottom: 0; }
  .search-field .icon { right: 4px; }
  .search-field label { font-size: var(--font-size-caption); }
  .search-field select { font-size: var(--font-size-body); }
  .hero-search .btn-primary { min-height: 52px; font-size: var(--font-size-small); margin-top: 8px; }
  .hero-desktop-stats { display: none; }
  .home-featured .card-grid > :nth-child(odd) { display: none; }
  .tile { padding: var(--space-comfortable); }
  .tile-checks img { display: none; }
  .tile-checks-head .link-arrow { display: none; }
  .check-list { grid-template-columns: 1fr; gap: var(--space-md); }
  .tile-ink .big { font-size: 64px; }
  .tile-grade .big { font-size: var(--font-size-h3); }
  .tile-grade .big small { display: block; margin: 6px 0 0; }
  .bento { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile-refund, .tile-grade { grid-column: auto; }
  .tile-wide { display: none; }
  .steps { gap: var(--space-comfortable); }
  .steps li { display: grid; grid-template-columns: 44px 1fr; column-gap: var(--space-base); }
  .step-no { margin: 0; grid-row: span 2; }
  .steps p { margin-top: 4px; }
  .showroom { padding: var(--space-comfortable); gap: var(--space-comfortable); }
}
@media (max-width: 767px) {
  .browse-all-mobile { display: flex; margin-top: var(--space-comfortable); }
}
@media (min-width: 768px) {
  .browse-all-mobile { display: none; }
  .hero-mobile-stats { display: none; }
}
