/* ============================================
   Homepage specific styles (uses design tokens)
   ============================================ */

/* Homepage Pixie is a viewport widget rather than part of the search layout. */
.chat-sidebar[data-mode="site-help"] .chat-head .chat-av {
  width: 40px;
  height: 40px;
  background: transparent !important;
  background-image: none !important;
  overflow: hidden;
  flex-shrink: 0;
}
.chat-sidebar[data-mode="site-help"] .chat-head .chat-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-sidebar[data-mode="site-help"] .chat-msgs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-sidebar[data-mode="site-help"] .chat-msgs .msg-content {
  overflow-wrap: anywhere;
}
.chat-sidebar[data-mode="site-help"] .msg-suggs .sugg {
  text-decoration: none;
}

#fabPixieBtn.fab-pixie {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}
#fabPixieBtn.fab-pixie:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(236, 72, 153, 0.45);
}
#fabPixieBtn.fab-pixie.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

@media (max-width: 768px) {
  .chat-sidebar[data-mode="site-help"].open {
    position: fixed;
    inset: auto 12px calc(76px + env(safe-area-inset-bottom, 0px));
    z-index: 3000;
    width: auto;
    height: min(75vh, 640px);
    max-height: calc(100dvh - 100px - env(safe-area-inset-top, 0px));
    border-radius: 18px;
  }
  /* Same specificity as the desktop #fabPixieBtn.fab-pixie rule above, which
     otherwise won and left the button under the bottom navigation bar. */
  #fabPixieBtn.fab-pixie {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    z-index: 1001;
  }
}

/* --- Top bar (matching search page aesthetic) --- */
.home-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--border);
  padding: 0 32px;
}

.home-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.home-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--text);
}

.home-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--text);
  color: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  transition: 0.18s;
}

.home-logo:hover .home-logo-mark {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.home-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.home-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.15s;
}

.home-nav a:hover,
.home-nav a.active {
  background: var(--surface);
  color: var(--text);
}

.home-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-login {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-login:hover {
  color: var(--text);
}

.topbar-submit {
  background: var(--text);
  color: white;
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s;
}

.topbar-submit:hover {
  background: var(--accent);
}

/* --- Hero section ---
   Asymmetric: statement headline + CTAs on the left, a tilted stack of
   real image cards on the right (an actual product visual rather than
   decoration) with a small floating "trending" card overlapping it.
   Typography still keeps one weight of emphasis only (the accent color
   on "free", no gradient text-clip, no italics): big and confident
   reads differently from "loud" once it has room and a visual
   counterweight next to it, which is what the two-column split buys. */
.home-hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 48px;
  max-width: 1280px;
  padding: 72px 24px 64px;
  margin: 0 auto;
}

.home-hero-content {
  max-width: 540px;
}

.home-h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}

.home-h1 .pk {
  color: var(--accent);
}

.home-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 460px;
  margin: 0 0 32px;
  line-height: 1.6;
}

.home-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.home-trust {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 10px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  color: var(--muted);
}

.home-trust .material-icons {
  font-size: 18px;
  color: var(--accent);
}

.home-trust strong {
  color: var(--text);
}

/* Hero visual: a loose deck of tilted, overlapping image cards. Fixed
   height so the absolutely-positioned cards have a box to lay out
   against; the cards themselves are real search results (Unsplash-seed
   placeholders here), not abstract decoration. */
.home-hero-visual {
  position: relative;
  height: 460px;
}

.hhv-card {
  position: absolute;
  /* Capped so the tallest card (60% wide at 4:5, pushed down 13%) still
     fits inside the 460px-tall box on wide screens instead of spilling
     into the "How it works" section below. */
  width: min(60%, 300px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 20px;
  border: 6px solid var(--white);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

.hhv-card-1 { top: 0; left: 2%; transform: rotate(-9deg); z-index: 1; }
.hhv-card-2 { top: 6%; left: 22%; transform: rotate(5deg); z-index: 2; }
.hhv-card-3 { top: 13%; left: 39%; transform: rotate(-3deg); z-index: 3; }

.hhv-preview {
  position: absolute;
  right: 0;
  bottom: 4%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 230px;
  padding: 10px 14px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease;
}

.hhv-preview:hover {
  transform: translateY(-3px);
}

.hhv-preview img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.hhv-preview-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hhv-preview-text strong {
  font-size: 0.82rem;
}

.hhv-preview-text span {
  font-size: 0.72rem;
  color: var(--muted);
}

.hhv-preview > .material-icons {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: auto;
}

.home-cta-main, .home-cta-sec {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 40px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.18s;
  font-size: 0.9rem;
}

.home-cta-main {
  background: var(--text);
  color: white;
}

.home-cta-main:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-shadow);
}

.home-cta-sec {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.home-cta-sec:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* --text flips to a light color in dark mode, which turns this button's
   background pale while the label stays hardcoded white, illegible.
   Same fix already applied to the .home-cta-banner variant below. */
[data-theme="dark"] .home-cta-main {
  background: var(--accent);
  color: var(--bg);
}
[data-theme="dark"] .home-cta-main:hover {
  background: var(--accent-hover);
}

/* Mosaic grid */
.home-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 40px 0 48px;
}

