/* The Cracked Ad Library (features/longrunners) and its strip on the home page. Tokens and recipes from mobile-tokens.css
   (plates, wells, pills); the page frame is the journey shell. Signature pieces: the skyline on each category card (the top
   ads' days, one scale for every card) and the timeline on a category page (each bar starts the day the ad went live). */
.lib{max-width:560px;margin:0 auto;padding:8px 16px calc(56px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:40px}
.lib-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.lib h1{font-size:var(--text-display);letter-spacing:var(--track-display);line-height:1}
.lib h2{font-size:var(--text-title);letter-spacing:var(--track-title);line-height:1.1}
.lib-lead{color:var(--muted);font-size:var(--text-lead);line-height:1.5}
.lib-kicker{align-self:flex-start;display:inline-flex;align-items:center;gap:8px;padding:6px 12px 6px 10px;border-radius:var(--radius-pill);background:var(--accent-tint);box-shadow:inset 0 0 0 1px rgba(255,121,74,.28);color:var(--link);font-size:var(--text-caption);font-weight:800;letter-spacing:.06em;text-transform:uppercase;line-height:1.2}
.lib-kicker::before{content:'';width:12px;height:11px;flex:none;background:linear-gradient(var(--accent),var(--accent)) 0 100%/3px 55% no-repeat,linear-gradient(var(--accent),var(--accent)) 4.5px 100%/3px 100% no-repeat,linear-gradient(var(--accent),var(--accent)) 9px 100%/3px 75% no-repeat}
.lib-kicker a{color:inherit;text-decoration:none}
.lib-kicker span[aria-hidden]{opacity:.5}

/* ---------- the library ---------- */
.lib-hero,.cat-hero{display:flex;flex-direction:column;gap:16px;padding-top:8px}
.lib-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:6px 0 0}
.lib-stats div{display:flex;flex-direction:column-reverse;justify-content:flex-end;gap:4px;padding:12px 12px 13px;border-radius:16px;background:var(--grad-surface);box-shadow:var(--hi),var(--ring),var(--elev-1)}
.lib-stats dt{color:var(--muted);font-size:var(--text-caption);line-height:1.3}
.lib-stats dd{margin:0;font-size:1.3125rem;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums;line-height:1.1}
.lib-stats small{font-size:.8125rem;font-weight:700;color:var(--muted);letter-spacing:0}

