/* ==========================================================================
   Affordability for America — affordability.us
   Shared stylesheet
   ========================================================================== */

:root {
  --paper:       #F7F6F2;
  --paper-deep:  #EDEAE1;
  --ink:         #16181A;
  --ink-soft:    #4C5054;
  --ink-faint:   #86898C;
  --income:      #1F4D3D;
  --income-lift: #2F6E58;
  --cost:        #A8442B;
  --rule:        #D8D4C8;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "Newsreader", Georgia, "Times New Roman", serif;
  --mono:    "JetBrains Mono", "SF Mono", Menlo, monospace;

  --measure: 36rem;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --shell: 74rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--income);
  outline-offset: 3px;
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.measure { max-width: var(--measure); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* --- Type roles ---------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); }
h2 { font-size: clamp(1.85rem, 3.9vw, 3.1rem); }
h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -0.015em;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.2rem, 1.9vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
  display: block;
}

/* --- Payment rhythm rule (site signature) -------------------------------- */
/* Twelve marks on a hairline: one payment, every month, no strings. */

.rhythm {
  display: flex;
  align-items: center;
  gap: 0;
  height: 10px;
  position: relative;
  width: 100%;
  max-width: 30rem;
}
.rhythm::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--rule);
}
.rhythm span {
  position: relative;
  flex: 1 1 0;
}
.rhythm span::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  background: var(--income);
  transform: scale(0);
  animation: tick 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.rhythm span:nth-child(1)::after  { animation-delay: 0.20s; }
.rhythm span:nth-child(2)::after  { animation-delay: 0.27s; }
.rhythm span:nth-child(3)::after  { animation-delay: 0.34s; }
.rhythm span:nth-child(4)::after  { animation-delay: 0.41s; }
.rhythm span:nth-child(5)::after  { animation-delay: 0.48s; }
.rhythm span:nth-child(6)::after  { animation-delay: 0.55s; }
.rhythm span:nth-child(7)::after  { animation-delay: 0.62s; }
.rhythm span:nth-child(8)::after  { animation-delay: 0.69s; }
.rhythm span:nth-child(9)::after  { animation-delay: 0.76s; }
.rhythm span:nth-child(10)::after { animation-delay: 0.83s; }
.rhythm span:nth-child(11)::after { animation-delay: 0.90s; }
.rhythm span:nth-child(12)::after { animation-delay: 0.97s; }

@keyframes tick { to { transform: scale(1); } }

.rhythm--divider {
  max-width: none;
  margin: 0;
}
.rhythm--divider span::after {
  background: var(--rule);
  transform: scale(1);
  animation: none;
}

/* --- Header -------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.05rem;
  padding-bottom: 1.05rem;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.022em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark em {
  font-style: normal;
  color: var(--income);
}
.nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--income);
}

/* --- Sections ------------------------------------------------------------ */

