@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --brand-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --brand-font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --brand-display-xl: clamp(2.75rem, 7vw, 5rem);
  --brand-display-lg: clamp(2.25rem, 5vw, 3.75rem);
  --brand-display-md: clamp(2rem, 3.5vw, 2.875rem);
  --brand-display-sm: clamp(1.625rem, 2.5vw, 2.125rem);

  --brand-text: 1.0625rem;
  --brand-text-lg: 1.1875rem;
  --brand-prose: clamp(1.1875rem, 2.5vw, 1.5rem);

  --brand-measure: 50rem;
  --brand-hero: 59rem;
  --brand-card: 26rem;
  --brand-page: 84rem;

  --brand-space-section: clamp(4rem, 9vw, 8rem);
}

html {
  scroll-padding-top: 6rem;
}

body.brand {
  font-family: var(--brand-font-sans);
  color: var(--app-color-on-surface);
  background: var(--app-color-background);
}

.brand-header {
  border-bottom: 1px solid var(--app-color-border);
  position: sticky;
  top: 0;
  background: var(--app-color-background);
  z-index: 10;
}

.brand-header__inner {
  max-width: var(--brand-page);
  margin: 0 auto;
  height: 4rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (min-width: 40rem) {
  .brand-header__inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 64rem) {
  .brand-header__inner {
    padding: 0 2rem;
  }
}

.brand-footer__inner {
  max-width: var(--brand-page);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 1.5rem 2rem;
}

.brand-wordmark {
  font-family: var(--brand-font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.1em;
  color: var(--app-color-on-surface);
  text-decoration: none;
}

.brand-header__nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-nav-link {
  font-size: var(--brand-text);
  font-weight: var(--app-font-weight-medium);
  color: var(--app-color-on-surface);
  text-decoration: none;
}

.brand-nav-link:hover {
  color: var(--app-color-on-surface-muted);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-size: var(--brand-text);
  font-weight: var(--app-font-weight-medium);
  text-decoration: none;
  border: 1px solid var(--app-color-border-emphasis);
  transition: opacity 0.15s ease, background 0.15s ease;
}

.brand-pill--solid {
  background: var(--app-color-primary);
  color: var(--app-color-on-primary);
}

.brand-pill--solid:hover {
  background: var(--app-color-primary-hover);
}

.brand-pill--outline {
  background: transparent;
  color: var(--app-color-on-surface);
}

.brand-pill--outline:hover {
  background: var(--app-color-surface-sunken);
}

.brand-main {
  min-height: 60vh;
}

.brand-eyebrow {
  font-size: var(--app-font-size-xs);
  font-weight: var(--app-font-weight-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--app-color-on-surface-muted);
  margin-bottom: 1rem;
}

.brand-section {
  max-width: var(--brand-page);
  margin: 0 auto;
  padding: var(--brand-space-section) 1.5rem;
}

.blog-index {
  max-width: var(--brand-hero);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) 1.5rem clamp(4rem, 8vw, 7rem);
}

.blog-index__header {
  margin-bottom: clamp(4rem, 8vw, 7rem);
}

.blog-index__headline {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: clamp(2rem, 6vw, 6rem);
}

.blog-index__title {
  font-family: var(--brand-font-display);
  font-size: var(--brand-display-xl);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
}

.blog-index__intro {
  justify-self: end;
  font-size: var(--brand-text);
  line-height: 1.7;
  color: var(--app-color-on-surface-muted);
  margin: 0;
}

@media (max-width: 48rem) {
  .blog-index__headline {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .blog-index__intro {
    justify-self: start;
  }
}

.article-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-card {
  border-top: 1px solid var(--app-color-border);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  display: grid;
  gap: 0.85rem;
}

.article-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.article-card > * {
  max-width: var(--brand-card);
}

.article-card--featured > * {
  max-width: 100%;
}

.article-card__image {
  display: block;
  margin-bottom: 1.25rem;
}

.article-card__image > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.article-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--app-color-surface-sunken);
  border: 1px solid var(--app-color-border);
}

