/* Signal Dark — home screen styles (P4, epic #1525)
 *
 * Lifted VERBATIM from tests/parity/mockups/pwa-redesign.html <style>.
 * Shared atoms (.frame, .sb, .cut, .mono, .bdg, .btn, .sect, .statgrid,
 * .trow, .fnav, tokens) live in signal-dark.css and are NOT duplicated here.
 * This file owns only the home-specific layout modules.
 */

/* scrollable body */
.fbody { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; display: flex; flex-direction: column; }
/* Direct children must keep their natural height — without this they shrink to
   fit the flex column (default flex-shrink:1), so a long screen (filters!)
   compresses + truncates instead of scrolling. flex-shrink:0 = real scroll. */
.fbody > * { flex-shrink: 0; }

/* page masthead (shared by home + results) */
.mast { padding: 12px 18px 0; display: flex; justify-content: space-between; align-items: baseline; }
.mast .t { font-weight: 900; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; }
.mast .t i { color: var(--accT); font-style: normal; }
/* allcars.cy brand wordmark (replaces the old "ALLCARS INDEX" text mark) */
.mast .t.brandmark { text-transform: none; letter-spacing: -.01em; font-weight: 800; font-size: 15px; }
.brandmark .cy { color: var(--accT); }
.mast .x { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--mut2); }

/* .hdr (page header row) is a shared atom — now in signal-dark.css so every
 * screen + standalone harness gets it regardless of home.css load order (P4). */

/* hero block */
.hero { padding: 18px 18px 0; }
.hero h1 { font-weight: 900; font-size: 37px; letter-spacing: -.04em; line-height: .97; }
.hero h1 em { font-style: normal; color: var(--accT); }
.hero .sub { font-size: 11px; color: var(--mut); margin-top: 7px; }

/* market stats strip */
.mstrip { display: flex; margin: 15px 18px 0; border: 1px solid var(--line); background: var(--card); }
.mstrip div { flex: 1; padding: 9px 11px; border-right: 1px solid var(--line); }
.mstrip div:last-child { border-right: none; }
.mstrip .k { font-family: "JetBrains Mono", monospace; font-size: 7px; color: var(--mut2); letter-spacing: .12em; text-transform: uppercase; }
.mstrip .v { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 14px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.mstrip .v.up { color: var(--good); }
.mstrip .v.dn { color: var(--high); }

/* action cards */
.act { margin: 14px 18px 0; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 13px; padding: 14px; cursor: pointer; position: relative; }
.act .aic { width: 46px; height: 46px; flex-shrink: 0; background: var(--card2); display: flex; align-items: center; justify-content: center; color: var(--accT); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.act h3 { font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; }
.act p { font-size: 10.5px; color: var(--mut); margin-top: 3px; line-height: 1.4; }
.act .tag { position: absolute; top: -8px; right: 12px; font-family: "JetBrains Mono", monospace; font-size: 7.5px; font-weight: 700; letter-spacing: .1em; background: var(--accFill); color: var(--acc-ink); padding: 3px 8px; }
.act .go { margin-left: auto; color: var(--mut2); }

/* section shared override for home */
.sect { margin: 14px 18px 0; background: var(--card); border: 1px solid var(--line); }
.sect .shd { display: flex; justify-content: space-between; align-items: center; font-family: "JetBrains Mono", monospace; font-size: 8.5px; color: var(--mut2); letter-spacing: .16em; text-transform: uppercase; padding: 9px 13px 8px; border-bottom: 1px solid var(--line); }
.sect .shd b { color: var(--accT); }

/* alerts list rows */
.alrow { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.alrow:last-child { border-bottom: none; }
.alrow .ai { width: 26px; height: 26px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--card2); outline: 1px solid var(--line2); color: var(--good); }
.alrow .at { flex: 1; min-width: 0; }
.alrow .at .a1 { font-weight: 800; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alrow .at .a1 b { color: var(--good); }
.alrow .at .a2 { font-family: "JetBrains Mono", monospace; font-size: 8px; color: var(--mut2); margin-top: 2px; letter-spacing: .05em; }
.alrow .tm { font-family: "JetBrains Mono", monospace; font-size: 8px; color: var(--mut2); flex-shrink: 0; }

/* toolbox 3-col grid */
.toolgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 11px 13px; }
.tool { background: var(--card2); outline: 1px solid var(--line2); padding: 11px 6px 10px; text-align: center; cursor: pointer; }
.tool iconify-icon { color: var(--accT); }
.tool .tn { font-weight: 800; font-size: 10.5px; margin-top: 5px; line-height: 1.15; }
.tool .ts { font-family: "JetBrains Mono", monospace; font-size: 6.5px; color: var(--mut2); margin-top: 3px; letter-spacing: .05em; text-transform: uppercase; }

/* trending table rows */
.trow2 { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line); font-size: 12px; }
.trow2:last-child { border-bottom: none; }
.trow2 .rk { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 10px; color: var(--accT); width: 14px; }
.trow2 .nm { font-weight: 800; flex: 1; }
.trow2 .n { font-family: "JetBrains Mono", monospace; font-size: 8.5px; color: var(--mut2); }

/* resume / past-search pill */
.resume { margin: 14px 18px 0; display: flex; align-items: center; gap: 10px; background: var(--card2); outline: 1px solid var(--line2); padding: 10px 13px; cursor: pointer; }
.resume .rt { flex: 1; font-size: 11px; font-weight: 700; }
.resume .rt small { display: block; font-family: "JetBrains Mono", monospace; font-size: 8px; color: var(--mut2); margin-top: 2px; letter-spacing: .08em; }
.resume iconify-icon { color: var(--accT); }

/* "How this works" pill (issue #1675) — centered project-info entry, restored
 * from the monolith's home screen. Matches SD chrome: sharp corners, mono caps. */
.howwrap { display: flex; justify-content: center; margin: 18px 18px 0; }
.howbtn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card2); outline: 1px solid var(--line2); border: none;
  color: var(--accT); cursor: pointer;
  font-family: "JetBrains Mono", monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 16px;
}
.howbtn iconify-icon { color: var(--accT); }

