/* Blue Horizon — free-work pages: per-lead chapters (/for/<slug>) and niche libraries (/library/<niche>).
   Loaded after styles.css and reuses its tokens. Light paper only, like the rest of the site. */

/* components below set display, which would beat the hidden attribute JS toggles */
[hidden] { display: none !important; }

.fw-card { padding: var(--card-pad); border-radius: var(--card-r); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 480px) { .fw-card { --card-r: 32px; --card-pad: 20px; --card-inner-r: 12px; } }
.fw-h2 { font-size: var(--t-xl); letter-spacing: var(--track-heading); line-height: 1.15; }
.fw-muted { color: var(--muted); }
.fw-thumb { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: var(--card-inner-r); overflow: hidden; background: var(--night-2); }
.fw-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 800ms var(--ease-out); }
.fw-thumb:hover img { transform: scale(1.03); }

/* ---------- /for/<slug>: a short story in 4 steps ---------- */
.fw-for { max-width: 920px; padding-top: clamp(110px, 16vh, 160px); padding-bottom: var(--s10); min-height: calc(100svh - 72px); }
.fw-h1 { font-size: var(--t-2xl); line-height: 1.02; letter-spacing: var(--track-title); max-width: 15em; }
.fw-lede { font-size: var(--t-lg); line-height: 1.45; color: var(--muted); margin-top: var(--s4); max-width: 36em; }
.fw-h2x { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.04; letter-spacing: var(--track-title); max-width: 16em; }
.fw-h3 { font-size: var(--t-lg); letter-spacing: var(--track-heading); line-height: 1.25; }

.fw-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.fw-progress span { display: block; height: 100%; background: var(--blue); transform: scaleX(0); transform-origin: 0 50%; }

.fw-stats { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); font-size: var(--t-sm); }
.fw-stats span { padding: 8px 14px; border-radius: var(--pill); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.fw-stats b { font-weight: 600; }

.fw-map { margin-top: var(--s7); }
.fw-map h2 { font-size: var(--t-xs); font-weight: 500; letter-spacing: var(--track-small); color: var(--muted); margin-bottom: var(--s3); }
.fw-map ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); counter-reset: m; }
@media (min-width: 760px) { .fw-map ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fw-map li { counter-increment: m; }
.fw-map a { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--s3); align-items: center; min-height: 64px; padding: var(--s3) var(--s4); border-radius: var(--r3); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: transform var(--spring-dur) var(--spring), background-color var(--fast) var(--ease-out); }
.fw-map a::before { content: counter(m); grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: var(--t-xs); font-weight: 500; }
.fw-map a:hover { background: #fff; transform: translateY(-2px); }
.fw-map b { font-weight: 500; font-size: var(--t-sm); }
.fw-map span { font-size: var(--t-xs); color: var(--muted); line-height: 1.35; }

.fw-step { margin-top: var(--s9); padding-top: var(--s8); border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.fw-next { display: inline-flex; align-items: center; gap: var(--s2); margin-top: var(--s7); font-size: var(--t-sm); font-weight: 500; color: var(--blue-ink); text-decoration: none; }
.fw-next svg { width: 16px; height: 16px; flex: none; transition: transform var(--spring-dur) var(--spring); }
.fw-next:hover { text-decoration: underline; }
.fw-next:hover svg { transform: translateY(3px); }

/* step 1: video cards */
.fw-videos { display: grid; gap: var(--s5); margin-top: var(--s7); }
.fw-video { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 760px) { .fw-video { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s6); } }
.fw-video .fw-h3 a { text-decoration: none; }
.fw-video .fw-h3 a:hover { text-decoration: underline; }
.fw-meta { margin-top: var(--s2); font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.fw-chapters { list-style: none; margin: var(--s5) 0 0; padding: 0; border-top: 1px solid var(--line); }
.fw-chapters a { display: flex; align-items: center; gap: var(--s4); min-height: 44px; padding: var(--s2) 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: var(--t-sm); line-height: 1.35; }
.fw-chapters a:hover span:last-child { text-decoration: underline; }
.fw-ts { flex: none; min-width: 4.2em; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--blue-ink); }
.fw-copy { margin-top: var(--s5); }
.fw-copy .btn svg { width: 16px; height: 16px; }
.fw-copy .btn.is-done { background: var(--ink); color: var(--paper); box-shadow: none; }

/* step 2: add + quick wins */
.fw-add { margin-top: var(--s7); }
.fw-num { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s3); counter-reset: s; }
.fw-num li { counter-increment: s; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--s3); align-items: baseline; }
.fw-num li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: var(--t-xs); font-weight: 500; transform: translateY(-1px); }
.fw-note { margin-top: var(--s5); font-size: var(--t-sm); color: var(--muted); max-width: 40em; }
.fw-wins-title { margin-top: var(--s8); }
.fw-wins { display: grid; gap: var(--s4); margin-top: var(--s4); }
@media (min-width: 860px) { .fw-wins { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fw-win { display: grid; gap: var(--s3); align-content: start; }
.fw-win-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--ink); font-size: var(--t-sm); font-weight: 500; }
.fw-win h4 { margin: 0; font-size: var(--t-md); font-weight: 600; letter-spacing: var(--track-body); line-height: 1.3; }
.fw-win p { font-size: var(--t-sm); color: var(--muted); }
.fw-win .fw-example { color: var(--ink); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* step 3: short ideas from their own chapters */
.fw-ideas { list-style: none; margin: var(--s7) 0 0; padding: 0; display: grid; gap: var(--s4); }
@media (min-width: 700px) { .fw-ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fw-idea { display: grid; gap: var(--s3); align-content: start; background: var(--night); color: var(--on-night); box-shadow: none; }
.fw-idea .fw-h3 { font-size: var(--t-xl); line-height: 1.15; }
.fw-idea-tag { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-xs); letter-spacing: var(--track-small); color: var(--on-night-muted); }
.fw-idea-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ice); }
.fw-idea-from { font-size: var(--t-sm); color: var(--on-night-muted); }
.fw-idea-from a { text-decoration: none; }
.fw-idea-from a:hover { text-decoration: underline; }
.fw-idea .fw-ts { color: var(--ice); min-width: 0; }
.fw-idea :focus-visible { outline-color: var(--ice); }
.fw-lib { margin-top: var(--s7); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s5); }
.fw-lib > div { max-width: 32em; }
.fw-lib .eyebrow { margin-bottom: var(--s3); }
.fw-lib .fw-muted { margin-top: var(--s2); font-size: var(--t-sm); }

