/* find.html — which plugins to try. Builds on store.css (tokens, nav, footer,
   .st-btn); everything here is .fd-*. One question (goal tiles), one answer
   (six faceplates in a short rack) and a player bar fixed to the bottom. */

.fd-page { --lo: #3E7E94; --playerH: 66px; --fdEase: cubic-bezier(0.22, 0.72, 0.16, 1); }
.fd-page { padding-bottom: calc(var(--playerH) + env(safe-area-inset-bottom, 0px)); }
.st-navlinks a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

@keyframes fd-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── the question ── */
.fd-hero { padding: 46px 0 8px; }
.fd-hero h1 { font-size: clamp(42px, 6.4vw, 84px); }
.fd-lede { font-size: clamp(16px, 1.7vw, 19px); color: var(--inkMuted); max-width: 46ch; margin-top: 14px; text-wrap: pretty; }

.fd-ask { margin-top: 30px; }
.fd-goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 8px; }
/* The chosen goal fills with ink from the left (a background-size wipe); a
   press dips the tile, so the click reads as a switch thrown. */
.fd-goal { font: inherit; text-align: left; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 0;
  background-color: var(--surface); background-image: linear-gradient(var(--ink), var(--ink)); background-repeat: no-repeat;
  background-position: left center; background-size: 0% 100%;
  padding: 12px 13px 11px; min-height: 76px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; cursor: pointer;
  transition: background-size 0.28s var(--fdEase), color 0.2s ease, transform 0.12s ease, box-shadow 0.12s ease; }
.fd-goal b { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; text-transform: lowercase; }
.fd-goal span { font-family: 'JetBrains Mono', 'JetBrains Mono Fallback', monospace; font-size: 9.5px; letter-spacing: 0.5px; color: var(--inkDim); text-transform: lowercase; transition: color 0.2s ease; }
.fd-goal:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26, 24, 20, 0.1); }
.fd-goal:active { transform: scale(0.97); box-shadow: none; }
.fd-goal[aria-checked="true"] { background-size: 100% 100%; color: var(--bg); }
.fd-goal[aria-checked="true"] span { color: #B3AC9D; }

/* ── the answer ── */
.fd-found { margin-top: 44px; scroll-margin-top: 74px; }
.fd-foundhead { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px 24px;
  border-top: 1.5px solid var(--ink); padding-top: 16px; margin-bottom: 18px; }
.fd-foundhead h2 { font-size: clamp(26px, 3.4vw, 40px); max-width: 22ch; }
.fd-src { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fd-src > .mono { font-size: 10px; font-weight: 600; letter-spacing: 1px; color: var(--inkDim); text-transform: lowercase; }

/* Switch highlights: one ::before per group, placed by finder.js (--x, --w),
   so a change slides it across. .fd-ani comes after the first layout, so the
   page does not open with it sliding in from the edge. */
.fd-seg, .fd-ab { position: relative; isolation: isolate; display: inline-flex; }
.fd-seg::before, .fd-ab::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; z-index: -1;
  width: var(--w, 0px); transform: translateX(var(--x, 0px)); background: var(--ind, var(--ink)); }
.fd-ani::before { transition: transform 0.3s var(--fdEase), width 0.3s var(--fdEase); }
.fd-seg { border: 1.5px solid var(--ink); background: var(--surface); }
.fd-seg button { font: inherit; font-size: 13px; font-weight: 600; text-transform: lowercase; color: var(--ink); background: transparent; border: 0;
  padding: 7px 11px; cursor: pointer; transition: color 0.2s ease; }
.fd-seg button + button { border-left: 1px solid var(--hairline2); }
.fd-seg button[aria-pressed="true"] { color: var(--bg); }

/* The rack: six modules side by side in one ink frame, hairlines between. */
.fd-rack { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--hairline2); border: 1.5px solid var(--ink); }
.fd-mod { display: flex; flex-direction: column; background: var(--surface); min-width: 0; position: relative; }
.fd-mod.enter { animation: fd-up 0.46s var(--fdEase) both; animation-delay: calc(var(--i, 0) * 45ms); }
.fd-mod.playing { box-shadow: inset 0 0 0 2px var(--oxblood); z-index: 1; }
.fd-face { position: relative; display: flex; align-items: center; justify-content: center; height: 340px; padding: 18px 12px 14px; overflow: hidden;
  background: var(--surface2); background-image: radial-gradient(var(--dotAlpha) 1px, transparent 1px); background-size: 4px 4px; }
.fd-face img { display: block; max-height: 100%; max-width: 100%; width: auto; height: auto;
  filter: drop-shadow(0 8px 12px rgba(26, 24, 20, 0.2)); transition: transform 0.2s var(--fdEase); }
.fd-face:hover img, .fd-face:focus-visible img { transform: translateY(-5px); }
/* While a module plays, its faceplate breathes with the audio (--lvl, 0..1,
   set per frame by finder.js) and a meter runs along the foot of the panel. */