.article-card__placeholder-mark {
  display: block;
  width: 40%;
  max-width: 12rem;
  height: auto;
  opacity: 0.3;
}

.article-card__more {
  justify-self: start;
  margin-top: 0.5rem;
  font-size: var(--app-font-size-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--app-color-on-surface);
}

.article-card__more::after {
  content: " →";
}

.article-card__more:hover {
  color: var(--app-color-on-surface-muted);
}

.article-card__meta {
  font-size: var(--app-font-size-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--app-color-on-surface-muted);
}

.article-card__title {
  font-family: var(--brand-font-display);
  font-size: var(--brand-display-sm);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

.article-card--featured .article-card__title,
.article-card--featured .article-card__summary {
  max-width: var(--brand-measure);
}

.article-card--featured .article-card__title {
  font-size: var(--brand-display-md);
}

.article-card__title a {
  color: var(--app-color-on-surface);
  text-decoration: none;
}

.article-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-card__summary {
  font-size: var(--brand-text-lg);
  line-height: 1.7;
  color: var(--app-color-on-surface-muted);
  margin: 0;
}

.article-header {
  max-width: var(--brand-hero);
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  padding: clamp(3rem, 7vw, 6rem) 1.5rem 0;
}

.article-header__title {
  font-family: var(--brand-font-display);
  font-size: var(--brand-display-xl);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 2.5rem;
}

.brand-eyebrow__rule {
  display: inline-block;
  width: 2rem;
  height: 1px;
  margin: 0 0.75rem;
  vertical-align: middle;
  background: var(--app-color-border-emphasis);
}

.article-header__standfirst {
  font-size: var(--app-font-size-xl);
  line-height: 1.6;
  color: var(--app-color-on-surface-muted);
  margin: 0 0 2rem;
}

.article-header__byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--app-color-border);
  padding-top: 1.5rem;
}

