/* "How it works" (/how-it-works). Ported from mockups/How.dc.html; spec in PLAN.md, '"How it works" page redesign'.
   Phone first: the base rules are one column at 16 px side padding; the min-width blocks widen it to the mockup.
   Cards only for the resident file; elsewhere space and thin rules. Terracotta only for the one button
   (and the miss key in the accuracy legend, as the plan asks). */

.how { max-width: 1200px; margin: 0 auto; padding: 0 16px; font-size: 17px; line-height: 1.55; color: #3A3A3A; }
.how section { padding: 0 0 72px; }
.how h1, .how h2, .how h3, .how p, .how blockquote, .how figure, .how dl, .how dd, .how ol { margin: 0; }
.how h2 { font-weight: 700; font-size: 29px; line-height: 1.12; letter-spacing: -0.01em; }
.how .muted { color: #5E5E5A; }
.how-narrow { max-width: 34em; display: flex; flex-direction: column; gap: 10px; }

/* 1. opening */
.how .how-hero { display: flex; flex-direction: column; gap: 24px; padding: 32px 0 64px; }
.how-hero-text { display: flex; flex-direction: column; gap: 18px; }
.how-hero h1 { font-weight: 700; font-size: 42px; line-height: 1.04; letter-spacing: -0.02em; }
.how-lede { font-size: 19px; color: #5E5E5A; max-width: 30em; }
.how-hero .btn-primary { align-self: stretch; }
.how-hero-art { display: flex; justify-content: center; }
.how-hero-art svg { width: 100%; max-width: 300px; height: auto; }

/* 2. the resident file: the only card on the page */
.how-res { display: flex; flex-direction: column; gap: 24px; }
.how-res-text { display: flex; flex-direction: column; gap: 12px; }
.how-res-text p { max-width: 26em; }
.how-res-file { display: flex; flex-direction: column; gap: 24px; }
.how-card { background: #FDFCFA; border: 1px solid #E8E0D6; border-radius: 20px; padding: 20px; box-shadow: 0 10px 30px rgba(79,107,92,0.10);
  display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.how-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.how-card-head strong { font-size: 22px; }
.how-card-head span { color: #5E5E5A; font-size: 16px; }
.how-budget { display: flex; flex-direction: column; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 16px; line-height: 1.45; }
.how-budget > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
.how-budget dd { text-align: right; }
.how-budget .how-left { font-weight: 500; padding-top: 8px; border-top: 1px solid #D9CFC2; }
.how-pays { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; font-size: 16px; }
.how-pays h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.how-pays p { color: #5E5E5A; }
.how-voice { font-size: 16px; font-style: italic; color: #5E5E5A; }
.how-notes { display: flex; flex-direction: column; gap: 20px; font-size: 16px; color: #5E5E5A; }
.how-notes > div { padding-left: 14px; border-left: 2px solid #8FA99A; }
.how-notes strong { display: block; color: #3A3A3A; }

/* 3. her week: vertical on phones, a strip across on wide screens */
.how-week { display: flex; flex-direction: column; gap: 28px; }
.how-strip { list-style: none; padding: 0; display: flex; flex-direction: column; border-left: 2px solid #3A3A3A; }
.how-strip li { position: relative; padding: 0 0 22px 20px; display: flex; flex-direction: column; gap: 4px; }
.how-strip li:last-child { padding-bottom: 0; }
.how-strip li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #3A3A3A; }
.how-strip li.is-missed::before { background: #F7F4EF; box-shadow: inset 0 0 0 2px #9A9A94; }
.how-tag { font-size: 14px; font-weight: 700; color: #4F6B5C; }
.how-what { font-weight: 700; font-size: 20px; line-height: 1.25; }
.how-why { font-size: 16px; color: #5E5E5A; }
.how-strip .is-missed .how-tag, .how-strip .is-missed .how-what, .how-strip .is-missed .how-why { color: #6F6F6A; }
.how-what s { text-decoration-thickness: 1.5px; }

/* 4. the question and three answers, as ballot slips of uneven size */
.how-ask { display: flex; flex-direction: column; gap: 28px; }
.how-ask-head { display: flex; flex-direction: column; gap: 14px; }
.how-q { font-size: 23px; line-height: 1.3; max-width: 26em; }
.how-trip { display: block; width: 100%; max-width: 640px; height: auto; overflow: visible; }
.how-road { stroke: #D9CFC2; stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; fill: none; }
.how-dot { fill: #4F6B5C; opacity: 0; }
.how-win { fill: #E3B95A; }
.how-glow { fill: #F2D58A; opacity: 0.55; }
.how-slips { display: flex; flex-direction: column; gap: 32px; }
.how-slip { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.how-vote { font-weight: 700; line-height: 1; }
.how-slip1 .how-vote { font-size: 44px; color: #4F6B5C; }
.how-slip1 blockquote { font-size: 21px; line-height: 1.35; }
.how-slip2 .how-vote { font-size: 34px; }
.how-slip2 blockquote { font-size: 19px; line-height: 1.4; }
.how-slip3 .how-vote { font-size: 26px; color: #6F6F6A; }
.how-slip3 blockquote { font-size: 17px; line-height: 1.4; color: #5E5E5A; }
.how-slip figcaption { font-size: 16px; color: #5E5E5A; }

/* the one motion: the question travels to the houses, which light up one after another */
.how-trip.is-waiting .how-win { fill: #D9CFC2; }
.how-trip.is-waiting .how-glow { opacity: 0; }
.how-trip.is-going .how-dot { animation: how-travel 1.6s cubic-bezier(.45,.05,.4,1) forwards; }
.how-trip.is-going .how-win { fill: #E3B95A; transition: fill .35s ease; }
.how-trip.is-going .how-glow { opacity: 0.55; transition: opacity .5s ease; }
.how-trip .how-h1 * { transition-delay: .25s !important; } .how-trip .how-h2 * { transition-delay: .45s !important; }
.how-trip .how-h3 * { transition-delay: .65s !important; } .how-trip .how-h4 * { transition-delay: .85s !important; }
.how-trip .how-h5 * { transition-delay: 1.05s !important; } .how-trip .how-h6 * { transition-delay: 1.25s !important; }
.how-trip .how-h0 * { transition-delay: .05s !important; }
@keyframes how-travel { 0% { opacity: 1; transform: translateX(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(576px); } }
@media (prefers-reduced-motion: reduce) {
  .how-trip .how-dot { animation: none !important; opacity: 0 !important; }
  .how-trip .how-win, .how-trip .how-glow { transition: none !important; }
}

/* 5. accuracy */
.how-acc { display: flex; flex-direction: column; gap: 24px; }
.how-acc-text { display: flex; flex-direction: column; gap: 12px; }
.how-acc-text p { max-width: 28em; }
.how-acc-chart { display: flex; flex-direction: column; gap: 18px; }
.how-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 16px; }
.how-legend span { display: inline-flex; align-items: center; gap: 8px; }
.how-k { width: 14px; height: 14px; border-radius: 50%; flex: none; box-sizing: border-box; }
.how-k-real { background: #3A3A3A; }
.how-k-town { border: 3px solid #4F6B5C; }
.how-k-miss { border: 3px solid #D4A088; }
.how-empty { display: flex; flex-direction: column; gap: 12px; padding: 22px 0; border-top: 1px solid #D9CFC2; border-bottom: 1px solid #D9CFC2; }
.how-empty strong { font-size: 22px; line-height: 1.25; }
.how-empty p { max-width: 30em; }

/* 6. what it is not, 7. the one button */
.how .how-not { padding-bottom: 56px; }
.how-not p { font-weight: 700; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; max-width: 22em; }
.how .how-end { display: flex; flex-direction: column; gap: 14px; padding-bottom: 72px; }
.how-end .btn-primary { align-self: stretch; }

@media (min-width: 560px) {
  .how-hero .btn-primary, .how-end .btn-primary { align-self: flex-start; }
  .how-pays { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .how-card { padding: 28px; }
}

@media (min-width: 760px) {
  .how { padding: 0 32px; }
  .how section { padding-bottom: 112px; }
  .how h2 { font-size: 36px; line-height: 1.1; }
  .how .how-hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 48px; padding: 88px 0 96px; }
  .how-hero-text { flex: 1.4 1 420px; min-width: 0; gap: 22px; }
  .how-hero h1 { font-size: 64px; line-height: 1.02; }
  .how-lede { font-size: 21px; }
  .how-hero-art { flex: 1 1 320px; min-width: 0; }
  .how-hero-art svg { max-width: 420px; }
  .how-res { flex-direction: row; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
  .how-res-text { flex: 1 1 280px; min-width: 0; gap: 14px; padding-top: 12px; }
  .how-res-file { flex: 2.2 1 560px; min-width: 0; flex-direction: row; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
  .how-card { flex: 3 1 380px; }
  .how-budget { font-size: 15px; }
  .how-notes { flex: 1 1 180px; min-width: 0; gap: 26px; padding-top: 30px; font-size: 15px; }
  .how-week { gap: 36px; }
  .how-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border-left: 0; border-top: 2px solid #3A3A3A; }
  .how-strip li { padding: 18px 20px 0 0; gap: 6px; }
  .how-strip li::before { display: none; }
  .how-strip li:last-child { padding-right: 0; }
  .how-ask { gap: 40px; }
  .how-ask-head { gap: 16px; }
  .how-q { font-size: 28px; }
  .how-slips { flex-direction: row; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; }
  .how-slip1 { flex: 5 1 340px; }
  .how-slip2 { flex: 4 1 260px; padding-top: 28px; }
  .how-slip3 { flex: 3 1 200px; padding-top: 64px; }
  .how-slip1 .how-vote { font-size: 56px; }
  .how-slip1 blockquote { font-size: 22px; }
  .how-slip2 .how-vote { font-size: 40px; }
  .how-slip3 .how-vote { font-size: 28px; }
  .how-slip figcaption { font-size: 15px; }
  .how-acc { flex-direction: row; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
  .how-acc-text { flex: 1 1 320px; min-width: 0; }
  .how-acc-chart { flex: 1.4 1 420px; min-width: 0; padding-top: 8px; }
  .how-legend { font-size: 15px; }
  .how .how-not { padding-bottom: 96px; }
  .how-not p { font-size: 44px; line-height: 1.15; }
  .how .how-end { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-bottom: 112px; }
}