.fd-mod.playing .fd-face img { transform: scale(calc(1 + var(--lvl, 0) * 0.04)); transition: none;
  filter: drop-shadow(0 calc(8px + var(--lvl, 0) * 10px) calc(12px + var(--lvl, 0) * 14px) rgba(140, 42, 31, calc(0.2 + var(--lvl, 0) * 0.3))); }
.fd-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.fd-meter i { display: block; height: 100%; width: calc(var(--lvl, 0) * 100%); background: var(--oxblood); }
.fd-mod:not(.playing) .fd-meter i { width: 0; }
.fd-free { position: absolute; top: 10px; left: 10px; background: var(--oxblood); color: var(--bg); font-size: 9px; font-weight: 700; letter-spacing: 1px; padding: 3px 6px; text-transform: lowercase; }
.fd-name { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; text-transform: lowercase; padding: 12px 12px 0; overflow-wrap: anywhere; }
.fd-name a { color: var(--ink); text-decoration: none; }
.fd-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fd-tag { font-size: 12.5px; line-height: 1.35; color: var(--inkMuted); padding: 4px 12px 12px; }
/* pinned to the foot of the card, so the six button rows line up whatever the taglines */
.fd-acts { margin: auto 12px 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.fd-hear { font: inherit; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink); padding: 8px 13px 8px 11px; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: 0.3px; text-transform: lowercase; transition: transform 0.12s ease, background-color 0.2s ease; }
.fd-hear:hover { transform: translateY(-1px); }
.fd-hear svg { width: 10px; height: 10px; fill: currentColor; }
.fd-mod.playing .fd-hear { background: var(--oxblood); border-color: var(--oxblood); }
.fd-try { font-size: 12px; font-weight: 600; letter-spacing: 0.3px; color: var(--oxblood); text-decoration: none; text-transform: lowercase; white-space: nowrap; }
.fd-try:hover { text-decoration: underline; text-underline-offset: 3px; }
.fd-more { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 20px; }
.fd-more a { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; color: var(--oxblood); }
.fd-empty { border: 1.5px dashed var(--hairline2); padding: 30px 20px; text-align: center; color: var(--inkMuted); }

/* ── player ── */
.fd-player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--ink); color: var(--bg);
  padding: 10px max(20px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.fd-prog { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #3F392F; }
.fd-prog i { display: block; height: 100%; width: 0; background: var(--oxblood); }
.fd-player-in { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; min-height: 46px; }
.fd-pthumb { height: 46px; width: auto; display: block; transform: scale(calc(1 + var(--lvl, 0) * 0.06)); }
.fd-now { min-width: 0; }
.fd-now b { display: block; font-size: 14px; font-weight: 700; text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-now span { display: block; font-size: 9.5px; letter-spacing: 0.6px; color: #B3AC9D; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the spectrum of what you are hearing: slate while dry, cream through the module */
.fd-scope { display: block; width: 150px; height: 34px; }
.fd-ab { --ind: var(--bg); border: 1.5px solid #5C544A; }
.fd-ab button { font: inherit; font-size: 12px; font-weight: 600; text-transform: lowercase; background: none; border: 0; color: var(--bg); padding: 8px 12px; cursor: pointer; transition: color 0.2s ease; }
.fd-ab button[aria-pressed="true"] { color: var(--ink); }
.fd-stop { font: inherit; font-size: 12px; font-weight: 600; text-transform: lowercase; background: none; color: var(--bg); border: 1.5px solid #5C544A; padding: 8px 12px; cursor: pointer; }
.fd-player button:focus-visible { outline-color: var(--bg); }

/* ── narrow ── */
@media (max-width: 1000px) {
  .fd-rack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .fd-hero { padding-top: 24px; }
  .fd-ask { margin-top: 20px; }
  .fd-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .fd-goal { min-height: 0; padding: 10px 10px 9px; }
  .fd-goal b { font-size: 14.5px; }
  .fd-goal span { display: none; }
  .fd-found { margin-top: 30px; }
  .fd-rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-face { height: 270px; }
}
@media (max-width: 520px) {
  .fd-pthumb { display: none; }
  .fd-scope { width: 64px; }
  .fd-player-in { grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; }
  .fd-ab button, .fd-stop { padding: 8px 9px; }
  .fd-face { height: 236px; padding: 14px 8px 12px; }
  .fd-name { font-size: 15.5px; padding: 10px 10px 0; }
  .fd-tag { padding: 3px 10px 0; font-size: 12px; }
  .fd-acts { margin: auto 10px 12px; padding-top: 10px; gap: 8px 10px; }
}
@media (max-width: 400px) {
  .fd-scope { display: none; }                  /* the name needs the room more than the bars do */
  .fd-player-in { grid-template-columns: minmax(0, 1fr) auto auto; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-goal, .fd-face img, .fd-hear, .fd-ani::before, .fd-seg button, .fd-ab button { transition: none !important; }
  .fd-mod.enter { animation: none !important; }
  .fd-mod.playing .fd-face img, .fd-pthumb { transform: none; }
}
