/* Homepage only — Direction C, thread narrative.
   Loaded from index.html. Interior pages do not load this file.
   The ink spine is the chapter structure: one line, beat nodes, a branch
   into the sample. Scroll draws the line. prefers-reduced-motion shows it whole. */

body[data-page="home"] {
  background: var(--bg);
}

body[data-page="home"] .header-inner {
  min-height: 64px;
  padding-top: 0;
  padding-bottom: 0;
}

body[data-page="home"] .brand {
  font-size: 1.2rem;
}

body[data-page="home"] .site-nav > a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

body[data-page="home"] .site-nav > a:hover {
  color: var(--accent);
}

body[data-page="home"] .nav-read {
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-cta);
  padding: 0.45rem 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.01em;
}

body[data-page="home"] .nav-read:hover {
  color: var(--accent-ink);
  background: #183c2e;
}

body[data-page="home"] .kicker {
  letter-spacing: 0.14em;
  font-size: 0.6875rem;
}

/* ---- story column + spine ---- */

.narrative {
  --spine-x: 4.65rem;
  --spine-gap: 2.85rem;
  --node-size: 14px;
  --beat-pad: 4.35rem;
  position: relative;
  width: min(68rem, 100%);
  margin: 0 auto;
}

.beat {
  --draw: 1;
  position: relative;
  padding: var(--beat-pad) 2.25rem 3.15rem calc(var(--spine-x) + var(--spine-gap));
}

.js .beat { --draw: 0; }

@media (prefers-reduced-motion: reduce) {
  .js .beat { --draw: 1; }
}

.beat-inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
}

.beat h1,
.beat h2 {
  font-weight: 500;
  text-wrap: balance;
}

.beat h2 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  max-width: 18em;
  margin-bottom: 0.85rem;
}

.beat .lede {
  color: var(--muted);
  max-width: 38em;
}

.rail {
  position: absolute;
  z-index: 2;
  left: var(--spine-x);
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(26, 24, 20, 0.4);
  pointer-events: none;
}

.rail-draw {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleY(var(--draw));
  transform-origin: top center;
}

.node {
  position: absolute;
  z-index: 3;
  left: calc(var(--spine-x) + 1px);
  top: calc(var(--beat-pad) + 0.12rem);
  width: var(--node-size);
  height: var(--node-size);
  box-sizing: border-box;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
  transform: translateX(-50%);
  pointer-events: none;
}

.node-start,
.node-end {
  background: var(--ink);
}

.node-climax {
  background: var(--accent);
  border-color: var(--accent);
}

.beat-problem .rail {
  top: calc(var(--beat-pad) + 0.12rem + var(--node-size) / 2);
}

.beat-close .rail {
  bottom: 2.6rem;
}

.beat-close::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: calc(var(--spine-x) + 1px);
  bottom: 2.6rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, 50%);
  pointer-events: none;
}

/* Mobile: thin rail, no wide gutter. Progress dots carry the jumps. */

.beat-progress {
  display: none;
}

/* ---- beat 01 ---- */

.beat-problem {
  --beat-pad: 3.6rem;
  padding-bottom: 3.4rem;
}

.beat-problem h1 {
  font-size: clamp(2.35rem, 4.7vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
  max-width: 11em;
  margin-bottom: 0.95rem;
}

.hold {
  margin: 0.35rem 0 1.35rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.hold strong { font-weight: 600; }

.pay-note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: var(--type-caption);
}

.problem-list {
  margin-top: 2.1rem;
}

.problem-list article {
  margin: 0;
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule);
}

.problem-list article:last-child {
  border-bottom: 1px solid var(--rule);
}

.beat .problem-list h2 {
  font-size: 1.28rem;
  font-weight: 500;
  max-width: none;
  margin-bottom: 0.35rem;
}

.problem-list p {
  margin: 0;
  max-width: 40em;
}

.beat .problem-emphasis h2 {
  font-weight: 600;
}

/* ---- beat 02 ---- */

.beat-mechanism {
  --beat-pad: 3.5rem;
  padding-bottom: 3.2rem;
}