/* Project-info sheet — bottom sheet overlaid on the phone .frame. */
.about-ov {
  position: absolute; inset: 0; z-index: 90;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity .18s ease;
}
.about-ov.open { opacity: 1; }
.about-sheet {
  position: relative;
  background: var(--card); border-top: 1px solid var(--line2);
  max-height: 96%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 16px 16px;
  transform: translateY(12px); transition: transform .18s ease;
}
.about-ov.open .about-sheet { transform: translateY(0); }
.about-grab {
  width: 38px; height: 4px; margin: 0 auto 6px;
  background: var(--line2); border-radius: 2px;
}
.about-x {
  position: absolute; top: 8px; right: 10px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--card2); outline: 1px solid var(--line2); border: none;
  color: var(--mut); cursor: pointer;
}
.about-h {
  font-weight: 900; font-size: 17px; letter-spacing: -.02em;
  margin: 0 0 8px; color: var(--text);
}
.about-k {
  font-family: "JetBrains Mono", monospace; font-size: 8.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accT);
  margin-top: 11px;
}
/* non-commercial / pet-project intro — green in both themes (--good). */
.about-intro {
  font-size: 12px; line-height: 1.5; font-weight: 700;
  color: var(--good); margin: 0 0 4px;
}
.about-p { font-size: 11.5px; line-height: 1.5; color: var(--mut); margin-top: 7px; }
.about-p b { color: var(--text); font-weight: 800; }

/* 2-column feature grid — compact so the whole sheet fits one screen */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 7px;
}
.about-grid span {
  font-size: 11px; line-height: 1.5; color: var(--mut);
  padding-left: 13px; position: relative;
}
.about-grid span::before { content: "▸"; position: absolute; left: 0; color: var(--accT); }

/* inline documentation links woven into the sheet copy */
.about-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 9px; }
.about-link {
  font-family: "JetBrains Mono", monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: .03em; color: var(--accT); text-decoration: none;
  white-space: nowrap;
}
.about-p .about-link { border-bottom: 1px solid currentColor; }
.about-note {
  font-size: 11px; line-height: 1.5; color: var(--text);
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.about-contact {
  display: block; text-align: center; margin-top: 11px; padding: 10px;
  background: var(--card2); outline: 1px solid var(--line2);
  color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 12px;
}

/* legal / support footer row */
.about-foot {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
  gap: 6px 16px; margin-top: 12px;
}
.about-foot-link {
  font-family: "JetBrains Mono", monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--mut); text-decoration: none;
}
/* ── Golden, shimmering, sparkling Donate ─────────────────────────────── */
.about-foot-link.about-donate {
  position: relative;
  color: #f6c64a;            /* solid-gold fallback (no background-clip support) */
  font-weight: 800;
  overflow: visible;
}
.about-donate-txt {
  background: linear-gradient(100deg,
    #a9760a 0%, #ffd700 22%, #fff6c4 42%, #ffe680 58%, #ffd700 78%, #a9760a 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: about-gold-shimmer 2.6s linear infinite;
  text-shadow: 0 0 8px rgba(255, 208, 64, .35);
}
/* twinkling sparkles flanking the label */
.about-donate .spk {
  color: #fff3b0; -webkit-text-fill-color: #fff3b0;
  font-size: 8px; line-height: 1;
  animation: about-sparkle 1.7s ease-in-out infinite;
}
.about-donate .spk-a { margin-right: 4px; animation-delay: .15s; }
.about-donate .spk-b { margin-left: 4px; animation-delay: .95s; }

@keyframes about-gold-shimmer { to { background-position: -220% center; } }
@keyframes about-sparkle {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1) rotate(90deg); }
}

/* Honor reduced-motion: keep the gold, drop the animation. */
@media (prefers-reduced-motion: reduce) {
  .about-donate-txt { animation: none; }
  .about-donate .spk { animation: none; opacity: .9; }
}

/* Keyboard focus visibility for role=button elements */
.act:focus-visible,
.tool:focus-visible,
.alrow:focus-visible,
.resume:focus-visible,
.howbtn:focus-visible,
.about-x:focus-visible,
.about-contact:focus-visible,
.about-link:focus-visible,
.about-foot-link:focus-visible {
  outline: 2px solid var(--accT);
  outline-offset: -2px;
}

/* bottom spacer so last section clears the fnav */
.fbody-end { height: 16px; }