.home-mosaic-img {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.home-mosaic-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.home-mosaic-img:hover img {
  transform: scale(1.02);
}

.home-mosaic-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 20px;
}

.home-mosaic-img:first-child {
  grid-row: span 2;
  grid-column: span 2;
}

/* Generic section styling */
.home-section {
  padding: 64px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.home-section-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 12px;
}

.home-section-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.home-section-sub {
  color: var(--muted);
  font-size: 1rem;
  max-width: 600px;
  margin-bottom: 48px;
}

/* How it works, one mocked browser window walking through the actual
   search → filter → download flow, with numbered captions underneath
   instead of three interchangeable icon cards. */
.home-how-mock {
  max-width: 900px;
  margin: 0 auto 44px;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--white);
}

.hhm-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hhm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hhm-dot-red { background: #ff5f57; }
.hhm-dot-yellow { background: #febc2e; }
.hhm-dot-green { background: #28c840; }

.hhm-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
  padding: 4px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
}

.hhm-url .material-icons {
  font-size: 12px;
}

.hhm-body {
  padding: 28px;
}

.hhm-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 999px;
  padding: 12px 20px;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.hhm-search .material-icons {
  color: var(--muted2);
}

/* Reveals the query one character at a time via an animated max-width on
   a nowrap/overflow-hidden span, the caret is the last inline child, so
   it rides along at the reveal boundary for free instead of needing its
   own separate position tracking. Sized in `ch` (33 characters in "golden
   hour Cape Town street food") rather than px so it isn't tied to one
   exact font/size. */
.hhm-search-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  max-width: 0;
  animation: hhmType 6s steps(33, end) infinite;
}

@keyframes hhmType {
  0%, 8% { max-width: 0; }
  58% { max-width: 33ch; }
  88% { max-width: 33ch; }
  96%, 100% { max-width: 0; }
}

.hhm-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: middle;
  background: var(--accent);
  animation: hhmBlink 1s step-end infinite;
}

@keyframes hhmBlink {
  50% { opacity: 0; }
}

.hhm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hhm-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--muted);
  border: 1.5px solid var(--border);
}

.hhm-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.hhm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.hhm-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface2);
}

.hhm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hhm-thumb-active {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

.hhm-dl-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.hhm-dl-btn .material-icons {
  font-size: 16px;
}

.home-how-steps {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.hhs-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hhs-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 900;
  font-size: 0.85rem;
}

.hhs-item h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.hhs-item p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Categories */
.home-cats-section {
  background: var(--surface);
  padding: 64px 24px;
}

.home-cats-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.home-cat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  aspect-ratio: 4 / 3;
  display: block;
}

.home-cat-card.wide {
  grid-column: span 2;
  aspect-ratio: 8 / 3;
}

.home-cat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.home-cat-card:hover img {
  transform: scale(1.03);
}

.home-cat-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: white;
}

.home-cat-label {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 4px;
}

.home-cat-count {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Feature grid (Why LiberPixels) */
.home-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.home-features-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

.home-feature-item {
  display: flex;
  gap: 16px;
}

.home-feature-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.home-feature-text h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.home-feature-text p {
  color: var(--muted);
  line-height: 1.5;
}

.home-features-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.home-features-visual img {
  width: 100%;
  display: block;
}

.home-visual-card {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* The card stays a "glass" panel over the photo in both themes, but its
   text (.home-visual-text/.home-visual-icon) inherits var(--text)/
   var(--muted), which turn light in dark mode, unreadable against a
   near-white card. Flipping the glass to a dark tint here, same fix
   already used for .hero-card-info, keeps the inherited light text
   legible instead of overriding every child color individually. */
[data-theme="dark"] .home-visual-card {
  background: rgba(30, 24, 38, 0.92);
}

.home-visual-icon {
  font-size: 1.5rem;
}

.home-visual-text {
  flex: 1;
}

.home-visual-text strong {
  display: block;
  font-size: 0.85rem;
}

.home-visual-text span {
  font-size: 0.7rem;
  color: var(--muted);
}

.home-visual-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.7rem;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  flex-shrink: 0;
}

.home-visual-dl .material-icons {
  font-size: 16px;
}

/* Final CTA banner */
.home-cta-banner {
  background: var(--text);
  color: white;
  padding: 64px 24px;
  text-align: center;
}

.home-cta-banner-inner {
  max-width: 800px;
  margin: 0 auto;
}

.home-cta-banner h2 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.home-cta-banner p {
  opacity: 0.8;
  margin-bottom: 32px;
}

.home-cta-banner-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.home-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
  color: #f9a8d4;
  font-size: 0.78rem;
}
.home-legal-links a {
  color: #f472b6;
  font-weight: 800;
  text-decoration: none;
}
.home-legal-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.home-cta-banner .home-cta-main {
  background: white;
  color: var(--text);
}

.home-cta-banner .home-cta-main:hover {
  background: var(--accent);
  color: white;
}

.home-cta-banner .home-cta-sec {
  background: transparent;
  border-color: white;
  color: white;
}