.ink-pull {
  margin: 1.5rem 0 0;
  padding: 0.15rem 0 0.15rem 1.15rem;
  border-left: 3px solid var(--ink);
  max-width: 18em;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.mechanism-list {
  margin-top: 1.75rem;
}

.mechanism-list article {
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}

.mechanism-list article:last-child {
  border-bottom: 1px solid var(--rule);
}

.mechanism-list h3 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.mechanism-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---- beat 03 climax ---- */

.beat-sample {
  --beat-pad: 5.15rem;
  padding-top: var(--beat-pad);
  padding-bottom: 5.4rem;
  background: #EFEAE2;
  box-shadow: 0 0 0 100vmax #EFEAE2;
  clip-path: inset(0 -100vmax);
}

.beat-sample .node {
  background: var(--accent);
}

.beat-sample h2 {
  font-size: clamp(2.15rem, 4.2vw, 2.95rem);
  line-height: 1.08;
  max-width: 13em;
}

.beat-sample .beat-inner {
  max-width: 44rem;
}

.sample-panel {
  position: relative;
  max-width: 40rem;
  margin: 1.7rem 0 0;
  padding: 1.55rem 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid #cfc6b8;
  box-shadow: 0 18px 40px rgba(40, 30, 20, 0.1);
}

.sample-panel::before {
  content: "";
  position: absolute;
  top: 2.35rem;
  right: 100%;
  width: calc(var(--spine-gap) - 1px);
  height: 2px;
  background: var(--accent);
}

.sample-panel .plate-label {
  margin-bottom: 0.85rem;
}

.sample-panel .finding-title {
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  font-weight: 500;
  margin: 0.2rem 0 0.85rem;
}

.sample-panel .source blockquote {
  font-size: 1.08rem;
}

.sample-panel > p {
  font-size: 1rem;
}

.sample-cta {
  margin-top: 1.35rem;
}

/* ---- beat 04 ---- */

.beat-bind {
  --beat-pad: 3.7rem;
  padding-bottom: 3.5rem;
}

.beat-bind .beat-inner {
  max-width: none;
}

.bind {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 1.25rem 2.25rem;
  margin-top: 1.5rem;
  align-items: start;
}

.bind-lead h3 {
  font-size: clamp(1.55rem, 2.5vw, 1.9rem);
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.bind-lead p:last-child,
.bind-rest p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.bind-rest article {
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}

.bind-rest article:last-child {
  border-bottom: 1px solid var(--rule);
}

.bind-rest h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.read-steps {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  counter-reset: read;
  max-width: 40rem;
}

.read-steps li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.2rem 0.75rem;
  margin: 0;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: read;
}

.read-steps li::before {
  content: counter(read, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--muted);
}

.read-steps h3,
.read-steps p { grid-column: 2; }

.read-steps h3 {
  margin: 0 0 0.2rem;
  font-size: 1.12rem;
}

.read-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.chapter-note {
  max-width: 40rem;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: var(--type-caption);
}

/* ---- beat 05 knots ---- */

.beat-knots {
  --beat-pad: 4.6rem;
  padding-bottom: 4.8rem;
  background: #12110F;
  color: #F2EDE6;
  box-shadow: 0 0 0 100vmax #12110F;
  clip-path: inset(0 -100vmax);
}

.beat-knots .beat-inner {
  max-width: none;
}

.beat-knots .rail {
  background: rgba(242, 237, 230, 0.28);
}

.beat-knots .rail-draw {
  background: #F2EDE6;
}

.beat-knots .node {
  background: #12110F;
  border-color: #F2EDE6;
}

.beat-knots .kicker { color: #8f897f; }

.beat-knots h2 {
  color: #F7F4EF;
  max-width: 16em;
}

.beat-knots .lede {
  color: #b8b2a8;
  max-width: 38em;
}

.knot-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.85rem;
}

.knot-row::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: calc(1rem + 5.5px);
  left: 1.15rem;
  right: 1.15rem;
  height: 2px;
  background: rgba(242, 237, 230, 0.55);
  transform: translateY(-50%);
}

.knot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
  padding: 1rem 0.95rem 1.05rem;
  border: 1px solid #2e2c28;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.knot::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  margin-bottom: 0.8rem;
  box-sizing: border-box;
  border: 2px solid #F2EDE6;
  border-radius: 50%;
  background: #12110F;
}

.knot:hover {
  color: inherit;
  border-color: #8a847c;
}

.knot .g-type {
  margin: 0 0 0.45rem;
  color: #8f897f;
  letter-spacing: 0.12em;
}

.knot h3 {
  margin: 0 0 0.4rem;
  color: #F7F4EF;
  font-size: 1.2rem;
  font-weight: 500;
}

.knot p {
  margin: 0;
  color: #b7b1a7;
  font-size: 0.92rem;
  line-height: 1.45;
}