.article-header__author {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.article-header__avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.article-header__name {
  margin: 0;
  font-size: var(--app-font-size-md);
  font-weight: var(--app-font-weight-medium);
  color: var(--app-color-on-surface);
}

.article-header__meta {
  margin: 0.15rem 0 0;
  font-size: var(--app-font-size-sm);
  color: var(--app-color-on-surface-muted);
}

.article-header__share {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.article-header__share-link {
  font-size: var(--app-font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--app-color-on-surface-muted);
}

.article-header__share-link:hover {
  color: var(--app-color-on-surface);
}

.prose {
  max-width: var(--brand-measure);
  margin: 0 auto;
  padding: 0 1.5rem clamp(4rem, 8vw, 7rem);
  font-size: var(--brand-prose);
  line-height: 1.8;
  color: var(--app-color-on-surface-muted);
}

.prose h2,
.prose h3,
.prose strong {
  color: var(--app-color-on-surface);
}

.prose > * + * {
  margin-top: 1.75rem;
}

.prose h2 {
  font-family: var(--brand-font-display);
  font-size: var(--brand-display-sm);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 3.5rem;
  margin-bottom: 1rem;
}

.prose h3 {
  font-family: var(--brand-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.prose h4 {
  font-size: var(--app-font-size-base);
  font-weight: var(--app-font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-color-on-surface-muted);
  margin-top: 2rem;
}

.prose a {
  color: var(--app-color-on-surface);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  color: var(--app-color-on-surface-muted);
}

.prose strong em,
.prose em strong {
  font-family: var(--brand-font-display);
  font-style: italic;
  font-weight: var(--app-font-weight-regular);
  font-size: 1.15em;
}

.prose strong {
  font-weight: var(--app-font-weight-semibold);
}

.prose ul {
  padding-left: 1.5rem;
}

.prose ol {
  list-style: none;
  counter-reset: prose-ol;
  padding-left: 0;
}

.prose ol > li {
  counter-increment: prose-ol;
  position: relative;
  padding-left: 3rem;
}

.prose ol > li::before {
  content: counter(prose-ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15em;
  font-family: var(--app-font-family-mono, ui-monospace, monospace);
  font-size: var(--app-font-size-xs);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--app-color-on-surface-muted);
}

.prose li + li {
  margin-top: 0.75rem;
}

.article-cta {
  max-width: var(--brand-measure);
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--app-color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.article-cta__text {
  min-width: 0;
}

.article-cta__heading {
  margin: 0;
  font-family: var(--brand-font-display);
  font-size: var(--brand-display-sm);
  line-height: 1.2;
  color: var(--app-color-on-surface);
}

.article-cta .brand-pill {
  flex-shrink: 0;
}

@media (max-width: 40rem) {
  .article-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
}

.callout {
  max-width: var(--brand-measure);
  margin: 3rem auto;
  padding: 2rem 2.25rem;
  background: var(--app-color-surface-sunken);
  border: 1px solid var(--app-color-border);
  border-radius: 0.75rem;
}

.callout__eyebrow {
  margin: 0 0 1rem;
  font-size: var(--app-font-size-xs);
  font-weight: var(--app-font-weight-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--app-color-on-surface-subtle);
}

.callout__heading {
  font-family: var(--brand-font-display);
  font-size: var(--brand-display-sm);
  font-weight: 500;
  line-height: 1.3;
  color: var(--app-color-on-surface);
}

.callout__heading p {
  margin: 0;
  font-weight: 400;
}

.callout__body {
  margin-top: 1.75rem;
  font-size: 1.125rem;
  color: var(--app-color-on-surface-muted);
}

.callout__body p {
  margin: 0 0 1.35rem;
  line-height: 1.8;
}

.callout__body p:last-child {
  margin-bottom: 0;
}

.callout__heading a,
.callout__body a {
  color: var(--app-color-on-surface);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.callout__heading a:hover,
.callout__body a:hover {
  color: var(--app-color-on-surface-muted);
}

.callout__body ul {
  margin: 0 0 1.35rem;
  padding-left: 1.5rem;
}

.callout__body ol {
  margin: 0 0 1.35rem;
  list-style: none;
  counter-reset: callout-ol;
  padding-left: 0;
}

.callout__body ol > li {
  counter-increment: callout-ol;
  position: relative;
  padding-left: 3rem;
}

.callout__body ol > li::before {
  content: counter(callout-ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15em;
  font-family: var(--app-font-family-mono, ui-monospace, monospace);
  font-size: var(--app-font-size-xs);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--app-color-on-surface-muted);
}

.callout__body li + li {
  margin-top: 0.75rem;
}

.callout__body > :last-child {
  margin-bottom: 0;
}

@media (max-width: 40rem) {
  .callout {
    padding: 1.5rem;
  }
}

.prose blockquote {
  border-left: 2px solid var(--app-color-border-emphasis);
  padding-left: 1.5rem;
  margin-left: 0;
  font-family: var(--brand-font-display);
  font-size: 1.5rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--app-color-on-surface);
}

.prose blockquote p {
  margin: 0;
}

.prose code {
  font-size: 0.9em;
  background: var(--app-color-surface-sunken);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose pre {
  background: var(--app-color-surface-sunken);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--app-font-size-sm);
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--app-color-border);
}

.prose th {
  font-weight: var(--app-font-weight-semibold);
  border-bottom-color: var(--app-color-border-strong);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--app-color-border);
  margin: 3rem 0;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose .footnotes {
  font-size: var(--app-font-size-sm);
  color: var(--app-color-on-surface-muted);
  border-top: 1px solid var(--app-color-border);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.brand-footer {
  border-top: 1px solid var(--app-color-border);
  margin-top: var(--brand-space-section);
}

.brand-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.brand-footer__mark {
  display: inline-block;
  color: var(--app-color-on-surface);
}

.brand-footer__tagline {
  margin: 1.75rem 0 0;
  font-size: var(--brand-text);
  color: var(--app-color-on-surface-muted);
}

.brand-footer__heading {
  margin: 0 0 1.25rem;
  font-family: var(--brand-font-display);
  font-size: var(--app-font-size-lg);
  font-weight: 700;
  color: var(--app-color-on-surface);
}

.brand-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.brand-footer__links a {
  font-size: var(--brand-text);
  color: var(--app-color-on-surface-muted);
  text-decoration: none;
}

.brand-footer__links a:hover {
  color: var(--app-color-on-surface);
}

.brand-footer__column--legal {
  grid-column: 1;
  margin-top: 3.5rem;
}

.brand-footer__base {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--app-color-border);
}

.brand-footer__meta {
  font-size: var(--app-font-size-sm);
  color: var(--app-color-on-surface-muted);
  margin: 0;
}

@media (max-width: 48rem) {
  .brand-footer__grid {
    grid-template-columns: 1fr;
  }

  .brand-footer__column--legal {
    margin-top: 0;
  }
}

.empty-state-note {
  max-width: var(--brand-measure);
  color: var(--app-color-on-surface-muted);
  font-size: var(--app-font-size-lg);
  line-height: 1.7;
}

.article-figures,
.article-methodology {
  max-width: var(--brand-measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article-methodology {
  border-top: 1px solid var(--app-color-border);
  padding-top: 2rem;
  margin-top: 3rem;
}

.article-methodology .prose {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.chart {
  font-family: var(--brand-font-sans);
}

.chart__axis {
  stroke: var(--app-color-border-strong);
  stroke-width: 1;
}

.chart__bar {
  fill: var(--app-color-on-surface);
}

.chart__bar--muted {
  fill: var(--app-color-on-surface-subtle);
}

.chart__value {
  font-size: 20px;
  font-weight: var(--app-font-weight-semibold);
  fill: var(--app-color-on-surface);
}

.chart__label {
  font-size: 13px;
  fill: var(--app-color-on-surface-muted);
}

.figure {
  margin: 3rem 0 1rem;
}

.figure__chart svg,
.figure__image {
  display: block;
  width: 100%;
  height: auto;
}

.figure__caption {
  border-top: 1px solid var(--app-color-border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.figure__title {
  font-size: var(--app-font-size-sm);
  font-weight: var(--app-font-weight-semibold);
  margin: 0 0 0.35rem;
}

.figure__text {
  font-size: var(--app-font-size-sm);
  line-height: 1.6;
  color: var(--app-color-on-surface-muted);
  margin: 0 0 0.35rem;
}

.figure__source {
  font-size: var(--app-font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-color-on-surface-muted);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.figure__link {
  color: var(--app-color-on-surface);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.figure-embed {
  margin-bottom: 3rem;
  font-size: var(--app-font-size-sm);
}

.figure-embed__summary {
  cursor: pointer;
  font-weight: var(--app-font-weight-medium);
  color: var(--app-color-on-surface-muted);
}

.figure-embed__hint {
  color: var(--app-color-on-surface-muted);
  margin: 0.75rem 0;
  line-height: 1.6;
}

.figure-embed__code {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 0.75rem;
  border: 1px solid var(--app-color-border);
  border-radius: 8px;
  background: var(--app-color-surface-sunken);
  color: var(--app-color-on-surface);
  resize: vertical;
  margin-bottom: 0.75rem;
}

.embed-body {
  margin: 0;
  padding: 1rem;
}

.embed-body .figure {
  margin: 0;
}

@media (max-width: 640px) {
  .brand-footer__inner {
    padding: 3rem 1rem 1.5rem;
  }

  .brand-header__nav {
    gap: 0.75rem;
  }

  .brand-nav-link {
    display: none;
  }
}
