/* ===================================================================
   Bear Media Lab — landing page
   -------------------------------------------------------------------
   Layers on ui.css. Only layout lives here; colour and the primitives
   come from the kit's tokens.

   Layout: tool sidebar on the left, then the search box beside an ad
   slot, a row of square tool cards, and the footer.
   =================================================================== */

.layout { min-height: calc(100vh - 58px); min-height: calc(100dvh - 58px); }

/* --- Sidebar -------------------------------------------------------- */
/* A drawer, hidden until the menu button left of the logo opens it. */
.sidebar {
  position: fixed; top: 58px; left: 0; bottom: 0; z-index: 40;
  width: min(280px, 86vw);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg);
  padding: 22px 14px 32px;
  display: flex; flex-direction: column; gap: 22px;
  box-shadow: var(--shadow);
  transform: translateX(-100%); visibility: hidden;
  transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
body.nav-open .sidebar { transform: none; visibility: visible; transition: transform var(--dur) var(--ease); }
.scrim { position: fixed; inset: 58px 0 0; z-index: 30; background: var(--scrim); }
.scrim[hidden] { display: none; }

.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-group .eyebrow { padding: 0 10px 8px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); text-decoration: none;
  transition: background var(--dur) var(--ease);
}
.side-link:hover { background: var(--panel-2); color: var(--text); }
.side-link .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link .soon { font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.side-link.is-soon { color: var(--muted); cursor: default; }
.side-link.is-soon:hover { background: none; }
/* Simple Tools sit at the bottom of the list, nested under their heading. */
.side-group.simple { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.side-group.simple .side-head { color: var(--text); font-weight: 600; }
.side-group.simple .side-link:not(.side-head) { padding-left: 22px; }

/* --- Main column ---------------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 32px; }

/* Search box beside the ad slot, as in the wireframe. */
.top-row { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: stretch; }

.finder {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  padding: 40px clamp(20px, 4vw, 56px);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-height: 280px;
}
.finder h1 { font-size: clamp(26px, 3.4vw, 38px); }
.finder .lead { margin-top: -6px; }

.search { position: relative; }
.search-row { display: flex; gap: 10px; align-items: stretch; }
.search-row .btn { border-radius: 999px; padding-left: 24px; padding-right: 24px; }
.search-box {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 18px; box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow); }
.search-box svg { width: 18px; height: 18px; color: var(--faint); flex-shrink: 0; }
.search-box input[type=search] {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0;
  font-size: 16px; outline: none;
}
.search-box input[type=search]:focus { border: 0; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }

.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  margin: 0; padding: 6px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: 360px; overflow-y: auto;
}
.results[hidden] { display: none; }
.result {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
}
.result .ico { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.result .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result .txt b { font-weight: 600; font-size: 14.5px; }
.result .txt span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result[aria-selected="true"] { background: var(--panel-2); }
.result.empty { color: var(--muted); cursor: default; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .hint { margin-right: 2px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font: inherit; font-size: 13px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--faint); color: var(--text); }

/* Ad slot: reserved space so the page doesn't jump when the ad loads. */
/* Base .ad-slot style lives in ui.css; the landing one is the tall size. */
.top-row .ad-slot { min-height: 250px; }

/* --- Tool row ------------------------------------------------------- */
.shelf { display: flex; flex-direction: column; gap: 14px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shelf-head h2 { font-size: 19px; }

.shelf-body { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 14px; }

/* Scroll-snap does the swiping: touch, trackpad and the arrow buttons all
   end up at the same snap points, so there is no drag handler to maintain. */
.track {
  --per: 5; --gap: 18px;
  display: flex; gap: var(--gap);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 4px 2px 8px;
}
.track::-webkit-scrollbar { display: none; }

.card {
  position: relative; display: block;
  flex: 0 0 calc((100% - var(--gap) * (var(--per) - 1)) / var(--per));
  aspect-ratio: 1 / 1; scroll-snap-align: start;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--panel-2);
  color: #fff; text-decoration: none; text-align: left;
  padding: 0; font: inherit; cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: #fff; }
.card.soon { cursor: default; }
.card.soon:hover { transform: none; box-shadow: none; }
/* Pictures are cropped to the square from the centre. */
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.card:hover img { transform: scale(1.04); }
.card .card-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; }
.card .badge { position: absolute; top: 10px; left: 10px; background: var(--panel); }
/* The name sits on a dark fade so it stays legible on any picture, in
   either theme — hence white text rather than a theme token. */
.card .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 32px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  font-size: 15.5px; font-weight: 600; letter-spacing: -.01em;
}

/* --- Footer --------------------------------------------------------- */
/* Always dark, as in the wireframe; the colours are fixed on purpose. */
.site-foot {
  background: #0d0c0b; color: #ece8e2;
  border-top: 1px solid var(--line);
  padding: 22px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  font-size: 14px;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 0; }
.site-foot nav a { color: #ece8e2; text-decoration: none; padding: 0 12px; border-left: 1px solid #4a4640; }
.site-foot nav a:first-child { border-left: 0; padding-left: 0; }
.site-foot nav a:last-child { padding-right: 0; }
.site-foot nav a:hover { color: #e09a4e; }

/* --- Responsive ------------------------------------------------------ */
@media (max-width: 1280px) { .track { --per: 4; } }
@media (max-width: 1100px) {
  .top-row { grid-template-columns: 1fr; }
  .top-row .ad-slot { min-height: 120px; }
  .track { --per: 3; }
}

@media (max-width: 640px) {
  .content { padding: 18px 16px 28px; gap: 24px; }
  .finder { padding: 26px 18px; min-height: 0; }
  .shelf-body { grid-template-columns: minmax(0, 1fr); }
  .shelf-body .icon-btn { display: none; }
  .track { --per: 2; --gap: 12px; }
  .site-foot { padding: 18px 16px; flex-direction: column; align-items: flex-start; }
  .site-foot nav a:first-child { padding-left: 0; }
}
