/* AI Signal prototype — foundation.
   Design tokens (light + dark), reset, type scale, app chrome (top bar, mobile tab bar),
   buttons, chips, sheet, toast and the loading / error / empty pieces shared by every view.
   Sibling of Agent District's "Light Gallery": same radii, hue-family idea and system fonts,
   but a warmer paper canvas, a serif display face and one "signal" accent of its own. */

:root {
  color-scheme: light;
  --paper: #f5f2ec; --surface: #fffdf9; --sunk: #ebe7de;
  --ink: #15161a; --ink-2: #3a3c44; --muted: #6b6d76; --soft: #9c9da5;
  --line: rgba(21, 22, 26, .09); --line-2: rgba(21, 22, 26, .18);
  --stage: #111217; --stage-2: #1b1d24; --on-stage: #f4f1eb; --stage-line: rgba(255, 255, 255, .12);
  --signal: #e2542c; --ok: #1b7a52; --w: #fff;
  --glass: rgba(255, 253, 249, .74);
  --r-xl: 32px; --r-lg: 24px; --r-md: 16px; --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(21, 22, 26, .04), 0 8px 24px rgba(21, 22, 26, .05);
  --shadow-2: 0 2px 6px rgba(21, 22, 26, .05), 0 28px 56px -16px rgba(21, 22, 26, .2);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d0e12; --surface: #17181e; --sunk: #1f2128;
  --ink: #f3f0ea; --ink-2: #cfccc6; --muted: #9a9ba3; --soft: #6f7078;
  --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .2);
  --stage: #1b1d24; --stage-2: #262932; --w: rgba(255, 255, 255, .16);
  --glass: rgba(23, 24, 30, .74); --signal: #ff7a52; --ok: #58c896;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 28px 56px -16px rgba(0, 0, 0, .6);
}

