:root {
  /* palette pulled from the Data Desk mockup */
  --band: #4a3c33;        /* brown hero title band */
  --band-ink: #f3ede4;    /* cream type on the band */
  --band-soft: #cbbcab;   /* muted cream for the dek / roles */
  --page: #f0ebe8;        /* warm off-white page behind the story */
  --box: #ffffff;         /* white content boxes */
  --ink: #2b2320;         /* body text */
  --ink-soft: #6d655e;    /* captions / notes */
  --pill: #e7ded2;        /* byline pill */
  --pill-ink: #3a302a;
  --rule: #d9d3ca;        /* hairline rules inside cards */
  --gutter: 2rem;
  --prose-w: 640px;
  --chart-w: 700px;
  --serif: Georgia, "Times New Roman", "Times", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ============================ HERO ============================ */

.hero {
  background: var(--band);
}

.hero__photo {
  /* opening screen: photo row takes 70% of the viewport, the band the other 30% */
  position: relative;
  height: 70vh;
  line-height: 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
  /* plain white behind the faded side copies, so no brown tint shows through */
  background: #fff;
  /* opacity of the mirrored side copies; the center image's edges fade down to this */
  --side-opacity: 0.95;
}

/* mirrored copies of the photo on each side of the centered image, at 30% opacity.
   Each copy is the full photo width, butted against the center image and flipped,
   so its edge mirrors the center image's edge. */
.hero__photo::before,
.hero__photo::after {
  --photo-w: calc(70vh * 2000 / 1429); /* hero photo is 2000×1429 */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--photo-w);
  background-image: url("assets/hero-photo.webp");
  background-size: cover;
  background-position: center;
  transform: scaeb leX(-1);
  opacity: var(--side-opacity);
}

.hero__photo::before {
  right: calc(50% + var(--photo-w) / 2 - 2px); /* tuck 2px under the center image so no gap shows */
}

.hero__photo::after {
  left: calc(50% + var(--photo-w) / 2 - 2px);
}

.hero__photo img {
  position: relative;
  z-index: 1;
  display: block;
  /* shrunk to fit the 70vh row, uncropped */
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  /* fade the edges from 100% down to the side copies' opacity, so there's no hard line between them */
  --fade: linear-gradient(
    to right,
    rgba(0, 0, 0, var(--side-opacity)) 0%,
    #000 18%,
    #000 82%,
    rgba(0, 0, 0, var(--side-opacity)) 100%
  );
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
}

.hero__band {
  /* Rectangle 3 gradient: #423832 -> #CEAC98 @ 0.8 */
  background: linear-gradient(to bottom, #423832 0%, rgba(206, 172, 152, 0.8) 118.4%);
  /* the gradient rectangle height */
  flex: 0 0 auto;
  min-height: 30vh;
  display: flex;
  align-items: center;
  padding: 0.55rem var(--gutter) 0.7rem;
  margin-top: -2px;
}

.hero__inner {
  width: min(1180px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.hero__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.hero h1 {
  color: var(--band-ink);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.22;
  letter-spacing: 0.01em;
  margin: 0 0 0.5rem;
  max-width: 30ch;
}

.hero__dek {
  color: var(--band-soft);
  font-style: italic;
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  line-height: 1.5;
  margin: 0 0 0.6rem;
  max-width: 62ch;
}

/* byline */
.byline {
  font-size: 0.72rem;
}

.byline__row {
  margin: 0 0 0.45rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.byline__role {
  color: var(--band-soft);
  margin-right: 0.3rem;
}

.pill {
  background: var(--pill);
  color: var(--pill-ink);
  padding: 0.14rem 0.5rem;
  border-radius: 0.28rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.hero__logo {
  flex: 0 0 auto;
  line-height: 0;
  margin-top: 0.4rem;
}

.hero__logo img {
  display: block;
  width: 230px;
  max-width: 34vw;
  height: auto;
  /* the supplied wordmark is dark; flip it to cream on the brown band */
  filter: brightness(0) invert(1) opacity(0.92);
}

/* ============================ STORY ============================ */

.story {
  padding: 3.5rem 0 5rem;
}

/* lorem-ipsum text blocks in light boxes */
.prose {
  width: min(var(--prose-w), calc(100% - 2 * var(--gutter)));
  margin: 0 auto 2.25rem;
  background: var(--box);
  padding: 2.25rem 3.25rem;
  border-radius: 2px;
}

.prose p {
  font-size: 1rem;
  line-height: 1.62;
  margin: 0 0 1rem;
  color: var(--ink);
}

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

/* ============================ CHART CARDS ============================ */

.chart {
  width: min(var(--chart-w), calc(100% - 2 * var(--gutter)));
  margin: 2.5rem auto;
  background: var(--box);
  padding: 1.6rem 1.75rem 1.1rem;
  border-radius: 2px;
  border: 1px solid #ededed;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart__title {
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.3;
  margin: 0 0 0.3rem;
  color: var(--ink);
}

.chart__sub {
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0 0 0.9rem;
  color: #4a433d;
}

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  color: #4a433d;
}

.chart__legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.chart__legend i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  display: inline-block;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart__note {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0.6rem 0 0;
}

.chart__credit {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin: 0.55rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

/* axis + plot styling shared by the SVG charts */
.chart .axis text {
  fill: #6d655e;
  font-size: 11px;
  font-family: var(--serif);
}

.chart .grid line {
  stroke: #e2ddd4;
  stroke-width: 1;
}

.chart .baseline {
  stroke: #b9b1a6;
  stroke-width: 1;
}

.chart .series-label {
  fill: #4a433d;
  font-size: 11px;
  font-family: var(--serif);
}

/* chart 3 sits on a dollar-bill background */
.chart--bill {
  position: relative;
  /* keep the content inside the white panel, clear of the bill's border */
  padding: 2rem 2.2rem 1.9rem;
  color: #2b2320;
}

.chart--bill .bill-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 2px;
  overflow: hidden;
  /* two dollar bills stacked to fill the card */
  background-color: #ddcfb6;
  background-image: url("assets/dollar-bill.png"), url("assets/dollar-bill-2.png");
  background-position: center top, center bottom;
  background-size: 100% 50%, 100% 50%;
  background-repeat: no-repeat, no-repeat;
  opacity: 0.9;
}

/* white panel over the middle of the bill, so only its ornate border frames the chart */
.chart--bill .bill-bg::after {
  content: "";
  position: absolute;
  inset: 18px 20px;
  background: #fff;
  border-radius: 2px;
}

.chart--bill > *:not(.bill-bg) {
  position: relative;
  z-index: 1;
}

.chart--bill .chart__title,
.chart--bill .chart__sub,
.chart--bill .chart__legend {
  color: #241a12;
}

/* ============================ RESPONSIVE ============================ */

@media (max-width: 720px) {
  :root {
    --gutter: 1rem;
  }

  .hero__photo {
    height: auto;
  }

  .hero__photo img {
    width: 100%;
    height: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero__inner {
    flex-direction: column;
    gap: 1.1rem;
  }

  .hero__logo {
    order: -1;
    margin-top: 0;
  }

  .hero__logo img {
    width: 190px;
    max-width: 60vw;
  }

  .story {
    padding: 2.25rem 0 3rem;
  }
}

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