/* Justin Talks Wealth look: research\RULES_REFERENCE.md "Design rules". Fonts are local copies, nothing loads from other sites. */
@font-face { font-family: "Inter"; font-weight: 500; src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 700; src: url("assets/fonts/inter-latin-700-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 900; src: url("assets/fonts/inter-latin-900-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JBMono"; font-weight: 500; src: url("assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JBMono"; font-weight: 700; src: url("assets/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #0a0b0d; --panel: #131519; --rule: #24272e;
  --text: #f3f1ea; --muted: #8a8f98; --soft: #b9bcc2; --accent: #f5b83d;
  --sq: #1c1f25; --sq-line: #2c3038;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, sans-serif; font-weight: 500; font-size: 17px; line-height: 1.5;
}
.page { max-width: 600px; margin: 0 auto; padding: 22px 16px 48px; }
.mono { font-family: "JBMono", ui-monospace, monospace; font-weight: 700; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* identity */
.mark, .brand { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 12px "JBMono", monospace; letter-spacing: .16em; color: var(--text); }
.sq { width: 10px; height: 10px; background: var(--accent); flex: none; }
.mark { padding-bottom: 14px; margin-bottom: 26px; border-bottom: 1px solid var(--rule); }

.kicker { margin: 0 0 8px; font-family: "JBMono", monospace; font-weight: 700; font-size: 13px; letter-spacing: .12em; color: var(--accent); }
h1 { font-weight: 900; font-size: 46px; line-height: 1; letter-spacing: -.025em; }
.lead { margin: 14px 0 0; font-size: 18px; }
.private { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.step { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--rule); }
.step h2 { font-weight: 900; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--accent); color: var(--accent);
  font-family: "JBMono", monospace; font-size: 14px; font-weight: 700; }
.hint { margin: 10px 0 0; color: var(--soft); font-size: 15px; }
.hint.small { font-size: 14px; color: var(--muted); }
.hint b { color: var(--text); }

.ages { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ages button {
  min-height: 52px; padding: 6px 4px; background: var(--panel); color: var(--text); border: 1px solid var(--rule);
  font: 700 16px/1.15 "Inter", sans-serif; cursor: pointer;
}
.ages button:hover { border-color: var(--muted); }
.ages button[aria-pressed="true"] { border-color: var(--accent); color: var(--bg); background: var(--accent); }

.nwrow { margin-top: 14px; display: flex; gap: 8px; }
.sign {
  flex: 0 0 56px; background: var(--panel); color: var(--text); border: 1px solid var(--rule);
  font: 700 26px/1 "JBMono", monospace; cursor: pointer;
}
.sign[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.money { display: flex; align-items: center; background: var(--panel); border: 1px solid var(--rule); min-width: 0; }
.money:focus-within { border-color: var(--accent); }
.money:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.money input:focus-visible { outline: 0; }
.money .dollar { padding-left: 12px; color: var(--muted); font-family: "JBMono", monospace; font-weight: 700; }
.money input {
  flex: 1; min-width: 0; width: 100%; padding: 12px 12px 12px 6px; background: transparent; border: 0; outline: 0;
  color: var(--text); font: 700 17px "JBMono", monospace;
}
.money.big { flex: 1; }
.money.big input, .money.big .dollar { font-size: 26px; }
.money.bad { border-color: var(--accent); }
.ferr { color: var(--accent); font-size: 14px; font-weight: 700; }
.ferr:empty { display: none; }

.whichage { margin-top: 6px; }
.whichage summary { padding: 6px 0; color: var(--accent); font-weight: 700; font-size: 15px; }
.whichage p { margin: 4px 0 0; color: var(--soft); font-size: 15px; }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+"; display: inline-block; width: 1.2em; font-family: "JBMono", monospace; }
details[open] > summary::before { content: "\2212"; }

.helper { margin-top: 18px; border: 1px solid var(--rule); background: var(--panel); }
.helper summary { padding: 14px 16px; font-weight: 700; color: var(--accent); }
.helper > :not(summary) { margin-left: 16px; margin-right: 16px; }
.cols { display: grid; gap: 18px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-weight: 900; font-size: 17px; margin-bottom: 8px; }
.field { display: grid; gap: 4px; margin-bottom: 10px; font-size: 15px; color: var(--soft); }
.field .money { background: var(--bg); }
.sum { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--rule); display: grid; gap: 4px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.sum b { overflow-wrap: anywhere; text-align: right; }
.sum .tot { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--rule); font-weight: 900; }
.sum .tot b { color: var(--accent); }
.ghost {
  margin: 14px 16px 16px; padding: 12px 16px; background: transparent; color: var(--accent); border: 1px solid var(--accent);
  font: 700 16px "Inter", sans-serif; cursor: pointer;
}

.go {
  display: block; width: 100%; margin-top: 26px; padding: 16px; background: var(--accent); color: var(--bg); border: 0;
  font: 900 19px "Inter", sans-serif; cursor: pointer; text-align: center; text-decoration: none;
}
.go:active { transform: translateY(1px); }
.go.small { display: inline-block; width: auto; margin: 0; padding: 12px 18px; font-size: 16px; }
.err { margin: 10px 0 0; color: var(--accent); font-weight: 700; }
.err:empty { display: none; }

/* result: one composition, read top to bottom */
.result { margin-top: 30px; padding-top: 20px; border-top: 2px solid var(--accent); }
.yours { margin: 0; color: var(--soft); font-size: 16px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.yours b { color: var(--text); font-size: 20px; overflow-wrap: anywhere; }
.rank { margin-top: 14px; overflow-wrap: break-word; font-weight: 900; font-size: clamp(34px, 11.5vw, 48px); line-height: 1; letter-spacing: -.025em; }
.of { margin: 8px 0 0; font-size: 20px; font-weight: 700; }
.cue { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.midline { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 17px; }
.midline b { white-space: nowrap; }
.extra { margin: 8px 0 0; color: var(--soft); font-size: 15px; }
.extra:empty { display: none; }

.gridwrap { margin: 22px 0 0; }
.you { position: relative; height: 38px; }
.you .br { position: absolute; bottom: 4px; height: 10px; border: 2px solid var(--accent); border-bottom: 0; }
.you .yl { position: absolute; bottom: 18px; transform: translateX(-50%); white-space: nowrap;
  font: 700 12px "JBMono", monospace; letter-spacing: .08em; color: var(--accent); }
.gridbox { position: relative; }
.grid { display: grid; grid-template-columns: repeat(20, 1fr); grid-template-rows: repeat(5, auto); grid-auto-flow: column; gap: 3px; }
.grid i { aspect-ratio: 1; background: var(--sq); border: 1px solid var(--sq-line); }
.grid i.on { background: var(--accent); border-color: var(--accent); }
.grid i.near { background: transparent; border: 2px solid var(--accent); }
.vl { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--muted); }
.vl.m { width: 2px; margin-left: -1px; background: var(--text); }
.ruler { position: relative; height: 40px; margin-top: 6px; }
.ruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; font: 700 12px/1.3 "JBMono", monospace; color: var(--muted); text-align: center; }
.ruler span.m { color: var(--text); }
.ruler span i { display: block; font-style: normal; font-weight: 500; font-size: 11px; color: var(--muted); }
figcaption { margin-top: 6px; color: var(--muted); font-size: 14px; }

.note { margin: 18px 0 0; color: var(--soft); font-size: 15px; }

.share { margin-top: 22px; border-top: 1px solid var(--rule); }
.share summary { padding: 14px 0 4px; font-weight: 700; color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 15px; color: var(--soft); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.share img { display: block; width: 100%; max-width: 300px; margin-top: 12px; border: 1px solid var(--rule); }
.btns { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btns .ghost { margin: 0; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.ghost { display: inline-block; text-decoration: none; }
.spread { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--rule); }
.spread .go { margin-top: 0; }
.go.outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.go.outline[aria-expanded="true"] { background: var(--panel); }
/* hover swaps the colors (gold fill, dark text); only on devices with a real pointer, so taps on phones don't leave it stuck */
@media (hover: hover) {
  .go.outline:hover, .go.outline[aria-expanded="true"]:hover { background: var(--accent); color: var(--bg); }
}
.panel { margin-top: 10px; padding: 14px 16px 16px; border: 1px solid var(--rule); background: var(--panel); }
.panel .hint:first-child { margin-top: 0; }
.urlrow { margin: 12px 0 0; padding: 12px; background: var(--bg); border: 1px solid var(--rule); }
#pubUrl { font: 700 13px/1.4 "JBMono", monospace; color: var(--text); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
#copyMsg:empty { display: none; }
#copyMsg { color: var(--accent); font-weight: 700; }

.video { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--rule); }
.video h2 { font-weight: 900; font-size: 24px; line-height: 1.15; letter-spacing: -.01em; }
.vsub { margin: 8px 0 14px; color: var(--soft); font-size: 16px; }
.vthumb { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--rule); background: #000; cursor: pointer; aspect-ratio: 16 / 9; }
.vthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; right: 10px; bottom: 10px; width: 68px; height: 48px; background: rgba(10, 11, 13, .85); border: 2px solid var(--accent); }
.play::after { content: ""; position: absolute; left: 26px; top: 12px; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent var(--accent); }
.vframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

.fine { margin-top: 36px; padding-top: 6px; border-top: 1px solid var(--rule); color: var(--soft); font-size: 15px; }
.method summary { padding: 14px 0; font-weight: 700; color: var(--accent); }
.method p { margin: 0 0 10px; }
.method b { color: var(--text); }
.tablewrap { overflow-x: auto; margin: 12px 0 0; }
table { border-collapse: collapse; width: 100%; font: 500 12px/1.35 "JBMono", monospace; }
th, td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text); font-weight: 700; }
td small { display: block; color: var(--muted); font-size: 11px; }
.src { margin: 12px 0 0; padding-left: 18px; }
.src li { margin-bottom: 8px; overflow-wrap: anywhere; }
.nfa { margin: 14px 0 0; color: var(--text); font-weight: 700; font-size: 16px; }
.brand { margin-top: 22px; }

@media (min-width: 560px) {
  .cols { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 56px; }
  .rank { font-size: 56px; }
  table { font-size: 13px; }
}
