/* ============================================================
   Signal — Calder's blog. Reading-first, on-brand, monochrome.
   Loads AFTER css/style.css (inherits tokens, nav, footer, buttons).
   ============================================================ */

/* ---------- Ambient field: scattered and quiet on every Signal page ----------
   The living mobile still runs, but reading beats spectacle — it drops to a
   faint scatter behind the text instead of a dense starfield. */
body:has(.signal) #stage { opacity: .12; }
body:has(.article) #stage { opacity: .16; }

/* soft static dot-field for panels */
.dotbg { position: relative; }
.dotbg::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(var(--fg-rgb), .32) 1px, transparent 1px);
  background-size: 15px 15px;
  -webkit-mask-image: radial-gradient(ellipse at 72% 40%, #000, transparent 68%);
  mask-image: radial-gradient(ellipse at 72% 40%, #000, transparent 68%);
  opacity: .35;
}
.dotbg > * { position: relative; z-index: 1; }

/* ============================================================
   Standalone chrome — Signal runs as its own app, not a page of
   the marketing site: mark on the left, theme switch on the right.
   ============================================================ */
.sigbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
}
.sigbar.is-scrolled {
  padding: 10px 28px;
  background: rgba(var(--canvas-rgb), .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--g90);
}
.sigbar__brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.sigbar__mark {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--g75);
  display: grid; place-items: center; transition: border-color .25s var(--ease);
}
.sigbar__brand:hover .sigbar__mark { border-color: var(--ink); }
.sigbar__names { display: flex; flex-direction: column; line-height: 1; }
.sigbar__names b {
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  letter-spacing: -.01em; color: var(--ink);
}
.sigbar__names em {
  font-family: var(--font-head); font-style: normal; font-size: 9px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase; color: var(--g55); margin-top: 3px;
}
.sigbar__wordmark {
  font-family: var(--font-display); font-size: 22px; color: var(--g55); text-decoration: none;
  padding-left: 16px; border-left: 1px solid var(--g90); line-height: 1;
  transition: color .25s var(--ease);
}
.sigbar__wordmark:hover { color: var(--ink); }
.sigbar__right { margin-left: auto; }

/* slim legal strip — replaces the marketing footer, keeps the links crawlable */
.sigfoot {
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center;
  padding: 30px 24px 40px;
  font-family: var(--font-head); font-size: 12.5px; color: var(--g55);
}
.sigfoot a { color: var(--g55); text-decoration: none; }
.sigfoot a:hover { color: var(--ink); }

@media (max-width: 700px) {
  .sigbar, .sigbar.is-scrolled { padding: 10px 16px; }
  .sigbar__wordmark { display: none; }
}

/* ============================================================
   Signal — the feed. Three columns: topics · timeline · rail.
   ============================================================ */
.signal { padding: 92px 0 0; }
.signal__grid {
  max-width: 1200px; margin: 0 auto; padding: 0 40px;
  display: grid; grid-template-columns: 208px minmax(0, 1fr) 300px;
  align-items: start;
}

/* ---------- left rail: the topic nav ---------- */
.srail { position: sticky; top: 112px; padding: 26px 22px 40px 0; }
.srail__brand {
  display: block; font-family: var(--font-display); font-weight: 400;
  font-size: 38px; line-height: 1; color: var(--ink); text-decoration: none; margin-bottom: 4px;
}
.srail__sub {
  display: block; font-family: var(--font-head); font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--g55); margin-bottom: 24px;
}
.snav { display: flex; flex-direction: column; gap: 2px; }
.snav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-radius: 100px; text-decoration: none;
  font-family: var(--font-head); font-size: 14px; color: var(--g45);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.snav a b { font-weight: 500; font-size: 12px; color: var(--g55); }
.snav a:hover { background: rgba(var(--fg-rgb), .05); color: var(--ink); }
.snav a.is-active { background: rgba(var(--fg-rgb), .08); color: var(--ink); font-weight: 600; }
.srail__foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--g90); }
.srail__foot a {
  display: block; font-family: var(--font-head); font-size: 13px; color: var(--g55);
  text-decoration: none; padding: 5px 0;
}
.srail__foot a:hover { color: var(--ink); }

/* ---------- center: the timeline ---------- */
.feed { border-left: 1px solid var(--g90); border-right: 1px solid var(--g90); min-height: 90vh; }