.hero {
  padding-top: clamp(3.5rem, 9vw, 7rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.hero h1 { max-width: 17ch; }
.hero .lead {
  font-size: clamp(1.25rem, 2.1vw, 1.55rem);
  max-width: 40rem;
  margin-top: clamp(1.75rem, 3.5vw, 2.75rem);
}
.hero .rhythm { margin-top: clamp(2.25rem, 4.5vw, 3.5rem); }

.band {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}
.band--deep {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.band--tight { padding-top: clamp(2rem, 4vw, 3rem); }

.band h2 + p,
.band h2 + .measure { margin-top: 1.6rem; }

/* --- Video slot ---------------------------------------------------------- */

.video-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.video-slot iframe,
.video-slot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-slot .placeholder {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8E9296;
  line-height: 2;
}
.video-caption {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.65;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
  margin-top: 1.1rem;
  max-width: 44rem;
}

/* --- Numbers list (Home) ------------------------------------------------- */

.numbers {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.numbers li {
  display: grid;
  grid-template-columns: minmax(5.5rem, 10rem) 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: baseline;
  padding: clamp(1.5rem, 3vw, 2.1rem) 0;
  border-bottom: 1px solid var(--rule);
}
.numbers .fig {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--income);
}
.numbers .say {
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: 34rem;
}

/* --- Gap chart (About signature) ----------------------------------------- */

.gap-chart {
  margin: clamp(2.5rem, 5vw, 3.75rem) 0 0;
  max-width: none;
  width: 100%;
}
.gap-chart svg {
  display: block;
  width: 100%;
  height: clamp(210px, 26vw, 300px);
  overflow: visible;
}
.gap-chart .axis { stroke: var(--ink-faint); stroke-width: 1; }
.gap-chart .grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; }
.gap-chart .fill-gap { fill: var(--cost); opacity: 0; transition: opacity 0.7s ease 1.1s; }
.gap-chart .line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.gap-chart .line-cost { stroke: var(--cost); }
.gap-chart .cap { opacity: 0; transition: opacity 0.5s ease 1.5s; }
.gap-chart.is-drawn .cap { opacity: 1; }
.gap-chart .line-income { stroke: var(--income); transition-delay: 0.35s; }
.chart-scale {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  color: var(--ink-faint);
}
.chart-legend {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}
.chart-legend li { display: flex; align-items: center; gap: 0.55rem; }
.chart-legend .sw { width: 18px; height: 3px; flex: none; }
.chart-legend .sw-cost { background: var(--cost); }
.chart-legend .sw-income { background: var(--income); }
.chart-legend .sw-gap { height: 12px; width: 18px; background: var(--cost); opacity: 0.16; }
.gap-chart.is-drawn .line { stroke-dashoffset: 0; }
.gap-chart.is-drawn .fill-gap { opacity: 0.11; }
.chart-note {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--ink-faint);
  margin-top: 1rem;
  max-width: 44rem;
}

/* --- Prose blocks -------------------------------------------------------- */

.block { padding: clamp(2.5rem, 5vw, 3.75rem) 0; border-bottom: 1px solid var(--rule); }
.block:last-of-type { border-bottom: 0; }
.block > .measure { margin-top: 1.5rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
@media (min-width: 62rem) {
  .split { grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr); gap: 4rem; }
  .split > h2 { position: sticky; top: 6rem; align-self: start; }
}
.split > div > p { max-width: 36rem; }
.split > div > p.lead { max-width: 38rem; }

/* --- Purpose pair (Mission / Vision) ------------------------------------- */

.pair {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 46rem) {
  .pair { grid-template-columns: 1fr 1fr; }
}
.pair > div {
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.pair h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.9rem;
}
.pair p {
  font-size: 1.2rem;
  line-height: 1.45;
}

/* --- Evidence list (GI Works) -------------------------------------------- */

.evidence { margin-top: 2rem; }
.finding {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem 3rem;
  padding: clamp(1.35rem, 2.6vw, 1.85rem) 0;
  border-top: 1px solid var(--rule);
}
.finding:last-child { border-bottom: 1px solid var(--rule); }
.finding .place {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--income);
  padding-top: 0.35rem;
}
.finding p { max-width: 40rem; }
@media (min-width: 52rem) {
  .finding { grid-template-columns: 11rem minmax(0, 1fr); }
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Contact ------------------------------------------------------------- */

.contact-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  max-width: 40rem;
}
.contact-list li {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.contact-list .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.5rem;
}
.contact-list a {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 2px solid var(--income);
  padding-bottom: 1px;
}
.contact-list a:hover { color: var(--income); }

/* --- Footer -------------------------------------------------------------- */

.colophon {
  border-top: 1px solid var(--rule);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}
.colophon .rhythm { margin-bottom: 2rem; }
.colophon-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
}
.colophon p {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 32rem;
  margin: 0;
}
.colophon nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.colophon nav a { text-decoration: none; color: var(--ink-soft); }
.colophon nav a:hover { color: var(--ink); }

/* --- Motion preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .rhythm span::after { transform: scale(1); }
  .gap-chart .line { stroke-dashoffset: 0; }
  .gap-chart .fill-gap { opacity: 0.11; }
}
