/* Sift's site. The palette and the font come from /design/tokens.css, the sites' look (header, buttons, labels, cells,
   questions, footer, the privacy page) from /design/site.css, linked before this file (the monorepo's shared design,
   ../../../design/README.md). This file adds the site's own idea: the demo in the hero, a made-up page filtered by one
   of three rules chosen with radio buttons (no scripts). Choosing a rule outlines each item in turn, as the extension
   does while it asks about it, then fades what the rule sends away. The page is someone else's, so it keeps a page's
   own colours (white, near-black ink) by day and by night. Nothing loads from another host. */

/* ── Hero ───────────────────────────────────────────── */
.hero { padding-block: 56px 84px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1.04; }
.hero h1 mark { color: #29221F; background: #FC354C; padding: 0 .12em; border-radius: .14em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.more { font: 700 14px/1 var(--fire-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fire-ink); text-decoration: none; padding: 8px 0; border-bottom: 3px solid #0ABFBC; }
.more:hover { border-bottom-color: var(--fire-ink); }
.soon { font: 600 13px/1.5 var(--fire-mono); letter-spacing: .03em; margin: 22px 0 0; }

/* ── The demo ───────────────────────────────────────── */
.demo { color: var(--site-card-ink); background: var(--site-card); border-radius: var(--site-r); box-shadow: var(--site-hero) var(--site-hero) 0 var(--fire-shadow); overflow: hidden; }
/* The rule switch: a row of boxes; the chosen one on near-black. */
.rules { display: flex; flex-wrap: wrap; margin: 0; padding: 0; border: 0; }
.rules legend { float: left; padding: 16px; font: 700 12px/1.2 var(--fire-mono); letter-spacing: .08em; text-transform: uppercase; }
.rules label { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 14px; cursor: pointer; font: 700 15px/1.2 var(--fire-display); text-align: center; }
.rules label:hover { background: rgb(41 34 31 / .08); }
.rules label:has(:checked) { background: #29221F; color: #FC354C; }
.rules label:has(:focus-visible) { outline: 3px solid #0ABFBC; outline-offset: -6px; }
.rules input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.page { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 18px; background: #eef0f2; }
.page li { display: grid; gap: 3px; padding: 10px; background: #fff; color: #1f2328; border-radius: 10px; outline: 2px solid transparent; outline-offset: 3px; transition: opacity .3s, filter .3s; }
.page li i { display: block; height: 54px; margin-bottom: 4px; border-radius: 7px; background: linear-gradient(135deg, #8fb8c4, #d3e4ea); }
.page li b { font: 700 14.5px/1.25 var(--fire-display); }
.page li span { font: 500 12px/1.3 var(--fire-mono); color: #5c6670; }
.page li:nth-child(2) { --i: 1; } .page li:nth-child(3) { --i: 2; } .page li:nth-child(4) { --i: 3; }
.page li:nth-child(5) { --i: 4; } .page li:nth-child(6) { --i: 5; } .page li:nth-child(7) { --i: 6; } .page li:nth-child(8) { --i: 7; }

/* Each item outlined in turn while it is "asked about" (a keyframe name per rule, so switching starts it again)… */
.demo:has(#r-bush:checked) .page li { animation: sift-ask-1 .7s calc(var(--i, 0) * .12s) both; }
.demo:has(#r-cook:checked) .page li { animation: sift-ask-2 .7s calc(var(--i, 0) * .12s) both; }
.demo:has(#r-promo:checked) .page li { animation: sift-ask-3 .7s calc(var(--i, 0) * .12s) both; }
@keyframes sift-ask-1 { 40% { outline-color: #0ABFBC; } }
@keyframes sift-ask-2 { 40% { outline-color: #0ABFBC; } }
@keyframes sift-ask-3 { 40% { outline-color: #0ABFBC; } }
/* …then faded where the rule sends it away, as the extension draws it. */
.demo:has(#r-bush:checked) .page li:not(.bush),
.demo:has(#r-cook:checked) .page li:not(.cook),
.demo:has(#r-promo:checked) .page li.promo { opacity: .18; filter: blur(3px) grayscale(.6); transition-delay: calc(var(--i, 0) * .12s + .35s); }
.demo .page li:hover { opacity: .9; filter: none; transition-delay: 0s; }
.demo-note { margin: 0; padding: 14px 18px 18px; font: 600 12.5px/1.5 var(--fire-mono); color: var(--site-card-muted); }

.after { margin: 32px 0 0; font-weight: 650; }

@media (prefers-reduced-motion: reduce) {
  .page li { transition: none; animation: none !important; }
}

/* ── Narrow screens ─────────────────────────────────── */
@media (max-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 48px; } }
@media (max-width: 560px) {
  .rules legend { float: none; width: 100%; padding-bottom: 6px; }
  .rules label { flex-basis: 100%; }
  .page { grid-template-columns: minmax(0, 1fr); padding: 12px; }
}
