/* Layout: masthead + sticky filter bar + responsive card grid. Each topic owns a color used on the card's cover block. */
:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5d626c;
  --line: #dcddd8;
  --accent: #2b44ff;
  --accent-ink: #ffffff;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --t-inspiration: #ff5a36;
  --t-trends: #8a3ffc;
  --t-pricing: #00a37a;
  --t-cashflow: #e8a400;
  --t-proposals: #2b44ff;
  --t-clients: #e0367a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121317; --surface: #1b1d23; --ink: #eceef2; --muted: #9ea3ad; --line: #2c2f37;
    --accent: #6f80ff; --accent-ink: #0d0f14; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121317; --surface: #1b1d23; --ink: #eceef2; --muted: #9ea3ad; --line: #2c2f37;
  --accent: #6f80ff; --accent-ink: #0d0f14; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--body); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

header.mast { padding: 36px 0 24px; border-bottom: 1px solid var(--line); }
.mast-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.brand { font: 800 clamp(30px, 5vw, 52px)/0.95 var(--display); letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.brand span { color: var(--accent); }
.tagline { margin: 10px 0 0; color: var(--muted); max-width: 60ch; }
.topnav { display: flex; gap: 20px; }
.topnav a { color: var(--muted); text-decoration: none; font: 500 16px/1 var(--body); }
.topnav a:hover, .topnav a.active { color: var(--ink); }
.proto {font: 600 12px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--line); padding: 7px 10px; border-radius: 999px; color: var(--muted); }

.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar-inner { display: grid; gap: 12px; padding: 14px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-label { font: 600 12px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); min-width: 56px; }
.chip { font: 500 14px/1 var(--body); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chip:hover { border-color: var(--ink); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.small { font-size: 13px; padding: 7px 12px; }
.search { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.search input { font: 400 14px/1 var(--body); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 220px; }
.count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

main { padding: 24px 0 60px; }
.card p { margin: 0; }
/* Bento grid: fixed column count per breakpoint, 200px row unit.
   Five card sizes, each with a FIXED image height so equal cards always match:
   normal 1x2 · tall 1x3 · wide 2x2 (image left) · big 2x3 · overlay 1x2 (text on image). */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 200px; grid-auto-flow: dense; gap: 18px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.card { --img: 150px; grid-row: span 2; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0,0,0,.35); }
.card.tall { --img: 370px; grid-row: span 3; }
.card.big { --img: 390px; grid-column: span 2; grid-row: span 3; }
.card.wide { grid-column: span 2; flex-direction: row; }
.cover { flex: 0 0 var(--img); position: relative; display: flex; align-items: flex-end; padding: 14px; color: #fff; overflow: hidden; }
.card.wide .cover { flex: 0 0 52%; }
.cover::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.22) 1.4px, transparent 1.6px); background-size: 14px 14px; }
.cover .glyph { position: absolute; right: -6px; top: -18px; font: 800 120px/1 var(--display); opacity: .22; letter-spacing: -0.04em; }
.card.tall .cover .glyph, .card.wide .cover .glyph, .card.big .cover .glyph, .card.overlay .cover .glyph { font-size: 220px; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.5), rgba(0,0,0,0) 50%); }
.cover .topic { position: relative; z-index: 1; font: 700 13px/1 var(--body); text-transform: uppercase; letter-spacing: .09em; }
.cover.has-img .topic { background: var(--tc); padding: 6px 8px; border-radius: 4px; }
.body { flex: 1 1 auto; min-height: 0; padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.card.wide .body, .card.big .body { padding: 20px 22px 12px; }
.card.wide .body { justify-content: center; }
.card h3, .card p { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 { -webkit-line-clamp: 3; }
.card p { -webkit-line-clamp: 3; }
.card.wide p { -webkit-line-clamp: 6; }
.card.wide h3, .card.big h3 { font-size: 24px; -webkit-line-clamp: 4; }
.card.big p { -webkit-line-clamp: 2; font-size: 15px; }
/* Overlay: the image fills the card, text sits on a dark gradient. */
.card.overlay { border: 0; }
.card.overlay .cover { position: absolute; inset: 0; align-items: flex-start; }
.card.overlay .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,12,16,.92) 15%, rgba(10,12,16,.35) 60%, rgba(10,12,16,0)); }
.card.overlay .body { position: relative; z-index: 1; justify-content: flex-end; color: #fff; padding: 18px; }
.card.overlay h3 { font-size: 22px; -webkit-line-clamp: 4; }
.card.overlay p, .card.overlay .source { color: rgba(255,255,255,.82); }
.card.overlay .type { color: #fff; border-color: rgba(255,255,255,.5); }
.card.overlay .foot { margin-top: 0; border-top-color: rgba(255,255,255,.3); }
.card.overlay .read { color: #fff; }
@media (max-width: 560px) {
  .card.wide, .card.big { grid-column: span 1; }
  .card.wide { flex-direction: column; }
  .card.wide .cover { flex: 0 0 150px; }
  .card.big { --img: 220px; }
}
.card .body p { flex: 0 1 auto; }
.tile { grid-row: span 1; position: relative; overflow: hidden; border: 0; border-radius: 14px; color: #fff; cursor: pointer; text-align: left; padding: 16px; display: flex; align-items: flex-end; font: inherit; }
.tile::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.22) 1.4px, transparent 1.6px); background-size: 14px 14px; }
.tile-glyph { position: absolute; right: 8px; top: -14px; font: 800 120px/1 var(--display); opacity: .25; }
.tile-label { position: relative; font: 700 18px/1.2 var(--display); }
.tile:hover .tile-label { text-decoration: underline; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.type { font: 600 11px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; color: var(--muted); }
.source { font-size: 13px; color: var(--muted); }
.card h3 { font: 700 19px/1.2 var(--display); margin: 0; text-wrap: balance; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); }
.read { font: 600 14px/1 var(--body); text-decoration: none; color: var(--accent); padding: 8px 0; }
.read:hover { text-decoration: underline; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }
@media (max-width: 640px) { .search { margin-left: 0; width: 100%; } .search input { flex: 1; width: auto; } .row-label { min-width: 0; width: 100%; } }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* Deals page */
.when { font: 600 11px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; padding: 5px 7px; border-radius: 4px; background: var(--line); color: var(--ink); }
.when.soon { background: #ffd65a; color: #16181d; }
.when.urgent { background: #ff4d4d; color: #fff; }
.when.upcoming { background: var(--accent); color: var(--accent-ink); }
.deal-badge { position: absolute; z-index: 2; top: 12px; right: 12px; background: #16181d; color: #fff; font: 800 20px/1 var(--display); padding: 8px 10px; border-radius: 8px; letter-spacing: -0.01em; }
.card.has-badge .cover:not(.has-img) .deal-badge { display: none; }
/* On deal cards the cover shows the discount itself, sized to always fit the cover's width. */
.card.has-badge .cover { container-type: inline-size; }
.card.has-badge .cover .glyph, .card.has-badge.tall .cover .glyph, .card.has-badge.big .cover .glyph, .card.has-badge.wide .cover .glyph { font-size: min(26cqi, 150px); top: 12px; left: 14px; right: auto; opacity: .35; white-space: nowrap; }
.card.overlay .when { background: rgba(255,255,255,.2); color: #fff; }
.card.overlay .when.soon { background: #ffd65a; color: #16181d; }
.card.overlay .when.urgent { background: #ff4d4d; }
.disclaimer { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
