/* RhythmForge — blog reading styles (index + posts). Shared tokens, header
   and footer live in styles.css. Gold stays off the blog chrome: it means a
   CTA or a met goal in the app and on the site (MARKETING.md, 2026-10-17). */

:root {
  --text-body: #D1D1D6;
  --blog-text-width: 660px;
}

/* ----- Shared pieces ----- */

.blog-kind {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.blog-meta {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ----- Index ----- */

.blog-index {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 40px 16px 56px;
}

.blog-index__title {
  margin-bottom: 28px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.blog-index__list {
  list-style: none;
  border-top: 1px solid var(--border-subtle);
}

.blog-entry {
  border-bottom: 1px solid var(--border-subtle);
}

.blog-entry__link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 0;
  color: var(--text-primary);
}

.blog-entry__link:hover {
  opacity: 1;
}

.blog-entry__link:hover .blog-entry__title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

.blog-entry__aside {
  display: contents;
}

.blog-entry__body {
  display: contents;
}

.blog-entry__title {
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.blog-entry__desc {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* On phones the meta line sits last; on desktop it moves into the left column. */
.blog-entry__aside .blog-meta {
  order: 4;
}

@media (min-width: 900px) {
  .blog-index {
    padding: 96px 24px;
  }

  .blog-index__title {
    max-width: 760px;
    margin-bottom: 56px;
    font-size: 46px;
    line-height: 1.1;
  }

  .blog-entry__link {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 48px;
    padding: 30px 0;
  }

  .blog-entry__aside {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 7px;
  }

  .blog-entry__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 720px;
  }

  .blog-entry__title {
    font-size: 26px;
    line-height: 1.22;
    letter-spacing: -0.018em;
  }

  .blog-entry__desc {
    font-size: 18px;
  }
}

/* ----- Post ----- */

.post {
  max-width: calc(var(--blog-text-width) + 32px);
  margin: 0 auto;
  padding: 40px 16px 0;
}

.post__header {
  margin-bottom: 36px;
}

.post__title {
  margin: 16px 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.post__dek {
  margin-bottom: 18px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.prose {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-body);
}

.prose p {
  margin-bottom: 18px;
  text-wrap: pretty;
}

.prose h2 {
  margin: 44px 0 12px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  text-wrap: balance;
  scroll-margin-top: 24px;
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(10, 132, 255, 0.55);
}

.prose .num {
  color: var(--text-primary);
  font-weight: 500;
}

.prose strong .num {
  font-weight: inherit;
}

.prose ol {
  list-style: none;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: step;
}

.prose ol > li {
  counter-increment: step;
  position: relative;
  padding-left: 30px;
}

.prose ol > li::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  text-align: right;
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.prose ul {
  list-style: none;
  margin: -2px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prose ul > li {
  position: relative;
  padding-left: 22px;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: calc(0.8em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
}

/* The live pill's steadiness words in the app's own hues (LiveTimingReading:
   rfPerfect / rfGood / rfOkay / rfWeak). Data colour, not chrome: Steady's
   yellow is the app's, not a CTA. */
.lvl { font-weight: 600; }
.lvl--locked { color: #00FF66; }
.lvl--steady { color: #FFD60A; }
.lvl--drifting { color: #FF9500; }
.lvl--erratic { color: #FF3B30; }

/* One inline example of the pill itself: neutral surface, word in its hue,
   the lean in white. */
.live-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.1em 0.75em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-card);
  font-size: 0.9em;
  white-space: nowrap;
}

.live-pill__lean {
  color: var(--text-primary);
}

.callout {
  margin: 4px 0 26px;
  padding: 16px 18px 18px;
  background: var(--bg-card-deep);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-feature);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.callout__label {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.prose .callout p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

/* Figures reuse the landing page's device frame (.narrative-screenshot,
   __device, __image, __frame) but not its --primary/--secondary flex sizing. */
.post-figure {
  margin: 36px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.post-figure__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.post-figure .narrative-screenshot {
  flex: 0 0 auto;
  width: 240px;
}

.post-figure figcaption {
  max-width: 340px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}

@media (min-width: 561px) {
  .post-figure__row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  }

  .post-figure__row .narrative-screenshot {
    width: 220px;
  }

  .post-figure__row .post-figure__shot--secondary {
    width: 190px;
    margin-top: 28px;
  }
}

/* Tables: numbers right-aligned in tabular figures; scrolls sideways inside
   its own box on narrow phones rather than widening the page. */
.post-table {
  margin: 4px 0 26px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-feature);
  background: var(--bg-card-deep);
}

.post-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}

.post-table th,
.post-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.post-table tbody tr:last-child th,
.post-table tbody tr:last-child td {
  border-bottom: 0;
}

.post-table thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.post-table thead th:not(:first-child),
.post-table td {
  text-align: right;
  white-space: nowrap;
}

.post-table__sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.post-table tbody th {
  font-weight: 500;
  color: var(--text-primary);
}

/* Charts: inline SVG drawn from the session data. Data hues are the app's
   tier colours, never gold (gold means a CTA on the site). */
.post-chart {
  align-items: stretch;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.post-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-card-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-feature);
  font-family: inherit;
}

.post-chart__band { fill: rgba(48, 209, 88, 0.10); }
.post-chart__bandlabel { fill: rgba(48, 209, 88, 0.75); font-size: 11px; }
.post-chart__grid { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.post-chart__zero { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; stroke-dasharray: 4 4; }
.post-chart__tick { fill: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.post-chart__axis { fill: var(--text-tertiary); font-size: 12px; }
.post-chart__dots { fill: none; stroke-width: 2.4; stroke-linecap: round; opacity: 0.35; }
.post-chart__line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }

.post-chart--off { stroke: #FF9F0A; --key: #FF9F0A; }
.post-chart--on { stroke: #64D2FF; --key: #64D2FF; }
.post-chart--i16 { stroke: #64D2FF; --key: #64D2FF; }
.post-chart--xs { stroke: #BF5AF2; --key: #BF5AF2; }
.post-chart--spk { stroke: #30D158; --key: #30D158; }

.prose .post-chart__legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: -4px 0 0;
  font-size: 14px;
}

.post-chart__key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.post-chart__key::before {
  content: "";
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--key);
}

.post-chart figcaption {
  align-self: center;
}

.post__end {
  margin-top: 48px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.post__end .section-separator {
  padding: 0;
}

.post__about {
  max-width: 520px;
  text-align: center;
  font-size: 16px;
  line-height: 1.55;
  font-style: italic;
  color: var(--text-secondary);
}

.post-next {
  width: 100%;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-feature);
  color: var(--text-primary);
}

.post-next:hover {
  opacity: 1;
  background: var(--bg-card-hover);
}

.post-next__text {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-next__eyebrow {
  display: flex;
  gap: 10px;
}

.post-next__title {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

@media (min-width: 900px) {
  .post {
    padding-top: 88px;
  }

  .post__header {
    margin-bottom: 56px;
  }

  .post__title {
    margin: 20px 0;
    font-size: 50px;
    line-height: 1.08;
    letter-spacing: -0.022em;
  }

  .post__dek {
    margin-bottom: 22px;
    font-size: 21px;
  }

  .post__header .blog-meta {
    font-size: 15px;
  }

  .prose {
    font-size: 19px;
    line-height: 1.65;
  }

  .prose p {
    margin-bottom: 22px;
  }

  .prose h2 {
    margin: 60px 0 14px;
    font-size: 27px;
    line-height: 1.22;
    letter-spacing: -0.018em;
  }

  .prose ol {
    gap: 12px;
    margin-bottom: 26px;
  }

  .prose ol > li {
    padding-left: 36px;
  }

  .prose ol > li::before {
    width: 22px;
  }

  .prose ul {
    margin: -4px 0 26px;
  }

  .prose ul > li {
    padding-left: 26px;
  }

  .prose ul > li::before {
    left: 6px;
    top: calc(0.825em - 3px);
  }

  .callout {
    margin: 6px 0 30px;
    padding: 18px 22px 20px;
    gap: 8px;
  }

  .prose .callout p {
    font-size: 17px;
    line-height: 1.6;
  }

  .post-figure {
    margin: 44px 0 48px;
    gap: 20px;
  }

  .post-figure .narrative-screenshot {
    width: 280px;
  }

  .post-figure__row .narrative-screenshot {
    width: 280px;
  }

  .post-figure__row .post-figure__shot--secondary {
    width: 240px;
    margin-top: 32px;
  }

  .post-figure figcaption {
    max-width: 480px;
    font-size: 15px;
  }

  .post__end {
    margin-top: 64px;
    padding-bottom: 104px;
    gap: 28px;
  }

  .post__about {
    font-size: 17px;
    line-height: 1.6;
  }

  .post-next {
    margin-top: 28px;
    gap: 20px;
    padding: 22px 24px;
  }

  .post-next__title {
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -0.015em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