.feed__head { padding: 30px 22px 22px; border-bottom: 1px solid var(--g90); }
.feed__head .eyebrow { margin-bottom: 14px; }
.feed__head h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(46px, 6vw, 72px); line-height: .92; letter-spacing: .01em; margin-bottom: 14px;
}
.feed__head p { font-size: 16.5px; line-height: 1.55; color: var(--g45); max-width: 46ch; }

/* sticky tab bar — the category switcher */
.feed__tabs {
  position: sticky; top: 78px; z-index: 20;   /* clears the scrolled site nav */
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 0 8px; border-bottom: 1px solid var(--g90);
  background: rgba(var(--canvas-rgb), .78);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.feed__tabs::-webkit-scrollbar { display: none; }
.feed__tabs a {
  position: relative; white-space: nowrap; padding: 15px 14px 13px;
  font-family: var(--font-head); font-size: 14px; color: var(--g55); text-decoration: none;
  transition: color .2s var(--ease);
}
.feed__tabs a:hover { color: var(--ink); }
.feed__tabs a.is-active { color: var(--ink); font-weight: 600; }
.feed__tabs a.is-active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 0;
  height: 3px; border-radius: 3px; background: var(--ink);
}

/* a post in the timeline */
.frow {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px;
  padding: 18px 22px 20px; border-bottom: 1px solid var(--g90);
  transition: background .2s var(--ease);
}
.frow:hover { background: rgba(var(--fg-rgb), .035); }
.frow__hit { position: absolute; inset: 0; z-index: 1; }
.frow__pin {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
  font-family: var(--font-head); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--g55);
}
.frow__pin .node { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.frow__avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--g75);
  display: grid; place-items: center; background: rgba(var(--fg-rgb), .03);
}
/* the C mark, masked so it takes the theme's ink instead of the OS scheme */
.cmark {
  display: block; width: 11px; height: 23px; background: var(--ink);
  -webkit-mask: url('/assets/brand/mark-c-dot-black.svg') center / contain no-repeat;
  mask: url('/assets/brand/mark-c-dot-black.svg') center / contain no-repeat;
}
.frow__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  font-family: var(--font-head); font-size: 14px; color: var(--g55);
}
.frow__head b { color: var(--ink); font-weight: 600; }
.frow__title {
  font-family: var(--font-title); font-weight: 700; font-size: 20px;
  line-height: 1.25; letter-spacing: -.012em; margin: 7px 0 6px;
}
.frow__title a { color: var(--ink); text-decoration: none; position: relative; z-index: 2; }
.frow--pinned .frow__title { font-size: 25px; line-height: 1.18; }
.frow__dek { font-size: 15.5px; line-height: 1.55; color: var(--g45); }
.frow__foot {
  margin-top: 13px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-head); font-size: 12.5px; color: var(--g55);
}
.tag {
  position: relative; z-index: 2; text-decoration: none;
  border: 1px solid var(--g75); border-radius: 100px; padding: 4px 11px;
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--g45);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.tag:hover { color: var(--ink); border-color: var(--ink); }

/* what kind of post this is — video, link, tool, news */
.kindchip {
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); border: 1px solid var(--g75); border-radius: 100px; padding: 2px 8px;
}

/* click-to-load video: no third-party frame until you press play */
.embed {
  position: relative; z-index: 2; display: grid; place-items: center;
  aspect-ratio: 16/9; margin-top: 14px; overflow: hidden;
  border: 1px solid var(--g90); border-radius: 16px; cursor: pointer;
  background: rgba(var(--fg-rgb), .04);
}
.embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed__play {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--g75); color: var(--ink); background: rgba(var(--canvas-rgb), .7);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.embed:hover .embed__play { transform: scale(1.06); border-color: var(--ink); }
.embed__label {
  position: absolute; left: 16px; bottom: 14px;
  font-family: var(--font-head); font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--g55);
}
.embed.is-live { cursor: default; place-items: stretch; }

/* an outbound link post — the card is the citation */
.linkcard {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 14px; padding: 14px 16px; text-decoration: none;
  border: 1px solid var(--g90); border-radius: 14px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.linkcard:hover { border-color: var(--g75); background: rgba(var(--fg-rgb), .03); }
.linkcard__host {
  font-family: var(--font-head); font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--g55);
}
.linkcard__go {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--font-head); font-size: 13.5px; font-weight: 600; color: var(--ink);
}

