/* Chooni.ir — Home (site root) layout. Consumes tokens.css + base.css.
   A single-viewport, centred, Google-style landing: the wordmark, one search field,
   and the four Section entries. No scroll — the whole page is one viewport.
   Browsing and the translated critic reviews live on the browse/listing pages. */

.home {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 5vh, 56px) var(--pad-x) clamp(20px, 3vh, 32px);
}

/* Spline hero — decorative atmosphere behind the centred content, right ~48% of the
   viewport. Same scene as the title-page hero; here it sits on the ambient wash
   instead of a film still since there's no single title. Dark theme only — it's a
   moody, near-black composition that reads as a smudge on the light paper surface. */
.home__scene { position: absolute; inset-block: 0; right: 0; width: 48%; max-width: 640px; overflow: hidden; z-index: 0; }
.home__scene spline-viewer { width: 100%; height: 100%; display: block; pointer-events: none; }
:root[data-theme="light"] .home__scene { display: none; }

/* Ambient warm wash from the brand palette, fixed behind everything. */
.home::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 520px at 50% 40%, rgb(var(--amber-rgb) / 0.20) 0%, rgb(var(--amber-rgb) / 0.05) 42%, rgb(var(--bg-rgb) / 0) 72%),
    radial-gradient(600px 480px at 50% 6%, rgb(var(--teal-rgb) / 0.10) 0%, rgb(var(--panel2-rgb) / 0) 65%),
    var(--bg);
}

/* Centred stack takes all the space above the footer. Sits above .home__scene
   (z-index) so the Spline layer never obscures the wordmark/search/cats it overlaps. */
.home__center {
  position: relative; z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vh, 34px);
  text-align: center;
}

.home__wordmark {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home__logotype {
  width: min(480px, 86vw);
  height: auto;
  aspect-ratio: 640 / 278;
  object-fit: contain;
  filter: drop-shadow(0 14px 40px rgba(0, 0, 0, 0.45));
}
.home__tagline {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 2.2vw, 18px);
  line-height: 1.6;
  max-width: 34ch;
}

/* ---- Search: the primary action ---- */
.home__search {
  position: relative;
  width: min(640px, 100%);
  display: flex;
  align-items: center;
}
.home__search svg {
  position: absolute; inset-inline-start: 20px; color: var(--muted); font-size: 18px;
  pointer-events: none;
}
.home__search input {
  width: 100%; height: 60px;
  padding-inline: 56px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgb(var(--panel2-rgb) / 0.72);
  color: var(--ink);
  font-family: var(--font-fa);
  font-size: 17px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.home__search input::placeholder { color: var(--dim); }
.home__search input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgb(var(--amber-rgb) / 0.14);
}
/* Suggestions open (base.css .suggest): the field and the list read as one amber-edged block. */
.home__search { z-index: 2; }
.home__search.is-suggesting input { border-end-start-radius: 0; border-end-end-radius: 0; box-shadow: none; }
.home__search .suggest { inset-inline: 0; }
.home__search:focus-within .suggest__inner { border-color: var(--amber); }
.home__search .suggest__list { border-top-color: var(--line-2); }

/* ---- The four Section entries ---- */
.home__cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 16px);
  width: min(720px, 100%);
}
.home__cat {
  flex: 1 1 140px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.home__cat:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgb(var(--amber-rgb) / 0.06);
}

@media (max-width: 480px) {
  .home__cat { flex-basis: calc(50% - 6px); }
}

/* Spline's own "Built with Spline" badge is fixed to the viewport's bottom-right
   corner by the viewer itself (outside our stacking context — can't be restyled
   directly). Paint over it with a bg-colored patch instead: fixed, same corner,
   z-index high enough to sit above the badge's own stacking context. Only needed
   where the scene itself renders (dark theme, wide viewport). */
.home__scene-mask { display: none; }
@media (min-width: 901px) {
  :root:not([data-theme="light"]) .home__scene-mask {
    display: block; position: fixed; bottom: 0; right: 0;
    width: 200px; height: 64px; z-index: 2147483647; pointer-events: none;
    background: var(--bg);
  }
}

/* Narrow viewports: not enough room for the scene to read as atmosphere rather
   than clutter (mirrors .hero__scene's own 900px cutoff in section-index.css). */
@media (max-width: 900px) {
  .home__scene { display: none; }
}

/* ---- Theme toggle — no persistent nav on this page, so it's a corner-pinned button. ---- */
.home__theme { position: fixed; top: clamp(16px, 3vh, 28px); left: clamp(16px, 4vw, 32px); z-index: 5; }
