/* Home as Apple would build it (home.js): large title and date, round glass buttons, a search tab beside the bar. */
.home-head { margin-bottom: var(--sp-2); }
.home-head .titles { flex: 1; min-width: 0; }
.home-head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-head .sub { color: var(--sub); font-size: 15px; line-height: 20px; }
.home-head .glass-btn svg, .searchbar .glass-btn svg, .search-tab svg { width: 22px; height: 22px; color: var(--accent); }

/* The bar is two pieces of glass: the tabs, and the search tab apart at the trailing end. */
nav.tabbar, :root:not([data-theme="light"]) nav.tabbar { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; gap: var(--sp-2); align-items: center; }
.tabbar .tabs { display: flex; gap: var(--sp-1); padding: var(--sp-1); border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .26); backdrop-filter: blur(30px) saturate(190%) brightness(1.3); -webkit-backdrop-filter: blur(30px) saturate(190%) brightness(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 .5px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .12); }
.search-tab { width: 56px; height: 56px; }

/* Searching: the field takes the bar's place at the bottom, with a round close button beside it. */
.searchbar { display: none; }
body.searching .searchbar { display: flex; gap: var(--sp-2); align-items: center; position: fixed; z-index: 7; left: 16px; right: 16px;
  bottom: max(var(--sp-4), env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; }
body.searching .searchbar .search { flex: 1; margin: 0; height: 48px; background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 .5px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .12); }
body.searching nav.tabbar, body.searching .mini { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar .tabs { background: rgba(28, 28, 30, .34); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .4); }
  :root:not([data-theme="light"]) body.searching .searchbar .search { background: rgba(28, 28, 30, .5); }
}
:root[data-theme="dark"] .tabbar .tabs { background: rgba(28, 28, 30, .34); }
@media (prefers-reduced-transparency: reduce) {
  .tabbar .tabs, body.searching .searchbar .search { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Unread: a dot in the margin, like Mail, so every title still starts on the same edge (rows.js) */
.row.story .txt { position: relative; }
.row.story .unread { position: absolute; left: -14px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); overflow: hidden; color: transparent; font-size: 1px; }

/* Compact layout (Settings, Layout): no pictures, tighter rows */
body[data-layout="compact"] .row.story .thumb { display: none; }
body[data-layout="compact"] .row.story { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }

/* First-run topic picker (picker.js): a sheet of chips and one capsule button */
.picker p.muted { margin: 0 0 var(--sp-4); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--sp-2); }
.pick-grid .chip { width: 100%; justify-content: center; }
.pick-go { display: block; width: 100%; height: 48px; margin: var(--sp-5) 0 var(--sp-2); border: 0; border-radius: var(--r-pill); background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Boot splash (read.html #splash, Splash.swift): the mascot pops up, blinks, and sounds its horn */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); animation: splash-out .4s ease-out 1.35s forwards; }
#splash svg { width: 196px; height: 196px; overflow: visible; color: #0059B3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #splash svg { color: #3D8BE0; } }
:root[data-theme="dark"] #splash svg { color: #3D8BE0; }
#splash .pop { transform-box: view-box; transform-origin: 50% 55%; animation: pop .4s cubic-bezier(.34, 1.56, .64, 1) both; }
#splash .eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: blink .24s ease-in-out .42s; }
#splash .bell { transform-box: fill-box; transform-origin: 0% 50%; animation: toot .36s ease-in-out .8s; }
#splash .w { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; opacity: 0; transform-box: fill-box; animation: wave .9s ease-out forwards; }
#splash .lean { transform-box: fill-box; transform-origin: 50% 100%; animation: lean .55s ease-in-out .65s; }
#splash .w1 { animation-delay: .85s; } #splash .w2 { animation-delay: .97s; } #splash .w3 { animation-delay: 1.09s; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { transform: scaleY(.1); } }
@keyframes toot { 50% { transform: scale(1.2); } }
@keyframes wave { 0% { opacity: 0; transform: translateX(-3px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateX(16px); } }
@keyframes lean { 27% { transform: rotate(-3.5deg) scale(1.05, .94); } 55% { transform: rotate(3.5deg) scale(.95, 1.06); } 100% { transform: none; } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { #splash .pop, #splash .eyes, #splash .bell, #splash .lean { animation: none; } #splash .w { animation: none; opacity: 1; } }

/* The mascot in the topic picker: bobs while you choose, hops for every pick */
.pick-mascot { width: 104px; height: 104px; margin: 0 auto var(--sp-3); color: #0059B3; animation: bob 2.8s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pick-mascot { color: #3D8BE0; } }
:root[data-theme="dark"] .pick-mascot { color: #3D8BE0; }
.pick-mascot svg { width: 100%; height: 100%; overflow: visible; }
.pick-mascot .w { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; opacity: 0; transform-box: fill-box; }
.pick-mascot .lean, .pick-mascot .bell { transform-box: fill-box; }
.pick-mascot .lean { transform-origin: 50% 100%; } .pick-mascot .bell { transform-origin: 0% 50%; }
.pick-mascot.call .lean { animation: lean .5s ease-in-out; }
.pick-mascot.call .bell { animation: toot .3s ease-in-out .12s; }
.pick-mascot.call .w { animation: wave .8s ease-out forwards; }
.pick-mascot.call .w1 { animation-delay: .15s; } .pick-mascot.call .w2 { animation-delay: .25s; } .pick-mascot.call .w3 { animation-delay: .35s; }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes hop { 40% { transform: translateY(-10px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .pick-mascot, .pick-mascot.call .lean, .pick-mascot.call .bell, .pick-mascot.call .w { animation: none; } }
.picker .chip:not([aria-pressed="true"]) { background: color-mix(in srgb, var(--text) 10%, transparent); }   /* visible on the sheet's own gray */
.picker { --accent: #0059B3; }   /* Bugle's own blue, whatever outlet colors Home behind it */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .picker { --accent: #5aa9ff; } }
:root[data-theme="dark"] .picker { --accent: #5aa9ff; }

/* Empty and loading lists (rows.js): the mascot over the reason; it hops on a loop while loading */
.rows li.empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-7) var(--sp-4); border: 0; text-align: center; }
.empty-mascot { width: 80px; height: 80px; animation: bob 2.8s ease-in-out infinite; }
.empty.loading .empty-mascot { animation: hop 1.6s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .empty-mascot, .empty.loading .empty-mascot { animation: none; } }