.knot .more {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #F2EDE6;
  border-bottom: 1px solid rgba(242, 237, 230, 0.45);
}

.knot:hover .more { border-bottom-color: #fff; }
.knot:hover h3 { color: #fff; }

/* ---- fit ---- */

.beat-fit {
  --beat-pad: 3.35rem;
  padding-bottom: 3.35rem;
}

.beat-fit .beat-inner {
  max-width: none;
}

.fit-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2.75rem;
}

.fit-split h2 {
  font-size: 1.7rem;
  margin-bottom: 0.7rem;
}

.fit-split ul {
  margin: 0;
  padding-left: 1.15em;
  max-width: 34em;
}

.fit-split li { margin: 0 0 0.55rem; }
.fit-split li:last-child { margin-bottom: 0; }

/* ---- commission ---- */

.beat-price {
  --beat-pad: 4.15rem;
  padding-bottom: 3.6rem;
}

body[data-page="home"] .price-figure {
  font-size: clamp(3.15rem, 7vw, 4.6rem);
  margin: 0.15rem 0 0.55rem;
}

.commission-block {
  margin-top: 2.4rem;
}

.commission-list {
  margin: 0.4rem 0 1.4rem;
}

.commission-list article {
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}

.commission-list article:last-child {
  border-bottom: 1px solid var(--rule);
}

.commission-list h3 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.commission-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---- questions + close ---- */

.beat-faq {
  --beat-pad: 3rem;
  padding-bottom: 2.4rem;
}

.beat-close {
  --beat-pad: 3.4rem;
  padding-bottom: 5.4rem;
}

.beat-close .micro-proof {
  margin: 0 0 1.25rem;
  color: var(--ink);
  font-size: 0.98rem;
}

/* ---- escapes ---- */

body[data-page="home"] .sticky-cta {
  align-items: center;
  gap: 0.35rem 0.75rem;
}

body[data-page="home"] .sticky-secondary {
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}

body[data-page="home"] .sticky-secondary:hover {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .narrative {
    --spine-x: 2.4rem;
    --spine-gap: 1.7rem;
  }

  .knot-row {
    grid-template-columns: 1fr 1fr;
  }

  .knot-row::before { display: none; }
}

@media (max-width: 800px) {
  .bind,
  .fit-split {
    grid-template-columns: 1fr;
  }

  .bind-rest { margin-top: 0.25rem; }

  html:has(body[data-page="home"]) {
    scroll-padding-top: 110px;
  }

  .beat-progress {
    display: flex;
    position: sticky;
    top: 65px;
    z-index: 18;
    background: rgba(247, 244, 239, 0.96);
    border-bottom: 1px solid var(--rule);
  }

  .beat-progress a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  .beat-progress a[aria-current="true"] {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--ink);
  }
}

@media (max-width: 720px) {
  .narrative {
    --spine-x: 0.7rem;
    --spine-gap: 0.95rem;
    --node-size: 10px;
    width: 100%;
  }

  .beat {
    --beat-pad: 2.55rem;
    padding-right: 1rem;
    padding-bottom: 2.3rem;
  }

  .beat-problem { --beat-pad: 2.15rem; }
  .beat-sample {
    --beat-pad: 2.7rem;
    padding-bottom: 2.8rem;
  }
  .beat-knots { padding-bottom: 2.7rem; }
  .beat-close { padding-bottom: 4.2rem; }

  .beat-close .rail { bottom: 1.8rem; }
  .beat-close::after { bottom: 1.8rem; }

  .knot-row { grid-template-columns: 1fr; }

  .sample-panel { box-shadow: 0 10px 24px rgba(40, 30, 20, 0.08); }
}

@media (max-width: 800px) {
  .beat-close .cta-row,
  .beat-price .cta-row,
  .beat-sample .cta-row,
  .beat-problem .cta-row {
    width: min(100%, 22rem);
  }

  body[data-page="home"] .sticky-cta:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  body[data-page="home"] .sticky-secondary {
    text-align: center;
    padding: 0.1rem 0 0.15rem;
  }

  body[data-page="home"]:has(.sticky-cta:not([hidden])) {
    padding-bottom: 7.1rem;
  }
}

@media print {
  .beat { --draw: 1; }
  .rail-draw { transform: none; }
  .beat-progress,
  body[data-page="home"] .sticky-cta { display: none !important; }
  .beat-sample,
  .beat-knots {
    box-shadow: none;
    clip-path: none;
  }
}
