/* ==========================================================================
   Slipstream website — article page

   Long-form typography (Newsreader for body copy), the reading-progress bar
   and the CSS bar chart used as the article's cover image. Loaded on top of
   site.css, never instead of it.
   ========================================================================== */

/* ------------------------------------------------------- reading progress -- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: rgba(255, 255, 255, 0.05);
}
.progress__bar {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: 0 0 12px var(--accent-a70);
}

/* ------------------------------------------------------------- measures -- */

.measure       { max-width: 760px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.measure--wide { max-width: 1000px; }
.measure--read { max-width: 680px; }

/* -------------------------------------------------------- article header -- */

.article__kicker {
  font: 600 12px var(--font-mono);
  letter-spacing: 0.14em;
  color: var(--accent);
}
.article__title {
  font: 900 56px/1.02 var(--font-display);
  letter-spacing: -0.04em;
  margin-top: 18px;
  text-wrap: balance;
}
.article__dek {
  font: 400 21px/1.55 var(--font-display);
  color: var(--text-meta);
  margin-top: 22px;
  text-wrap: pretty;
}
.article__byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line-strong);
}
.article__author { font: 700 15px var(--font-display); color: var(--text); }
.article__role   { font: 500 13px var(--font-display); color: var(--text-faint); }
.article__date   { font: 600 13px var(--font-display); color: var(--text-dim); }
.article__read   { font: 500 12px var(--font-mono); color: var(--text-faint); margin-top: 2px; }

/* ------------------------------------------------------------ chart cover -- */

.cover {
  position: relative;
  height: 400px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line-nav);
}
.cover__wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 120% at 22% 18%, #0E3A38 0%, #0A2320 50%, var(--cover-base) 100%);
}
.cover__weave {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background: repeating-linear-gradient(115deg, rgba(52, 229, 224, 0.10) 0 2px, transparent 2px 22px);
}
.cover__label {
  position: absolute;
  left: 48px;
  top: 36px;
  font: 700 11px var(--font-mono);
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.75);
}
.cover__caption {
  font: 500 12px var(--font-display);
  color: var(--text-faint);
  margin-top: 14px;
  text-align: center;
}

.chart {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 44px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 150px;
}
.chart > div { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.bar {
  display: block;
  width: 100%;
  background: var(--accent-a32);
  border-radius: 3px 3px 0 0;
  transform-origin: bottom;
  transition: transform .9s var(--ease);
}
.bar--peak { background: var(--accent); }
.js [data-reveal]:not(.ss-in) .bar { transform: scaleY(0.04); }

/* ----------------------------------------------------------------- prose -- */

.prose p {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.7;
  color: #C7CBD2;
  margin: 0 0 26px;
  text-wrap: pretty;
}
.prose h2 {
  font: 800 30px/1.15 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 52px 0 20px;
  text-wrap: balance;
}
.prose h3 {
  font: 700 22px/1.2 var(--font-display);
  color: var(--text);
  margin: 40px 0 14px;
}
.prose strong { color: var(--text); font-weight: 600; }
/* The design gave <em> a teal monospace treatment — that is inline code, not
   emphasis, so it belongs on <code>: a writer types backticks and gets it,
   and _italics_ still mean italics. */
.prose code {
  color: var(--accent);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.82em;
  letter-spacing: 0.02em;
}
.prose em { font-style: italic; }
.prose ul, .prose ol { margin: 0 0 26px; padding-left: 22px; }
.prose li {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.6;
  color: #C7CBD2;
  margin: 0 0 10px;
}
.prose blockquote {
  margin: 36px 0;
  padding: 8px 0 8px 28px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 25px;
  line-height: 1.4;
  color: var(--text);
}
/* Markdown wraps quote text in <p>, which would otherwise pick up the
   body-copy size and colour. */
.prose blockquote p {
  font: inherit;
  color: inherit;
  margin: 0;
}
.prose blockquote p + p { margin-top: 16px; }

/* ---------------------------------------------------- legal: contents list -- */

.toc {
  margin-top: 44px;
  padding: 26px 30px 28px;
  background: var(--surface-ed);
  border: 1px solid var(--line-nav);
  border-radius: 18px;
}
.toc__title {
  font: 700 12px var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
}
/* The labels carry their own clause numbers, so the list must not add a
   second set — "1. 1. Who we are". */
.toc__list {
  margin: 16px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}
.toc__list a {
  font: 500 15px/1.4 var(--font-display);
  color: var(--text-2);
}
.toc__list a:hover { color: var(--accent); }

/* Numbered clauses sit tighter to their number than prose headings do. */
.prose h2 + p { margin-top: 0; }

/* A definition-style block for "we process X because Y" rows. */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 26px;
  font-family: var(--font-display);
  font-size: 15px;
}
.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}
.prose th {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.prose td { color: #C7CBD2; }

/* ------------------------------------------------------------ tags, author -- */

.tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--line-strong);
}
.tags__label {
  font: 600 11px var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-right: 6px;
}
.tag {
  font: 600 12.5px var(--font-display);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 14px;
  border-radius: 9px;
}