/* Topic hue families: --t tint (card background), --m mid, --d deep. Colour lives only in artwork and its frame. */
.t-ai       { --t: #e6e9fb; --m: #a5b0f1; --d: #3445c4; }
.t-cloud    { --t: #def2f6; --m: #88d0e0; --d: #0b6f8a; }
.t-oss      { --t: #e1f3e8; --m: #94d6b1; --d: #17754a; }
.t-startups { --t: #fbeedb; --m: #f1bf79; --d: #a85c12; }
.t-research { --t: #efe8fa; --m: #c0a9eb; --d: #6337b9; }
[data-theme="dark"] .t-ai       { --t: #1b1f3d; --m: #5f6fd6; --d: #b3bdff; }
[data-theme="dark"] .t-cloud    { --t: #10303a; --m: #2f93aa; --d: #9be3f2; }
[data-theme="dark"] .t-oss      { --t: #12301f; --m: #2f9562; --d: #a4e8c1; }
[data-theme="dark"] .t-startups { --t: #38240c; --m: #b9792a; --d: #ffd08f; }
[data-theme="dark"] .t-research { --t: #261a42; --m: #7a55c9; --d: #d3bdff; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background .3s, color .3s; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; }
.skip:focus { top: 16px; }
.ic { width: 20px; height: 20px; flex: none; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
main:focus { outline: none; }

/* Type: serif for anything editorial, sans for interface. */
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(44px, 11.5vw, 96px); line-height: .96; letter-spacing: -.035em; }
.display em { font-style: italic; color: var(--muted); }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -.025em; }
h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.16; letter-spacing: -.015em; }
.kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.fine { font-size: 13px; line-height: 1.5; color: var(--muted); }
.lede { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; color: var(--ink-2); max-width: 44ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.eyebrow i, .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; transition: transform .2s var(--ease), background .2s, box-shadow .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-light { background: #fff; color: #15161a; }
.btn-dim { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-dim:hover { background: rgba(255, 255, 255, .2); }
.btn .ic { width: 18px; height: 18px; }
.round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .2s, transform .2s var(--ease); }
.round:active { transform: scale(.94); }
.round-line { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.round-line:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; }
.link .ic { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link:hover .ic { transform: translateX(3px); }

/* Chips and segmented control */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; transition: box-shadow .2s, background .2s, color .2s; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip small { font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
.chip b { width: 8px; height: 8px; border-radius: 50%; background: var(--d); }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--sunk); max-width: 100%; }
.seg button { height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--muted); white-space: nowrap; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Labels: the difference between "chosen for you" and "everyone is talking about it". */
.lab { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.lab-you { background: var(--ink); color: var(--paper); }
.lab-you i { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.lab-trend { box-shadow: inset 0 0 0 1.5px var(--ink); }
.lab-gen { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.demo-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }

/* Top bar: a quiet brand row on phones, a floating glass pill on larger screens (as on Agent District). */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(1200px, 100% - 32px); margin: 0 auto; padding: 14px 0 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -.02em; }
.brand svg { width: 30px; height: 30px; }
.brand-bg { fill: var(--ink); } .brand-arc { stroke: var(--paper); } .brand-dot { fill: var(--signal); }
.top-links { display: none; gap: 2px; }
.top-links a { padding: 8px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s; }
.top-links a:hover { background: var(--line); color: var(--ink); }
.top-links a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.top-end { display: flex; align-items: center; gap: 8px; }
.theme-btn .ic-sun, [data-theme="dark"] .theme-btn .ic-moon { display: none; }
[data-theme="dark"] .theme-btn .ic-sun { display: block; }

.tabs { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; display: flex; gap: 2px; padding: 6px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px); box-shadow: 0 0 0 1px var(--line), 0 14px 34px -12px rgba(21, 22, 26, .3); }
.tabs a { display: flex; align-items: center; gap: 7px; height: 46px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background .25s var(--ease), color .2s; }
.tabs a span { display: none; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.tabs a[aria-current="page"] span { display: inline; }
body[data-view="watch"] .top, body[data-view="watch"] .tabs, body[data-view="watch"] .foot { display: none; }
.view { padding-bottom: 24px; animation: view-in .45s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

/* Sheet (native dialog), toast, footer */
.sheet { border: 0; padding: 0; border-radius: var(--r-xl); width: min(520px, 100% - 24px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.sheet::backdrop { background: rgba(13, 14, 18, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-in { padding: 28px; display: grid; gap: 14px; position: relative; }
.sheet-in h2 { font-size: 28px; padding-right: 44px; }
.sheet-x { position: absolute; right: 16px; top: 16px; background: var(--sunk); }
.states { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.states button { padding: 14px 16px; border-radius: var(--r-md); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 2px; transition: box-shadow .2s, transform .2s var(--ease); }
.states button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.states b { font-size: 14.5px; font-weight: 600; } .states span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); z-index: 90; background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); box-shadow: var(--shadow-2); max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 28px; padding: 28px 0 112px; margin-top: 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot a { text-decoration: underline; text-underline-offset: 3px; }

/* Empty, error and loading */
.state { border-radius: var(--r-xl); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); padding: 48px 28px; display: grid; justify-items: center; text-align: center; gap: 12px; }
.state .state-art { width: 132px; }
.state p { color: var(--ink-2); max-width: 40ch; }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.sk { border-radius: var(--r-lg); background: linear-gradient(100deg, var(--sunk) 30%, var(--surface) 50%, var(--sunk) 70%) 0 0 / 300% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -150% 0; } }
.sk-page { display: grid; gap: 16px; padding-top: 28px; }
.sk-a { height: 28px; width: 200px; } .sk-b { height: 120px; width: min(520px, 100%); } .sk-c { height: 150px; border-radius: var(--r-xl); } .sk-row { display: flex; gap: 14px; overflow: hidden; } .sk-d { height: 380px; flex: 0 0 min(78vw, 300px); border-radius: var(--r-xl); }

/* Listen bar: the whole briefing as audio, docked above the tab bar. */
.listen { position: fixed; left: 50%; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 68px); transform: translateX(-50%); z-index: 39; width: min(520px, 100% - 24px); padding: 12px 12px 12px 18px; border-radius: 22px; background: var(--stage); color: var(--on-stage); box-shadow: var(--shadow-2); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 8px; overflow: hidden; }
.listen-t { font-size: 12px; opacity: .65; } .listen-h { font-family: var(--serif); font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listen-txt { min-width: 0; }
.listen .round { background: rgba(255, 255, 255, .12); color: #fff; width: 40px; height: 40px; }
.listen-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--signal); width: calc(var(--p, 0) * 100%); }

@media (min-width: 900px) {
  .wrap { width: min(1200px, 100% - 48px); }
  .top { position: sticky; top: 14px; z-index: 50; height: 60px; padding: 0 10px 0 18px; margin-top: 14px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px); box-shadow: 0 0 0 1px var(--line), 0 10px 30px -12px rgba(21, 22, 26, .16); }
  .top-links { display: flex; }
  .tabs { display: none; }
  .foot { padding-bottom: 44px; margin-top: 72px; }
  .listen { bottom: 24px; }
  .toast { bottom: 32px; }
  .chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
}
/* Still mode (?still=1): no motion at all, for repeatable screenshots and frame grabs. */
.still *, .still *::before, .still *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
}
