/* Features page: the catalog (v1 glass tiles, group heads, a sticky filter bar), the hero search console and the in-place preview.
   Everything else is in components.css (v1's vocabulary). Tokens only; the hero console and the framed screens are always-dark surfaces. */

/* ===== hero console: the catalog's own search ================================================================== */
.page-features .page-hero__media { min-width: 0; }
.page-features .console { min-width: 0; }
.ffind { display: grid; gap: 16px; }
.fsearch { position: relative; display: block; }
.fsearch > svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); pointer-events: none; }
.fsearch input {
  width: 100%; height: 52px; padding: 0 48px 0 46px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card);
  color: var(--text); font: 500 16px var(--font); outline: 0; transition: border-color .2s, box-shadow .2s;
}
.fsearch input::placeholder { color: var(--muted); opacity: 1; }
.fsearch input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--glow-blue); }
.fsearch input::-webkit-search-cancel-button, .fsearch input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.fclear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 12px; }
.fclear:hover { color: var(--text); }
.fclear[hidden] { display: none; }
.ftry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ftry[hidden] { display: none; }
.ftry__l { font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.ftry .chip, .fmini__ex .chip { padding: 6px 14px; font-size: 13.5px; min-height: 36px; }
.fmini { display: grid; gap: 10px; align-content: start; }
.fmini__h { font-size: 13px; font-weight: 600; color: var(--text-2); min-height: 1.4em; }
.fmini__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-height: calc(4 * 50px + 3 * 6px); align-content: start; }
.fmini__row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; min-height: 50px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); transition: border-color .2s, background-color .2s;
}
.fmini__row:hover { border-color: var(--line-2); background: var(--card-2); }
.fmini__name { font-weight: 600; font-size: 15px; color: var(--text); }
.fmini__grp { font-size: 12.5px; color: var(--muted); }
.fmini__none { padding: 14px; font-size: 14px; color: var(--text-2); display: grid; gap: 12px; justify-items: start; }
.fmini__ex { display: flex; flex-wrap: wrap; gap: 8px; }
.fmini__go { justify-self: start; }
.fmini__go[hidden] { display: inline-flex; visibility: hidden; }
.ffind mark, .fx mark { background: var(--mark-bg); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ===== sticky filter bar ======================================================================================= */
.fbar {
  position: sticky; top: calc(var(--header-h) + 10px); z-index: 20; margin-bottom: 36px; padding: 14px 16px; border-radius: 18px;
  background: var(--nav-bg); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.fbar [hidden] { display: none !important; }
.fbar__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.fbar__form { flex: 1 1 300px; min-width: 0; }
.fbar .fsearch input { height: 46px; }
.fbar__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.fbar .chip { padding: 6px 13px; font-size: 13px; min-height: 36px; }
.fbar .chip[aria-pressed="true"] small { opacity: .9; }
.fbar .chip.is-zero { opacity: .5; }
.fbar__more { position: relative; }
.fbar__more summary {
  list-style: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text-2); font: 600 13px var(--font); cursor: pointer; transition: color .2s, border-color .2s;
}
.fbar__more summary::-webkit-details-marker { display: none; }
.fbar__more summary:hover, .fbar__more[open] summary { color: var(--text); border-color: var(--line-2); }
.fbar__more summary b { font: 700 11.5px var(--mono); color: #1a1200; background: var(--gold); border-radius: 999px; padding: 1px 7px; }
.fbar__more summary b:empty { display: none; }
.fbar__more[open] summary svg { transform: rotate(180deg); }
.fbar__panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; width: min(540px, 86vw); display: flex; flex-wrap: wrap; gap: 8px; padding: 16px;
  border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.fcount { margin-left: auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.fcount b { color: var(--text); font-family: var(--mono); }
.fbar__groups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
html:not(.js) .fbar__top { display: none; }
html:not(.js) .fbar__groups { margin-top: 0; padding-top: 0; border-top: 0; }
html:not(.js) .fbar { position: static; }

/* ===== the catalog ============================================================================================= */
.fresults { display: grid; gap: 64px; }
.fresults[hidden], .fgroup[hidden], .fx[hidden], .fempty[hidden] { display: none; }
.fgroup { scroll-margin-top: calc(var(--header-h) + var(--fbar-h, 150px) + 28px); }
.fgroup:focus { outline: 0; }
.fgroup__head { display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center; margin-bottom: 20px; }
.fgroup__ico { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: rgba(77, 124, 255, .14); color: var(--blue-text); }
.fgroup__ico svg { width: 24px; height: 24px; }
.fgroup__txt p { color: var(--text-2); font-size: 15px; margin-top: 4px; max-width: 72ch; }
.fgroup__n { font-size: 14px; color: var(--muted); white-space: nowrap; }
.fgroup__n b { color: var(--text); font-family: var(--mono); }
.fgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.fx {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  scroll-margin-top: calc(var(--header-h) + var(--fbar-h, 150px) + 28px); transition: border-color .25s, background-color .25s, box-shadow .5s;
}
.fx:hover { border-color: var(--line-2); background: var(--card-2); }
.fx:focus { outline: 0; }
.fx:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.fx.is-flash { border-color: var(--gold); background: var(--card-2); box-shadow: 0 0 0 4px var(--glow-gold), 0 0 44px -8px var(--glow-gold); }
.fx__ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-3); color: var(--blue-text); }
.fx__ico svg { width: 17px; height: 17px; }
.fx__name { font: 600 15px/1.35 var(--font); color: var(--text); overflow-wrap: anywhere; }
.fx__desc { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 3px; }
.fx__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.fx__page { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; font-size: 13px; font-weight: 600; color: var(--blue-text); }
.fx__page svg { transition: transform .2s; }
.fx__page:hover svg { transform: translateX(3px); }
.fx__act { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.fx__anchor { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); transition: color .2s, background-color .2s; }
.fx__anchor:hover { color: var(--text); background: var(--card-2); }
.fx__prev {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card);
  color: var(--text-2); font: 600 12.5px var(--font); transition: color .2s, border-color .2s, background-color .2s;
}
.fx__prev:hover { color: var(--text); border-color: var(--blue); }
.fx__prev[aria-expanded="true"] { background: var(--blue-2); border-color: var(--blue-2); color: #fff; }
.chip--star { padding: 3px 10px 3px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; background: rgba(255, 187, 46, .12); border-color: rgba(255, 187, 46, .36); color: var(--gold-text); }
.fgroup__more { margin-top: 14px; }
.fgroup__more[hidden] { display: none; }
.fgroup__more svg { transition: transform .2s; }
.fgroup__more[aria-expanded="true"] svg { transform: rotate(180deg); }

/* preview: the real screen behind a feature, in place (the open tile spans the whole row) */
.fx.is-previewing { grid-column: 1 / -1; }
.fprev { display: none; grid-column: 1 / -1; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.fprev.is-open { display: block; }
.fprev__fig { margin: 0 auto; }
.fprev__shot { overflow: hidden; background: #181b1f; }
.fprev__shot img, .fprev .browser img { display: block; width: 100%; height: auto; }
.fprev__fig figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; text-align: left; color: var(--text-2); font-size: 14.5px; }
.fprev__fig figcaption > span:not(.fprev__chips):not(.fprev__links) { flex: 1 1 320px; }
.fprev__fig figcaption b { color: var(--text); }
.fprev__chips { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.fprev__chips:empty { display: none; }
.fprev__links { display: inline-flex; flex-wrap: wrap; gap: 8px 22px; }
.fprev__fig.is-phone { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 40px; align-items: center; justify-items: start; max-width: 760px; }
.fprev__fig.is-phone figcaption { display: grid; gap: 12px; margin: 0; justify-items: start; font-size: 16px; }
.fprev__fig.is-phone figcaption b { font: 700 20px/1.25 var(--display); }
.fprev .phone { position: relative; width: 236px; }

.fempty { padding: 56px 24px; text-align: center; color: var(--text-2); border: 1px dashed var(--line-2); border-radius: 18px; display: grid; gap: 14px; justify-items: center; }
.fempty h3 { color: var(--text); }
.fempty p { max-width: 52ch; }

.rel__body .fcov__n { font: 600 12.5px var(--mono); color: var(--blue-text); margin-top: 6px; }
.rel__body .fcov__n:empty { display: none; }

@media (max-width: 1100px) {
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
  .fbar { top: calc(var(--header-h) + 4px); padding: 10px; border-radius: 16px; margin-bottom: 28px; }
  .fbar__top { flex-wrap: nowrap; gap: 10px; }
  .fbar__form { flex: 1 1 0; }
  .fbar__more { display: none; }
  .fcount { margin-left: 0; font-size: 13px; }
  .fbar__tags { display: contents; }
  .fbar__groups { flex-wrap: nowrap; overflow-x: auto; margin-top: 10px; padding-top: 10px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .fbar__groups::-webkit-scrollbar { display: none; }
  .fbar__groups .chip { flex: 0 0 auto; }
  .fresults { gap: 44px; }
  .fgroup__head { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; }
  .fgroup__n { grid-column: 2; }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .fx__anchor { width: 40px; height: 40px; }
  .fx__prev { min-height: 40px; }
  .fx__page { min-height: 40px; }
  .fprev__fig.is-phone { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 20px; }
  .fprev__fig.is-phone figcaption { justify-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .fx, .fx__page svg, .fmini__row { transition: none; }
}
html[data-motion="reduced"] .fx, html[data-motion="reduced"] .fx__page svg, html[data-motion="reduced"] .fmini__row { transition: none; }