.author-card {
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--surface-ed);
  border: 1px solid var(--line-nav);
  border-radius: 20px;
  padding: 28px 30px;
}
.author-card .avatar { width: 60px; height: 60px; font-size: 22px; }
.author-card__name { font: 800 17px var(--font-display); color: var(--text); }
.author-card__role {
  font: 600 12px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: 3px;
}
.author-card__bio {
  font: 400 14px/1.55 var(--font-display);
  color: var(--text-meta);
  margin-top: 10px;
  text-wrap: pretty;
}

/* --------------------------------------------------------------- related -- */

.related__title {
  font: 900 32px/1.1 var(--font-display);
  letter-spacing: -0.03em;
  margin: 14px 0 28px;
}
.related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.related__card {
  display: flex;
  flex-direction: column;
  background: var(--surface-ed);
  border: 1px solid var(--line-nav);
  border-radius: 18px;
  overflow: hidden;
  color: inherit;
}
.related__card:hover { color: inherit; }
.related__cover { height: 140px; }
.related__body { padding: 22px 22px 24px; }
.related__meta {
  font: 600 10px var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.related__headline {
  font: 800 18px/1.2 var(--font-display);
  letter-spacing: -0.01em;
  margin-top: 10px;
  color: var(--text);
  text-wrap: balance;
}

/* ------------------------------------------------------------------- cta -- */

.article-cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(135deg, #0E3A38, var(--cover-base) 72%);
  border: 1px solid var(--accent-a22);
  border-radius: 26px;
  padding: 60px 40px;
}
.article-cta__glow {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(52, 229, 224, 0.28), transparent 65%);
  pointer-events: none;
}
.article-cta__title {
  position: relative;
  font: 900 38px/1.05 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.article-cta__sub {
  position: relative;
  font: 400 17px/1.6 var(--font-display);
  color: var(--text-prose);
  margin: 16px auto 0;
  max-width: 460px;
}
.article-cta__btn {
  position: relative;
  display: inline-block;
  font: 800 16px var(--font-display);
  color: var(--bg);
  background: var(--accent);
  padding: 16px 34px;
  border-radius: 13px;
  margin-top: 28px;
  box-shadow: 0 14px 34px -14px var(--accent-a70);
}
.article-cta__btn:hover { color: var(--bg); }

/* ---------------------------------------------------------------- footer -- */

.footer--article { background: none; margin-top: 88px; }
.footer--article .footer__row {
  max-width: var(--container);
  margin: 0 auto;
  padding: 44px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer--article .brand__word { font-size: 20px; }
.footer--article .footer__legal { color: var(--text-ghost); font-size: 12px; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 820px) {
  .article__title { font-size: 38px; line-height: 1.02; }
  .measure, .measure--wide, .measure--read {
    padding-left: 24px;
    padding-right: 24px;
  }
  .prose p, .prose li { font-size: 18px; }
  .related__grid { grid-template-columns: 1fr; }
  .cover { height: 300px; }
  .chart { left: 24px; right: 24px; bottom: 30px; height: 110px; }
  .cover__label { left: 24px; top: 24px; }
  .article-cta { padding: 44px 24px; }
  .article-cta__title { font-size: 30px; }
  .author-card { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar { transition-duration: 0.01ms; }
  .js [data-reveal]:not(.ss-in) .bar { transform: none; }
}
