/* ==========================================================================
   Clear Ledger - main.css
   Mobile-first. Base rules target a 360px screen; wider layouts are layered
   on with min-width queries at 480px, 768px and 1024px.
   Layout language: a narrow editorial column under a ruled masthead,
   uppercase condensed-feel headlines, plain bullets, one data table.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #0a0a0a;
  --text: #222b33;
  --muted: #566069;
  --link: #0a6283;
  --link-dark: #074a63;
  --teal: #0c6e8a;
  --tint: #eef5f8;
  --rule: #d6dee3;
  --accent: #f08a24;

  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --measure: 736px;
  --radius: 4px;
  --cols: minmax(var(--gutter), 1fr) minmax(0, var(--measure)) minmax(var(--gutter), 1fr);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem);
  font-weight: 400;
  line-height: 1.58;
  overflow-wrap: break-word;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

a:hover {
  color: var(--link-dark);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

[id] {
  scroll-margin-top: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
  color: #fff;
}

/* ---------- Masthead ---------- */
.masthead {
  background: #fff;
  border-bottom: 1px solid var(--ink);
}

.masthead-inner {
  display: grid;
  grid-template-areas:
    "brand label toggle"
    "nav nav nav";
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 12px;
  max-width: 1040px;
  margin-inline: auto;
  padding: 10px var(--gutter);
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  flex: none;
  width: 40px;
  height: 40px;
}

.brand-name {
  display: grid;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.label-sponsored {
  grid-area: label;
  justify-self: end;
  padding: 6px 9px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.masthead-back {
  grid-area: label;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.masthead-back:hover {
  text-decoration: underline;
}

.nav-toggle {
  grid-area: toggle;
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--ink), var(--ink)) center 14px / 20px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center 21px / 20px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center 28px / 20px 2px no-repeat,
    #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--ink);
}

.js .nav-toggle {
  display: block;
}

.masthead-nav {
  grid-area: nav;
}

.js .masthead-nav {
  display: none;
}

.js .masthead-nav.is-open {
  display: block;
}

.masthead-nav ul {
  display: grid;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.masthead-nav li + li {
  border-top: 1px solid var(--rule);
}

.masthead-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--link);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: uppercase;
}

.masthead-nav a:hover {
  color: var(--link-dark);
  text-decoration: underline;
}

/* ---------- Article head ---------- */
.story-head,
.band,
.legal,
.page-end {
  display: grid;
  grid-template-columns: var(--cols);
}

.story-head > *,
.band > *,
.legal > * {
  grid-column: 2;
  min-width: 0;
}

.story-head {
  padding-top: 28px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--link);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.story-head h1,
.legal h1 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: clamp(1.625rem, 1.2rem + 2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}

.dek {
  margin: 0 0 14px;
  color: var(--text);
  font-size: clamp(1.1875rem, 1.1rem + 0.45vw, 1.3125rem);
  line-height: 1.45;
}

.byline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.875rem;
}

.byline-author {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Media ---------- */
.story-head > figure,
.band > figure,
.band > .duo {
  grid-column: 1 / -1;
}

.frame {
  aspect-ratio: 40 / 21;
  overflow: hidden;
  background: #151515;
}

.frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.band figure img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--tint);
}

figcaption {
  padding: 8px var(--gutter) 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.band > figure {
  margin: 8px 0 24px;
}

.story-head > figure {
  margin: 0;
}

.duo {
  display: grid;
  gap: 24px;
  margin: 8px 0 24px;
}

.duo figcaption strong {
  display: block;
  margin-bottom: 2px;
  color: var(--link);
  font-size: 1rem;
  line-height: 1.3;
}

/* Trust row (accent reference: pale tinted strip, small marks, short labels) */
.badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin: 20px 0 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--tint);
  list-style: none;
}

.badges li {
  position: relative;
  min-height: 24px;
  padding-left: 32px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.badges li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
}

.badges li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 11px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) scale(0.8);
}

/* ---------- Article bands ---------- */
.band {
  padding-block: 16px;
}

.band-lead {
  padding-top: 28px;
}

.band-tint {
  margin-block: 16px;
  padding-block: 40px;
  background: var(--tint);
}

.band h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

.band p,
.legal p {
  margin: 0 0 1.1rem;
}

.punch {
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.4;
}

.band ul,
.legal ul {
  margin: 0 0 1.1rem;
  padding-left: 1.3em;
}

.band li::marker,
.legal li::marker {
  color: var(--teal);
}

.band ul > li,
.legal ul > li {
  margin-bottom: 0.55rem;
  padding-left: 0.2em;
}

.band .badges li {
  padding-left: 32px;
  margin-bottom: 0;
}

/* Numbered steps */
.steps {
  display: grid;
  gap: 22px;
  margin: 6px 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-areas:
    "num title"
    "num text";
  grid-template-columns: 40px 1fr;
  column-gap: 16px;
  margin: 0;
  padding: 0;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  grid-area: num;
  display: grid;
  place-items: center;
  align-self: start;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
}

.steps h3 {
  grid-area: title;
  margin: 6px 0 2px;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
}

.steps p {
  grid-area: text;
  margin: 0;
}

/* Data table (primary reference: teal header, ruled cells) */
.facts {
  container-type: inline-size;
  margin: 8px 0 8px;
}