/* share row */
.acts { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.act {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 7px 13px; border: 1px solid var(--g90); border-radius: 100px; background: none;
  font-family: var(--font-head); font-size: 12.5px; color: var(--g45); text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.act:hover { color: var(--ink); border-color: var(--g75); background: rgba(var(--fg-rgb), .04); }
.act.is-done { color: var(--ink); border-color: var(--ink); }
.act[hidden] { display: none; }
.act--views { cursor: default; }
.act--views:hover { color: var(--g45); border-color: var(--g90); background: none; }
/* the like is the brand node: a ring that fills when the signal is received */
.act--like .dot { opacity: 0; transform-origin: center; transition: opacity .2s var(--ease); }
.act--like.is-liked { color: var(--ink); border-color: var(--ink); }
.act--like.is-liked .dot { opacity: 1; animation: likepop .4s var(--ease); }
@keyframes likepop { 0% { transform: scale(.2); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .act--like.is-liked .dot { animation: none; } }
.act--read { margin-left: auto; color: var(--ink); border-color: var(--g75); }
.article-foot .acts { margin-top: 22px; }

.feed__end {
  padding: 34px 22px 44px; text-align: center;
  font-family: var(--font-head); font-size: 13px; color: var(--g55);
}
.feed__end a { color: var(--ink); }

/* ---------- right rail: context, links, conversion ---------- */
/* the rail is taller than the viewport — let it scroll with the feed,
   and stick only the last card once the rest has passed */
.rrail { padding: 26px 0 40px 24px; display: flex; flex-direction: column; gap: 16px; }
.rrail .rcard:last-child { position: sticky; top: 112px; }
.rcard { border: 1px solid var(--g90); border-radius: 18px; padding: 18px; }
.rcard h4 {
  font-family: var(--font-head); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--g55); margin-bottom: 12px;
}
.rcard p { font-size: 14px; line-height: 1.55; color: var(--g45); }
.rcard .btn { width: 100%; margin-top: 14px; }
.rcard__item {
  display: block; text-decoration: none; padding: 11px 0; border-top: 1px solid var(--g90);
  font-family: var(--font-title); font-weight: 700; font-size: 15px; line-height: 1.3;
  color: var(--ink); transition: opacity .2s var(--ease);
}
.rcard__item:first-of-type { border-top: none; padding-top: 0; }
.rcard__item:hover { opacity: .62; }
.rcard__item span {
  display: block; margin-top: 5px;
  font-family: var(--font-head); font-weight: 400; font-size: 12px; color: var(--g55);
}
.rcard__chips { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1080px) {
  .signal__grid { grid-template-columns: minmax(0, 1fr); }
  .srail { display: none; }
  .feed { border-left: none; border-right: none; }
  .rrail {
    position: static; padding: 28px 0 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
  }
}
@media (max-width: 700px) {
  .signal { padding: 84px 0 0; }
  .signal__grid { padding: 0 16px; }
  .feed__head, .frow, .feed__end { padding-left: 4px; padding-right: 4px; }
  .feed__tabs { padding: 0; top: 64px; }
  .frow__title { font-size: 19px; }
  .frow--pinned .frow__title { font-size: 22px; }
  .rrail { grid-template-columns: minmax(0, 1fr); }
}

/* post cards (related rail on articles) */
.posts { padding: 56px 0; }
.posts__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pcard {
  border-top: 1px solid var(--g90); padding-top: 22px;
  display: flex; flex-direction: column;
  transition: transform .3s var(--ease);
}
.pcard:hover { transform: translateY(-4px); }
.pcard__meta { font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--g55); display: flex; gap: 10px; }
.pcard h3 { font-family: var(--font-title); font-weight: 700; font-size: 21px; letter-spacing: -.01em; line-height: 1.2; margin: 12px 0 8px; }
.pcard h3 a { color: var(--ink); text-decoration: none; }
.pcard h3 a:hover { color: var(--g45); }
.pcard p { color: var(--g45); font-size: 15px; line-height: 1.55; }
.pcard__foot { margin-top: auto; padding-top: 14px; font-family: var(--font-head); font-size: 12px; color: var(--g55); }

/* ---------- Post page ---------- */
.article-hero { padding: 170px 0 8px; }
.article-hero .kick { font-family: var(--font-head); font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--g55); display: flex; align-items: center; gap: 10px; }
.article-hero .kick .node { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.article-hero h1 {
  font-family: var(--font-title); font-weight: 900;
  font-size: clamp(34px, 5.6vw, 68px); line-height: 1.02; letter-spacing: -.025em;
  margin: 22px 0 20px; max-width: 16ch;
}
.article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--g55); font-size: 14px; font-family: var(--font-head); }
.article-meta .who { color: var(--ink); font-weight: 600; }
.article-hero__img { margin: 40px 0 8px; border-radius: 16px; overflow: hidden; border: 1px solid var(--g90); aspect-ratio: 16/9; }
.article-hero__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article { padding: 40px 0 80px; }
.article__body { max-width: 700px; margin: 0 auto; font-size: 19px; line-height: 1.75; color: var(--g15); }
:root[data-theme="dark"] .article__body { color: #D3D3D9; }
.article__body > * + * { margin-top: 26px; }
.article__body h2 { font-family: var(--font-head); font-weight: 700; font-size: 28px; letter-spacing: -.01em; color: var(--ink); margin-top: 48px; line-height: 1.2; }
.article__body h3 { font-family: var(--font-head); font-weight: 600; font-size: 22px; color: var(--ink); margin-top: 36px; }
.article__body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--g75); }
.article__body a:hover { text-decoration-color: var(--ink); }
.article__body strong { color: var(--ink); font-weight: 600; }
.article__body ul, .article__body ol { padding-left: 24px; }
.article__body li { margin-top: 8px; }
.article__body blockquote {
  border-left: 2px solid var(--ink); padding-left: 24px; margin-left: 0;
  font-family: var(--font-head); font-weight: 500; font-size: 24px; line-height: 1.35; color: var(--ink);
}
.article__body img { max-width: 100%; border-radius: 12px; border: 1px solid var(--g90); }
.article__body hr { border: none; border-top: 1px solid var(--g90); margin: 40px 0; }
.article__body code {
  font-family: 'Space Grotesk', ui-monospace, monospace; font-size: .88em;
  background: rgba(var(--fg-rgb), .06); padding: 2px 6px; border-radius: 6px;
}
.article__body pre {
  background: rgba(var(--fg-rgb), .05); border: 1px solid var(--g90);
  border-radius: 12px; padding: 20px; overflow-x: auto; font-size: 15px; line-height: 1.6;
}
.article__body pre code { background: none; padding: 0; font-size: inherit; }