.lib-find{display:flex;flex-direction:column;gap:22px}
.lib-tools{display:flex;flex-direction:column;gap:12px}
.lib-search{display:flex;align-items:center;gap:10px;min-height:52px;padding:0 16px;border-radius:var(--radius-pill);background:var(--bg-deep);box-shadow:inset 0 2px 4px rgba(0,0,0,.35),0 0 0 1px var(--line-strong);transition:box-shadow var(--dur-hover) var(--ease-press)}
.lib-search:focus-within{box-shadow:inset 0 2px 4px rgba(0,0,0,.35),0 0 0 1px var(--accent-ring),0 0 0 4px var(--accent-tint)}
.lib-search svg{width:20px;height:20px;flex:none;fill:none;stroke:var(--faint);stroke-width:2;stroke-linecap:round}
.lib-search input{flex:1;min-width:0;height:50px;border:0;background:none;color:var(--ink);font:inherit;font-size:1rem;outline:none}
.lib-search input::placeholder{color:var(--faint)}
.lib-search input::-webkit-search-cancel-button{filter:invert(.7)}
.lib-tabs{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}
.lib-tab{flex:none;min-height:38px;padding:0 16px;border:0;border-radius:var(--radius-pill);background:var(--grad-raised);box-shadow:var(--btn-secondary);color:var(--muted);font:inherit;font-size:var(--text-small);font-weight:700;cursor:pointer}
.lib-tab[aria-pressed="true"]{background:var(--ink);color:var(--bg);box-shadow:none}
.lib-group{display:flex;flex-direction:column;gap:12px}
.lib-group>h2{font-size:var(--text-caption);font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--faint)}
.lib-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.lib-card a{position:relative;display:flex;flex-direction:column;gap:12px;height:100%;padding:14px 14px 13px;border-radius:18px;background:var(--grad-surface);box-shadow:var(--hi),var(--ring),var(--elev-1);color:var(--ink);text-decoration:none;transition:transform var(--dur-release) var(--ease-press),box-shadow var(--dur-hover) var(--ease-press);-webkit-tap-highlight-color:transparent}
.lib-card a:active{transform:scale(var(--press));transition-duration:var(--dur-micro)}
.lc-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.lc-name{font-size:1rem;font-weight:800;letter-spacing:-.02em;line-height:1.2}
.lc-top svg{width:16px;height:16px;flex:none;margin-top:2px;fill:none;stroke:var(--faint);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.lc-sky{display:flex;align-items:flex-end;gap:3px;height:52px;padding-bottom:1px;box-shadow:inset 0 -1px 0 var(--line-strong)}
.lc-sky i{flex:1;height:var(--h);min-height:2px;border-radius:3px 3px 1px 1px;background:linear-gradient(180deg,rgba(255,149,110,.75),rgba(255,121,74,.18))}
.lc-sky i:first-child{background:linear-gradient(180deg,#ffb08f,var(--accent));box-shadow:0 0 14px -2px rgba(255,121,74,.55)}
.lc-foot{display:flex;flex-direction:column;gap:2px;color:var(--muted);font-size:var(--text-caption);line-height:1.35}
.lc-foot b{color:var(--ink);font-size:.9375rem;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.lib-key{display:flex;align-items:center;gap:10px;margin-top:-8px;color:var(--faint);font-size:var(--text-caption);line-height:1.4}
.lib-key-sky{display:flex;align-items:flex-end;gap:2px;height:14px;flex:none}.lib-key-sky i{width:4px;border-radius:1px;background:var(--accent)}.lib-key-sky i:nth-child(1){height:100%}.lib-key-sky i:nth-child(2){height:60%;opacity:.7}.lib-key-sky i:nth-child(3){height:35%;opacity:.5}
.lib-card[hidden],.lib-group[hidden]{display:none}
.lib-empty{padding:16px;border-radius:16px;background:var(--grad-surface);box-shadow:var(--hi),var(--ring);color:var(--muted);font-size:var(--text-small)}

/* ---------- a category ---------- */
.cat-record{display:flex;flex-direction:column;gap:6px;margin-top:4px;padding:18px 18px 16px;border-radius:var(--radius-card);background:radial-gradient(90% 70% at 0% 0%,rgba(255,121,74,.16),rgba(255,121,74,0) 70%),var(--grad-surface);box-shadow:var(--hi),var(--ring),var(--elev-2)}
.rec-num{display:flex;align-items:baseline;gap:8px;color:var(--muted);font-size:1.0625rem;font-weight:700}
.rec-num b{font-size:3.25rem;font-weight:800;letter-spacing:-.05em;line-height:1;font-variant-numeric:tabular-nums;background:linear-gradient(180deg,#fff 20%,#ffc2a8);-webkit-background-clip:text;background-clip:text;color:transparent}
.rec-what{color:var(--muted);font-size:var(--text-small);line-height:1.45}

.fx{display:flex;flex-direction:column;gap:14px}
.fx-head{display:flex;flex-direction:column;gap:6px}.fx-head p{color:var(--muted);font-size:var(--text-small);line-height:1.45}
.fx-base{color:var(--ink);font-size:var(--text-caption);font-weight:700;font-variant-numeric:tabular-nums}
.fx-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.fx-tile{display:flex;flex-direction:column;gap:6px;padding:14px;border-radius:18px;background:var(--grad-surface);box-shadow:var(--hi),var(--ring),var(--elev-1)}
.fx-big{font-size:1.5rem;font-weight:800;letter-spacing:-.035em;line-height:1;font-variant-numeric:tabular-nums}
.fx-what{font-size:var(--text-small);font-weight:700;line-height:1.3}
.fx-tile:last-child:nth-child(odd){grid-column:1/-1}
.fx-meter{position:relative;display:block;height:8px;margin:6px 0 2px;border-radius:var(--radius-pill);background:rgba(255,255,255,.07)}
.fx-meter::before{content:'';position:absolute;z-index:1;left:var(--b);top:-4px;bottom:-4px;width:2px;margin-left:-1px;border-radius:1px;background:var(--ink);box-shadow:0 0 0 2px var(--surface)}
.fx-meter::after{content:'';position:absolute;inset:0 auto 0 0;width:var(--k);border-radius:inherit;background:var(--grad-accent)}
.fx-sub{color:var(--muted);font-size:var(--text-caption);line-height:1.4}

.tl{display:flex;flex-direction:column;gap:10px}
.tl-head{display:flex;flex-direction:column;gap:6px}
.tl-head p{color:var(--muted);font-size:var(--text-small);line-height:1.45}
.tl-axis{position:relative;height:22px;margin:4px 12px 0 48px}
.tl-tick{position:absolute;left:var(--x);bottom:4px;transform:translateX(-50%);color:var(--faint);font-size:.6875rem;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.tl-tick::after{content:'';position:absolute;left:50%;top:100%;width:1px;height:5px;background:var(--line-strong)}
.tl-tick.is-start{transform:none}.tl-tick.is-start::after{left:0}
.tl-tick.is-now{transform:translateX(-100%);color:var(--link)}.tl-tick.is-now::after{left:auto;right:0}
.tl-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.tl-row{display:grid;grid-template-columns:26px minmax(0,1fr) auto;grid-template-areas:"rank brand days" "rank track track" "rank meta meta" "rank note note";column-gap:10px;row-gap:8px;padding:16px 12px;border-radius:16px;color:var(--ink);text-decoration:none;box-shadow:inset 0 1px 0 var(--line);transition:background var(--dur-hover) var(--ease-press);-webkit-tap-highlight-color:transparent}
.tl-list li:first-child .tl-row{box-shadow:none}
.tl-row:hover{background:rgba(255,255,255,.03)}
.tl-row:active{background:rgba(255,255,255,.05)}
.tl-row:focus-visible{outline:2px solid var(--accent-ring);outline-offset:2px}
.tl-rank{grid-area:rank;color:var(--faint);font-size:1rem;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.35}
.tl-list li:nth-child(-n+3) .tl-rank{color:var(--link)}
.tl-brand{grid-area:brand;min-width:0;font-size:1.0625rem;font-weight:800;letter-spacing:-.015em;line-height:1.3;overflow-wrap:anywhere}
.tl-days{grid-area:days;color:var(--muted);font-size:var(--text-small);white-space:nowrap;line-height:1.35}
.tl-days b{color:var(--ink);font-size:1.25rem;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.tl-track{grid-area:track;position:relative;height:10px;border-radius:var(--radius-pill);background:repeating-linear-gradient(90deg,rgba(255,255,255,.045) 0 2px,transparent 2px 6px)}
.tl-bar{position:absolute;top:0;bottom:0;left:var(--s);right:0;border-radius:var(--radius-pill);background:linear-gradient(90deg,rgba(255,121,74,.35),var(--accent) 70%,#ffb08f);box-shadow:0 0 12px -3px rgba(255,121,74,.6)}
.tl-bar::after{content:'';position:absolute;right:-1px;top:50%;width:14px;height:14px;margin-top:-7px;border-radius:50%;background:#ffd2bf;box-shadow:0 0 0 3px rgba(255,121,74,.3),0 0 12px rgba(255,121,74,.8)}
.tl-meta{grid-area:meta;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;color:var(--muted);font-size:var(--text-caption)}
.tl-chip{padding:3px 9px;border-radius:var(--radius-pill);background:rgba(255,255,255,.06);box-shadow:inset 0 0 0 1px var(--line);color:var(--ink);font-weight:700}
.tl-note{grid-area:note;color:var(--muted);font-size:var(--text-small);line-height:1.5}
.tl-open{margin-left:auto;display:inline-flex;align-items:center;gap:4px;color:var(--link);font-size:var(--text-small);font-weight:700}
.lib-out{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- ask and check ---------- */
.la,.chk{display:flex;flex-direction:column;gap:14px;padding:24px 18px 20px;border-radius:var(--radius-sheet);background:radial-gradient(110% 45% at 50% 0%,rgba(255,121,74,.13),rgba(255,121,74,0) 72%),var(--grad-surface);box-shadow:var(--hi),var(--ring),var(--elev-2)}
.la-k{display:flex;align-items:center;gap:8px;color:var(--link);font-size:var(--text-caption);font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.la-k svg{width:16px;height:16px;fill:var(--accent)}
.la-lead,.chk-lead{color:var(--muted);font-size:var(--text-small);line-height:1.5}
.la-qs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.la-q{display:block;padding:12px 16px;border-radius:16px;background:var(--grad-raised);box-shadow:var(--btn-secondary);color:var(--ink);font-size:.9375rem;font-weight:600;line-height:1.35;text-decoration:none;transition:transform var(--dur-release) var(--ease-press)}
.la-q::before{content:'\201C';color:var(--link);font-weight:800;margin-right:2px}
.la-q::after{content:'\201D';color:var(--link);font-weight:800;margin-left:1px}
.la-q:active{transform:scale(var(--press));transition-duration:var(--dur-micro)}
.chk-num{color:var(--muted);font-size:1.0625rem;font-weight:700}
.chk-num b{color:var(--success);font-size:2.25rem;font-weight:800;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.chk-what{margin-top:-8px;color:var(--muted);font-size:var(--text-small);line-height:1.5}
.chk .xr-form{margin-top:4px}

.lib-more{display:flex;flex-direction:column;gap:12px}
.lib-more h2{font-size:var(--text-caption);font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--faint)}
.lib-more ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.lib-chip{display:inline-flex;align-items:center;min-height:38px;padding:0 14px;border-radius:var(--radius-pill);background:var(--grad-raised);box-shadow:var(--btn-secondary);color:var(--ink);font-size:var(--text-small);font-weight:700;text-decoration:none}
.lib-chip.is-other{color:var(--muted)}
.lib-more p a,.lib-fine a{color:var(--link);text-underline-offset:3px}
.lib-fine{color:var(--faint)}


@media (prefers-reduced-motion:no-preference){
 .tl-bar{transform-origin:right;animation:tl-grow 900ms var(--ease-out) both}
 @keyframes tl-grow{from{transform:scaleX(0)}}
 .lc-sky i{transform-origin:bottom;animation:lc-rise 700ms var(--ease-out) both}
 @keyframes lc-rise{from{transform:scaleY(.1)}}
}
@media (hover:hover){
 .lib-card a:hover{box-shadow:var(--hi),0 0 0 1px rgba(255,121,74,.35),var(--elev-2)}
 .lib-card a:hover .lc-top svg{stroke:var(--link)}
 .la-q:hover,.lib-chip:hover{background:var(--surface-pressed)}
}

@media (min-width:40rem){
 .lib-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .fx-grid{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
 .fx-tile:last-child:nth-child(odd){grid-column:auto}
}
@media (min-width:64rem){
 .lib{max-width:1080px;padding:24px 32px 80px;gap:56px}
 .lib h1{font-size:var(--text-desktop)}
 .lib-hero{max-width:760px}
 .lib-stats{max-width:620px}
 .lib-tools{flex-direction:row;align-items:center}
 .lib-search{flex:1;max-width:520px}
 .lib-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
 .lc-sky{height:64px}
 .cat-hero{display:grid;grid-template-columns:minmax(0,1fr) 360px;grid-template-areas:"kicker record" "h1 record" "lead record";column-gap:48px;row-gap:16px;align-items:start}
 .cat-hero .lib-kicker{grid-area:kicker;justify-self:start}.cat-hero h1{grid-area:h1}.cat-hero .lib-lead{grid-area:lead;max-width:560px}
 .cat-record{grid-area:record;align-self:end;margin:0}
 .tl-axis{margin:4px 160px 0 380px}
 .tl-row{grid-template-columns:32px 300px minmax(0,1fr) 128px;grid-template-areas:"rank brand track days" "rank meta note note";column-gap:16px;row-gap:8px;align-items:center;padding:16px}
 .tl-meta{flex-wrap:nowrap}
 .tl-brand{font-size:1rem}
 .tl-days{text-align:right}
 .tl-note{font-size:.8125rem;line-height:1.4}
 .la,.chk{padding:32px}
 .la-qs{flex-direction:row;flex-wrap:wrap}
 .la-go{align-self:flex-start;width:auto;padding:12px 28px}
}

/* The front door's category study (pages.mjs homeStudy): real numbers for one category per vertical, a tab each,
   public/home.js turns them. Built from the library card's skyline. */
.hs{margin:0;display:flex;flex-direction:column;gap:14px;padding:18px 18px 16px;border-radius:var(--radius-sheet);background:radial-gradient(90% 55% at 100% 0%,rgba(255,121,74,.12),rgba(255,121,74,0) 70%),var(--grad-surface);box-shadow:var(--hi),var(--ring),var(--elev-2)}
.hs-head{display:flex;flex-direction:column;gap:3px}
.hs-k{font-size:var(--text-caption);font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--link)}
.hs-n{font-size:.875rem;color:var(--muted)}
.hs-tabs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
.hs-tabs::-webkit-scrollbar{display:none}
.hs-tabs button{flex:none;min-height:36px;padding:0 14px;border:0;border-radius:var(--radius-pill);background:rgba(255,255,255,.05);box-shadow:inset 0 0 0 1px var(--line);color:var(--muted);font:inherit;font-size:.875rem;font-weight:700;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.hs-tabs button[aria-selected="true"]{background:var(--ink);box-shadow:none;color:var(--bg-deep,#111315)}
.hs-panel{display:flex;flex-direction:column;gap:14px}
.hs-panel[hidden]{display:none}
.hs-sky{height:96px}
.hs-facts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.hs-facts li{padding:9px 0;color:var(--muted);font-size:.9375rem;line-height:1.4;box-shadow:inset 0 -1px 0 var(--line)}
.hs-facts b{color:var(--ink);font-weight:800;font-variant-numeric:tabular-nums}
.hs-all{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;min-height:40px;color:var(--link);font-size:.875rem;font-weight:700;text-decoration:none}
.hs-all svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.hs-foot{font-size:.8125rem;line-height:1.45;color:var(--faint)}
.hs-foot a{color:var(--link);font-weight:700;white-space:nowrap}
@media(prefers-reduced-motion:no-preference){.hs-panel:not([hidden]){animation:rise 360ms var(--ease-out) both}}
@media(min-width:64rem){.hs{padding:24px 24px 20px}.hs-sky{height:128px}.hs-facts li{font-size:1rem}}