.home-cta-banner .home-cta-sec:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* .home-cta-banner uses --text as its background specifically so it's a
   dark emphasis band against the light page in light mode, but --text
   flips to a light color in dark mode, which turned this into a pale
   band with hardcoded white text/buttons on it (illegible either way).
   Re-themed for dark mode as a slightly-raised dark surface instead of
   trying to force it to stay light-on-dark. */
[data-theme="dark"] .home-cta-banner {
  background: var(--surface);
  color: var(--text);
}
[data-theme="dark"] .home-cta-banner .home-cta-main {
  background: var(--accent);
  color: var(--bg);
}
[data-theme="dark"] .home-cta-banner .home-cta-main:hover {
  background: var(--accent-hover);
}
[data-theme="dark"] .home-cta-banner .home-cta-sec {
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .home-cta-banner .home-cta-sec:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
}

/* Footer */
.home-footer {
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  padding: 48px 24px 24px;
}

.home-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.home-footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.home-footer-brand p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 12px 0;
}

.home-footer-logo {
  font-size: 1.2rem;
  font-weight: 900;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.home-footer-logo-dot {
  background: var(--accent);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.home-footer-social {
  display: flex;
  gap: 12px;
}

.home-footer-social a {
  width: 34px;
  height: 34px;
  background: var(--white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  transition: all 0.15s;
}

.home-footer-social a:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}

.home-footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.home-footer-col ul {
  list-style: none;
}

.home-footer-col li {
  margin-bottom: 10px;
}

.home-footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.home-footer-col a:hover {
  color: var(--accent);
}

.home-footer-bottom {
  border-top: 1.5px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--muted);
}

.home-footer-bottom-links {
  display: flex;
  gap: 20px;
}

.home-footer-bottom-links a {
  color: var(--muted);
  text-decoration: none;
}

.home-footer-bottom-links a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 900px) {
  .home-topbar-inner { padding: 0 16px; }
  .home-nav { display: none; }
  .home-mosaic { grid-template-columns: 1fr 1fr; }
  .home-mosaic-img:first-child { grid-row: auto; grid-column: auto; }
  .home-hero {
    grid-template-columns: 1fr;
    padding: 48px 20px 40px;
    text-align: center;
  }
  .home-hero-content { max-width: 100%; margin: 0 auto; }
  .home-sub { margin: 0 auto 28px; }
  .home-ctas { justify-content: center; }
  .home-trust { margin-left: auto; margin-right: auto; }
  /* Single column: the deck gets a fixed-size, centred box and the cards
     are sized from its height, so they can't grow with the page width
     and overlap the next section (as they did in split-screen windows). */
  .home-hero-visual { height: 340px; width: min(100%, 440px); margin: 8px auto 0; }
  .hhv-card { width: auto; height: 78%; }
  .hhv-preview { display: none; }
  .home-h1 { font-size: 2rem; }
  .home-section-title { font-size: 1.8rem; }
  .hhm-body { padding: 20px; }
  .hhm-grid { grid-template-columns: repeat(2, 1fr); }
  .home-how-steps { grid-template-columns: 1fr; gap: 20px; }
  .home-cat-grid { grid-template-columns: 1fr 1fr; }
  .home-features-grid { grid-template-columns: 1fr; }
  .home-footer-top { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 600px) {
  .home-cat-grid { grid-template-columns: 1fr; }
  .home-cat-card.wide { grid-column: auto; }
  .home-visual-card { flex-direction: column; text-align: center; }
}

/* Ensure wide category cards have consistent text alignment */
.home-cat-card.wide .home-cat-overlay {
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
}
.home-cat-card.wide .home-cat-label {
  font-size: 1.1rem;
}
/* Force category grid to place wide card correctly */
.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Ensure wide cards span 2 columns and don't break layout */
.home-cat-card.wide {
  grid-column: span 2;
}

/* On small screens, override to full width */
@media (max-width: 900px) {
  .home-cat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .home-cat-card.wide {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 600px) {
  .home-cat-grid {
    grid-template-columns: 1fr;
  }
  .home-cat-card.wide {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }
}

/* ════════════════════════════════════════════════════════
   INTRO SPLASH, plays once per browser session before the
   homepage is shown (see the inline scripts around #introSplash
   in index.html for the session-flag / autoplay-fallback logic).
   ════════════════════════════════════════════════════════ */
.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.intro-splash.intro-splash-hiding {
  opacity: 0;
  pointer-events: none;
}

/* Set on <html> before first paint (see the head script in index.html). */
[data-intro-seen] .intro-splash {
  display: none;
}

.intro-brand {
  position: relative;
  width: clamp(220px, 32vw, 440px);
  height: clamp(150px, 30vh, 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 1;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  animation: intro-brand-in 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-video-frame {
  position: relative;
  width: clamp(300px, 40vw, 560px);
  height: clamp(300px, 40vw, 560px);
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  transform: translateZ(0);
}

.intro-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.intro-video-ready {
  opacity: 1;
}

.intro-splash-hiding .intro-brand {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes intro-brand-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-brand {
    animation: none;
  }

  .intro-brand {
    opacity: 1;
    transform: none;
  }
}