/* step 4: the soft offer (shared with /library) */
.fw-does { list-style: none; margin: var(--s7) 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.fw-does li { padding: var(--s4) 0 var(--s4) 36px; border-bottom: 1px solid var(--line); position: relative; font-size: var(--t-md); color: var(--muted); }
.fw-does li::before { content: ""; position: absolute; left: 4px; top: calc(var(--s4) + 0.45em); width: 14px; height: 8px; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); }
.fw-does b { color: var(--ink); font-weight: 500; }
.fw-proof { margin: var(--s7) 0 0; padding-left: var(--s5); border-left: 3px solid var(--blue); }
.fw-proof blockquote { margin: 0; }
.fw-proof blockquote p { font-size: var(--t-lg); line-height: 1.45; max-width: 34em; }
.fw-proof .who { margin-top: var(--s4); }
.fw-proof .link-arrow { margin-top: var(--s4); font-size: var(--t-sm); }
.fw-close { margin-top: var(--s8); padding: var(--card-pad); border-radius: var(--r3); display: grid; gap: var(--s3); justify-items: start; }
.fw-close-big { font-size: var(--t-xl); font-weight: 600; letter-spacing: var(--track-heading); line-height: 1.15; }
.fw-close p:not(.fw-close-big) { color: var(--on-night-muted); max-width: 34em; }
.fw-close .btn { margin-top: var(--s3); }
.fw-close .vsl-from { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--night-line); width: 100%; }
.fw-close .vsl-from span { color: var(--on-night-muted); }
.fw-close :focus-visible { outline-color: var(--ice); }

.fw-gone .btn { margin-top: var(--s6); }

/* ---------- /library/<niche> ---------- */
.fw-libpage { padding-top: clamp(110px, 16vh, 160px); padding-bottom: var(--s10); }
.fw-libpage h1 { font-size: var(--t-2xl); line-height: 1.02; letter-spacing: var(--track-title); max-width: 16em; }
.fw-libpage .fw-sub { font-size: var(--t-lg); color: var(--muted); margin-top: var(--s4); max-width: 40em; }
.fw-how { margin-top: var(--s7); max-width: 46rem; }
.fw-how ol { margin: var(--s3) 0 0; padding-left: 1.2em; display: grid; gap: var(--s2); color: var(--muted); }
.fw-how .fw-h2 { font-size: var(--t-lg); }

