/* Playbook pages: the same night as the home page, set for reading. Black, white Switzer, hairlines, one cold light. No boxes. */
@font-face { font-family: "Switzer"; src: url(/assets/fonts/switzer-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url(/assets/fonts/switzer-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url(/assets/fonts/switzer-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Switzer"; src: url(/assets/fonts/switzer-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #01030a; --ink: #f3f5f8; --soft: rgba(243, 245, 248, .76); --mute: rgba(243, 245, 248, .52);
  --line: rgba(255, 255, 255, .14); --line-2: rgba(255, 255, 255, .3);
  --bulb: #f4f7ff; --red: #ff4a5e; --cyan: #7fe6f2; --cobalt: #03368c;
  --pad-l: max(clamp(18px, 4.4vw, 72px), env(safe-area-inset-left, 0px));
  --pad-r: max(clamp(18px, 4.4vw, 72px), env(safe-area-inset-right, 0px));
  --col: 720px; --wide: 1080px;
  --font: "Switzer", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 400;
  font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* one faint cobalt light at the top of the page, nothing else */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 70vh; pointer-events: none; z-index: -1;
  background: radial-gradient(80% 60% at 50% 0%, rgba(3, 54, 140, .22), rgba(1, 3, 10, 0) 70%);
}
::selection { background: var(--ink); color: #000; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
p, li, td, th { text-wrap: pretty; }

/* nav */
.pb-nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--pad-r) 14px var(--pad-l);
  background: rgba(1, 3, 10, .92); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%); backdrop-filter: saturate(140%);
}
.pb-nav a { text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.pb-nav .pb-home { font-weight: 700; letter-spacing: -0.02em; }
.pb-nav nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.pb-nav nav a { color: var(--soft); font-weight: 500; transition: color .3s; }
.pb-nav nav a:hover { color: var(--ink); }

main { padding: 0 var(--pad-r) 0 var(--pad-l); }
.col { max-width: var(--wide); margin: 0 auto; }
/* reading measure stays narrow, aligned with the title; tables may run wider */
.col section > :not(.tw), .col section > .tw.fit { max-width: var(--col); }
.col section > .tw { max-width: 900px; }
.wide { max-width: var(--wide); margin: 0 auto; }

/* head */
.pb-hero { max-width: var(--wide); margin: 0 auto; padding: clamp(72px, 14vh, 150px) 0 clamp(40px, 7vh, 72px); }
.pb-kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 clamp(22px, 4vh, 36px); font-size: 16px; font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }
.pb-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--bulb); flex: none; }
.pb-kicker i.r { background: var(--red); } .pb-kicker i.c { background: var(--cyan); }
h1 { margin: 0; font-size: clamp(46px, 8.4vw, 132px); font-weight: 700; letter-spacing: -0.045em; line-height: .96; text-wrap: balance; }
.pb-promise { margin: clamp(22px, 4vh, 36px) 0 0; max-width: 34ch; font-size: clamp(21px, 2.3vw, 34px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; color: var(--soft); text-wrap: pretty; }
.pb-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: clamp(28px, 5vh, 48px); padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; color: var(--mute); }
.pb-meta b { color: var(--soft); font-weight: 600; }