.facts table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.4;
}

.facts th,
.facts td {
  padding: 13px 16px;
  border: 1px solid var(--rule);
  background: #fff;
  text-align: left;
  vertical-align: top;
}

.facts thead th {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts tbody th {
  width: 34%;
  color: var(--ink);
  font-weight: 700;
}

@container (max-width: 559px) {
  .facts table,
  .facts tbody,
  .facts tr,
  .facts th,
  .facts td {
    display: block;
    width: 100%;
  }

  .facts thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .facts tr {
    margin-bottom: 12px;
    border: 1px solid var(--rule);
  }

  .facts th,
  .facts td {
    border: 0;
  }

  .facts tbody th {
    width: 100%;
    padding-bottom: 2px;
    background: var(--teal);
    color: #fff;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .facts td {
    padding-top: 10px;
  }
}

/* Calls to action */
.cta-row {
  display: grid;
  gap: 14px;
  margin: 12px 0 8px;
  padding-block: 22px;
  border-block: 1px solid var(--rule);
}

.cta-row p {
  margin: 0;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.cta-link::after {
  content: "\2192";
  transition: transform 0.2s ease;
}

.cta-link:hover {
  background: var(--link-dark);
  box-shadow: 0 4px 14px rgba(7, 74, 99, 0.28);
  color: #fff;
}

.cta-link:hover::after {
  transform: translateX(4px);
}

/* ---------- Legal / about pages ---------- */
.legal {
  padding-block: 32px 16px;
}

.legal h1 {
  margin-bottom: 8px;
}

.legal-meta {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.875rem;
}

.legal h2 {
  margin: 28px 0 10px;
  color: var(--ink);
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
}

.legal ul {
  margin-bottom: 1.1rem;
}

/* ---------- Page close (single footer) ---------- */
.page-end {
  grid-template-areas:
    ". owner ."
    ". links ."
    ". note .";
  row-gap: 8px;
  margin-top: 40px;
  padding-block: 32px 48px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.owner {
  grid-area: owner;
}

.owner p {
  margin: 0;
}

.owner strong {
  color: var(--ink);
}

.meta-links {
  grid-area: links;
}

.meta-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: underline;
}

.meta-links a:hover {
  color: var(--ink);
}

.site-note {
  grid-area: note;
  margin: 0;
}

/* ==========================================================================
   480px and up
   ========================================================================== */
@media (min-width: 480px) {
  :root {
    --gutter: 20px;
  }

  .masthead-inner {
    column-gap: 16px;
  }

  .cta-link {
    justify-self: start;
  }

  .byline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 12px;
  }

  .byline-date::before {
    content: "\00b7";
    margin-right: 12px;
  }
}

/* ==========================================================================
   768px and up
   ========================================================================== */
@media (min-width: 768px) {
  :root {
    --gutter: 24px;
  }

  .masthead-inner {
    min-height: 84px;
    padding-block: 12px;
  }

  .masthead-nav ul {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 32px;
  }

  .masthead-nav li:nth-child(2) {
    border-top: 0;
  }

  .story-head {
    padding-top: 44px;
  }

  .story-head h1 {
    margin-bottom: 20px;
  }

  .dek {
    margin-bottom: 16px;
  }

  .byline {
    margin-bottom: 32px;
  }

  .story-head > figure,
  .band > figure {
    grid-column: 2;
  }

  .band > .duo {
    grid-column: 2;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  figcaption {
    padding-inline: 0;
  }

  .badges {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 24px;
    padding: 18px 20px;
  }

  .band {
    padding-block: 20px;
  }

  .band-lead {
    padding-top: 36px;
  }

  .band-tint {
    margin-block: 24px;
    padding-block: 56px;
  }

  .steps {
    gap: 26px;
  }

  .cta-row {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 28px;
    margin-block: 16px 8px;
  }

  .legal {
    padding-top: 56px;
  }

  .page-end {
    grid-template-areas:
      ". owner links ."
      ". note note .";
    grid-template-columns:
      minmax(var(--gutter), 1fr)
      minmax(0, calc((var(--measure) - 32px) * 0.46))
      minmax(0, calc((var(--measure) - 32px) * 0.54))
      minmax(var(--gutter), 1fr);
    column-gap: 32px;
    row-gap: 12px;
    margin-top: 48px;
    padding-block: 40px 64px;
  }
}

/* ==========================================================================
   1024px and up
   ========================================================================== */
@media (min-width: 1024px) {
  .masthead-inner {
    grid-template-areas: "brand nav label";
    grid-template-columns: auto 1fr auto;
    column-gap: 32px;
    min-height: 93px;
  }

  .js .nav-toggle,
  .nav-toggle {
    display: none;
  }

  .masthead-nav,
  .js .masthead-nav {
    display: block;
    justify-self: center;
  }

  .masthead-nav ul {
    display: flex;
    gap: 6px 44px;
    margin: 0;
  }

  .masthead-nav li + li,
  .masthead-nav li:nth-child(2) {
    border-top: 0;
  }

  .masthead-nav a {
    min-height: 44px;
    font-size: 0.9375rem;
    white-space: nowrap;
  }

  .story-head h1 {
    margin-bottom: 22px;
  }

  .band {
    padding-block: 24px;
  }

  .cta-row {
    padding-block: 26px;
  }
}