.fw-filters { margin-top: var(--s8); display: grid; gap: var(--s5); }
.fw-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.fw-group legend, .fw-sort label { padding: 0; margin-bottom: var(--s2); font-size: var(--t-xs); letter-spacing: var(--track-small); color: var(--muted); }
.fw-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
/* phones: one swipeable row per group instead of four rows of chips */
@media (max-width: 640px) {
  .fw-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; }
  .fw-chips::-webkit-scrollbar { display: none; }
}
.fw-chip { flex: none; min-height: 40px; padding: 0 var(--s4); border-radius: var(--pill); border: 0; cursor: pointer; font: 500 var(--t-sm)/1 var(--font); color: var(--ink); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); transition: transform var(--spring-dur) var(--spring), background-color var(--fast) var(--ease-out), color var(--fast) var(--ease-out); }
.fw-chip:hover { background: #fff; }
.fw-chip:active { transform: scale(0.96); transition-duration: var(--press-dur), var(--fast), var(--fast); }
.fw-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
@media (prefers-contrast: more) { .fw-chip { box-shadow: inset 0 0 0 1.5px var(--ink); } }
.fw-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s4); }
.fw-sort { display: grid; }
.fw-sort select { min-height: 40px; padding: 0 36px 0 var(--s4); border-radius: var(--pill); border: 0; font: 500 var(--t-sm)/1 var(--font); color: var(--ink); background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0d14' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 14px; box-shadow: inset 0 0 0 1px var(--line); appearance: none; -webkit-appearance: none; cursor: pointer; }
.fw-count { margin-top: var(--s6); font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

.fw-grid { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s4); }
@media (min-width: 640px) { .fw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .fw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .fw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fw-item { display: flex; flex-direction: column; gap: var(--s3); padding: 12px; border-radius: var(--r3); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.fw-item .fw-thumb { border-radius: var(--r2); }
.fw-badge { position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: var(--pill); background: rgba(5, 11, 24, 0.82); color: #fff; font-size: 12px; font-weight: 500; }
.fw-item-body { display: grid; gap: var(--s2); padding: 0 6px 6px; }
.fw-x { font-size: var(--t-lg); font-weight: 600; letter-spacing: var(--track-heading); font-variant-numeric: tabular-nums; }
.fw-x span { font-size: var(--t-sm); font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.fw-item h2 { font-size: var(--t-md); font-weight: 500; letter-spacing: var(--track-body); line-height: 1.35; }
.fw-item h2 a { text-decoration: none; }
.fw-item h2 a:hover { text-decoration: underline; }
.fw-by { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.fw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s1); }
.fw-tags span { padding: 4px 10px; border-radius: var(--pill); font-size: 12px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.fw-empty { margin-top: var(--s5); color: var(--muted); }
.fw-libpage .fw-sub + .fw-next { margin-top: var(--s5); }
.fw-libpage .fw-how { margin-top: var(--s9); scroll-margin-top: 96px; }
.fw-hand { max-width: 920px; }
.fw-more { margin-top: var(--s6); }

/* Vince's personal video in the hero (only when the lead's JSON has "video") */
.fw-vid { margin: var(--s7) 0 0; max-width: 760px; }
.fw-vid-frame { aspect-ratio: 16 / 9; border-radius: var(--card-inner-r, 16px); overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px var(--line); }
.fw-vid-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.fw-vid figcaption { margin-top: var(--s2); font-size: var(--t-sm); color: var(--muted); }

/* Niche library shown inside a lead page */
.fw-inlinelib { margin-top: var(--s9); scroll-margin-top: 96px; }
.fw-inlinelib .fw-how { margin-top: var(--s7); }
.fw-inlinelib .fw-how ol { margin: var(--s3) 0 0; padding-left: 1.2em; display: grid; gap: var(--s2); }
@media (min-width: 760px) { .fw-map-5 li:first-child { grid-column: 1 / -1; } }
.fw-step > .fw-inlinelib { margin-top: 0; }