/* sections */
section { padding: clamp(48px, 9vh, 96px) 0; border-top: 1px solid var(--line); }
section.flush { border-top: 0; padding-top: 0; }
.sec-n { display: block; margin-bottom: 14px; font-size: 16px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
h2 { margin: 0 0 clamp(18px, 3vh, 28px); font-size: clamp(32px, 4.4vw, 60px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; }
h3 { margin: 40px 0 10px; font-size: clamp(21px, 2vw, 26px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0 0 18px; color: var(--soft); }
p strong, li strong, td strong { color: var(--ink); font-weight: 600; }
.lede { font-size: clamp(20px, 1.9vw, 24px); line-height: 1.45; color: var(--ink); font-weight: 500; letter-spacing: -0.012em; }

/* the short version: a numbered list set large */
ol.rules { list-style: none; counter-reset: r; margin: 0; padding: 0; }
ol.rules > li { counter-increment: r; display: grid; grid-template-columns: 56px 1fr; gap: 0 12px; padding: 20px 0; border-top: 1px solid var(--line); font-size: clamp(19px, 1.7vw, 23px); line-height: 1.4; color: var(--ink); font-weight: 500; letter-spacing: -0.012em; }
ol.rules > li:last-child { border-bottom: 1px solid var(--line); }
ol.rules > li::before { content: counter(r, decimal-leading-zero); font-size: 16px; font-weight: 600; color: var(--mute); padding-top: .25em; font-variant-numeric: tabular-nums; }
ol.rules > li span { display: block; margin-top: 6px; font-size: 17px; font-weight: 400; color: var(--soft); letter-spacing: 0; }

ul.plain, ol.steps { margin: 0 0 22px; padding: 0 0 0 1.2em; color: var(--soft); }
ul.plain li, ol.steps li { margin: 0 0 10px; padding-left: 4px; }
ol.steps li::marker { color: var(--mute); font-weight: 600; font-variant-numeric: tabular-nums; }
ul.plain li::marker { color: var(--mute); }

/* the line worth quoting: large, a hairline on the left, nothing else */
.kill { margin: 36px 0; padding: 4px 0 4px clamp(18px, 2.4vw, 28px); border-left: 1px solid var(--line-2); font-size: clamp(23px, 2.6vw, 34px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.22; color: var(--ink); text-wrap: balance; }

/* tables: hairlines only */
.tw { margin: 26px 0 30px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
th { text-align: left; font-weight: 600; color: var(--ink); padding: 0 16px 12px 0; border-bottom: 1px solid var(--line-2); vertical-align: bottom; }
td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); color: var(--soft); vertical-align: top; }
td:first-child { color: var(--ink); font-weight: 600; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* templates you can copy */
.tpl { position: relative; margin: 22px 0 30px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.tpl pre { margin: 0; padding: 22px 0 24px; white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--ink); }
.tpl .tpl-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; font-size: 15px; font-weight: 600; color: var(--mute); }
button.copy { appearance: none; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 2px 0; color: var(--ink); font: 600 15px/1.3 var(--font); cursor: pointer; }
button.copy:hover { border-color: var(--ink); }

/* the tool */
.tool { padding: clamp(56px, 10vh, 110px) 0; border-top: 1px solid var(--line-2); }
.tool .wide > p { max-width: 62ch; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); margin-top: 36px; align-items: start; }
.fields { display: grid; gap: 0; }
.field { display: grid; grid-template-columns: 1fr minmax(96px, 150px); gap: 14px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--line); }
.field label { font-size: 16px; color: var(--soft); line-height: 1.35; }
.field label small { display: block; font-size: 14px; color: var(--mute); }
.field input, .field select {
  width: 100%; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-bottom: 1px solid var(--line-2);
  border-radius: 0; padding: 4px 0; color: var(--ink); font: 600 19px/1.3 var(--font); text-align: right; font-variant-numeric: tabular-nums;
}
.field select { text-align: left; text-align-last: right; cursor: pointer; }
.field select option { background: #01030a; color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--ink); }
.out { display: grid; gap: 0; }
.out-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.out-row span { font-size: 16px; color: var(--soft); }
.out-row b { font-size: clamp(26px, 2.6vw, 38px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.out-row.big b { font-size: clamp(38px, 4.6vw, 64px); }
.out-note { margin-top: 18px; font-size: 16px; color: var(--soft); line-height: 1.5; min-height: 3em; }
.out-note strong { color: var(--ink); }
.light { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bulb); margin-right: 10px; vertical-align: .12em; transition: background .5s; }
.light.r { background: var(--red); } .light.c { background: var(--cyan); }

/* score rows (scorecards) */
.score { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.score .sl { font-size: 16px; color: var(--ink); font-weight: 600; line-height: 1.3; }
.score .sl small { display: block; font-weight: 400; color: var(--mute); font-size: 14px; margin-top: 3px; }
.seg { display: inline-flex; gap: 18px; }
.seg label { position: relative; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--mute); padding: 4px 0; border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; white-space: nowrap; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg input:checked + span { color: var(--ink); }
.seg label:has(input:checked) { border-bottom-color: var(--ink); color: var(--ink); }
.seg label:has(input:focus-visible) { outline: 1px solid var(--ink); outline-offset: 3px; }

/* start this week */
ol.week { list-style: none; counter-reset: w; margin: 0; padding: 0; }
ol.week li { counter-increment: w; display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--soft); }
ol.week li::before { content: "Day " counter(w); font-size: 15px; font-weight: 600; color: var(--mute); padding-top: .15em; white-space: nowrap; }
ol.week li strong { color: var(--ink); }

/* end */
.pb-end { padding: clamp(72px, 14vh, 140px) 0 calc(clamp(56px, 10vh, 100px) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-2); }
.pb-end .ask { margin: 0; color: var(--ink); font-size: clamp(34px, 5.6vw, 84px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; text-wrap: balance; }
.pb-end .ask a { text-decoration: none; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 2px no-repeat; transition: background-size .7s cubic-bezier(.7, 0, .2, 1); }
.pb-end .ask a:hover { background-size: 100% 2px; }
.pb-end p.sub { margin-top: 20px; font-size: clamp(18px, 1.6vw, 22px); }
.pb-next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 32px; margin-top: clamp(56px, 10vh, 100px); padding-top: 20px; border-top: 1px solid var(--line); font-size: 16px; }
.pb-next a { text-decoration: none; color: var(--soft); transition: color .3s; }
.pb-next a:hover { color: var(--ink); }
.pb-next a b { display: block; color: var(--ink); font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.pb-foot { margin-top: 40px; font-size: 14px; color: var(--mute); }

/* index page */
.ix { list-style: none; margin: 0; padding: 0; }
.ix li { border-top: 1px solid var(--line); }
.ix li:last-child { border-bottom: 1px solid var(--line); }
.ix a { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.1fr) 28px; gap: 12px 28px; align-items: baseline; padding: clamp(24px, 4vh, 38px) 0; text-decoration: none; }
.ix .n { font-size: 16px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 12px; }
.ix .n i { width: 7px; height: 7px; border-radius: 50%; background: var(--bulb); }
.ix .n i.r { background: var(--red); } .ix .n i.c { background: var(--cyan); }
.ix .t { font-size: clamp(26px, 3vw, 44px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.ix .d { font-size: 17px; color: var(--soft); line-height: 1.45; }
.ix .g { font-size: 22px; font-weight: 600; transition: transform .6s cubic-bezier(.2, .9, .2, 1); }
.ix a:hover .g { transform: translate(3px, -3px); }

/* reveal: text eases up as it enters. Off when motion is reduced or JS is absent. */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity 1.1s cubic-bezier(.2, .7, .2, 1), transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

@media (max-width: 860px) {
  body { font-size: 17px; }
  .tool-grid { grid-template-columns: 1fr; }
  .ix a { grid-template-columns: 1fr 24px; }
  .ix .n { grid-column: 1 / -1; }
  .ix .d { grid-column: 1 / 2; }
  .ix .g { grid-row: 2; grid-column: 2; }
}
@media (max-width: 560px) {
  .pb-nav nav a.hide-s { display: none; }
  ol.rules > li { grid-template-columns: 40px 1fr; }
  ol.week li { grid-template-columns: 1fr; gap: 4px; }
  .field { grid-template-columns: 1fr 110px; }
  .score { grid-template-columns: 1fr; gap: 8px; }
  table { font-size: 15px; }
  .tw table { min-width: 520px; }
  .tw.fit table { min-width: 0; }
}

/* leak finder (gtm-engine): each step's rate is drawn on the row's own hairline with a tick at its reference; the reference rates fold away */
.lk-row { position: relative; }
.lk-row > span { color: var(--ink); font-weight: 600; line-height: 1.3; }
.lk-row > span small, .lk-refs summary small { display: block; margin-top: 3px; font-size: 14px; font-weight: 400; color: var(--mute); }
.lk-row > span small { padding-left: 17px; }
.lk-f, .lk-t { position: absolute; display: block; pointer-events: none; }
.lk-f { left: 0; bottom: -1px; height: 2px; width: 0; max-width: 100%; background: var(--ink); transition: width .6s cubic-bezier(.2, .7, .2, 1), background .5s; }
.lk-t { bottom: -5px; width: 1px; height: 9px; background: var(--soft); transition: left .6s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.lk-row.weak .lk-f { background: var(--red); }
.lk-verdict { margin-top: 22px; }
.lk-refs { border-bottom: 1px solid var(--line); }
.lk-refs summary { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 16px 0; cursor: pointer; list-style: none; font-size: 16px; line-height: 1.35; color: var(--soft); }
.lk-refs summary::-webkit-details-marker { display: none; }
.lk-refs summary::after { content: "Edit"; flex: none; padding: 2px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); font-size: 15px; font-weight: 600; }
.lk-refs[open] summary::after { content: "Hide"; }
.lk-refs summary:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.lk-refs .field:first-child { border-top: 1px solid var(--line); }
.lk-refs .field:last-child { border-bottom: 0; }

/* start this week, when the items are builds in order and not days */
ol.week.order li::before { content: "Step " counter(w); }

/* a table that keeps its desktop width and folds to the screen on a phone, with no sideways scroll */
@media (min-width: 561px) { .tw.fold td:first-child { white-space: nowrap; } }
@media (max-width: 560px) {
  .tw.fold table { min-width: 0; }
  .tw.fold th, .tw.fold td { padding-right: 12px; }
  .tw.fold th:last-child, .tw.fold td:last-child { padding-right: 0; }
}