.article-hero .kick a { color: inherit; text-decoration: none; }
.article-hero .kick a:hover { color: var(--ink); }
.article-dek { font-size: 20px; line-height: 1.5; color: var(--g45); max-width: 60ch; margin-bottom: 26px; }

/* tables inside posts */
.article__body .table-wrap { overflow-x: auto; }
.article__body table { border-collapse: collapse; width: 100%; font-size: 16px; }
.article__body th, .article__body td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--g90); }
.article__body th { font-family: var(--font-head); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--g55); }
.article__body figure { margin: 0; }

/* progress */
.readbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; }
.readbar span { display: block; height: 100%; width: 0; background: var(--ink); }

/* author + related + cta */
.article-foot { max-width: 700px; margin: 0 auto; padding-top: 40px; border-top: 1px solid var(--g90); }
.author { display: flex; align-items: center; gap: 16px; }
.author__mark { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--g75); display: flex; align-items: center; justify-content: center; }
.author__mark .cmark { width: 12px; height: 25px; }
.author__name { font-family: var(--font-head); font-weight: 600; }
.author__role { font-size: 14px; color: var(--g55); }

.author__bio { margin-top: 14px; font-size: 15px; line-height: 1.6; color: var(--g45); }
.share { margin-top: 22px; font-family: var(--font-head); font-size: 13px; letter-spacing: .04em; color: var(--g55); display: flex; gap: 14px; align-items: center; }
.share a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--g75); }
.share a:hover { border-color: var(--ink); }

.related { padding: 64px 0; border-top: 1px solid var(--g90); }
.related h4 { font-family: var(--font-head); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--g55); margin-bottom: 24px; }
.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.blog-cta { text-align: center; padding: 80px 0; border-top: 1px solid var(--g90); }
.blog-cta h2 { font-family: var(--font-title); font-weight: 900; font-size: clamp(30px, 5vw, 60px); letter-spacing: -.02em; line-height: 1; margin-bottom: 28px; }

@media (max-width: 860px) {
  .posts__grid, .related__grid { grid-template-columns: 1fr 1fr; }
  .feat { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .posts__grid, .related__grid { grid-template-columns: 1fr; }
  .blog-hero { padding: 140px 0 44px; }
  .article-hero { padding: 130px 0 8px; }
  .article__body { font-size: 18px; }
}
