/* ═══════════════════════════════════════════════════════════════
   A PATENT WORTH BILLIONS. AN INVENTOR TO DISPOSE OF.  ·  /thesis/
   Master forensic thesis — rendered as the site capstone page.
   Self-contained reading layout in the dark forensic theme.
   The np-tabs CSS block (bottom of file) is lifted verbatim from
   /courts-own-words/ (exclusive-toggle inline source-PDF viewers).
   ═══════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:          #0c0c12;
    --surface:     #12121c;
    --card:        #161622;
    --elevated:    #1a1a2e;
    --border:      #2a2a3c;
    --border-dim:  #1e1e2e;
    --text:        #e1d9eb;   /* primary */
    --text-bright: #f0f0f0;
    --text-white:  #ffffff;
    --text-subtle: #b0b0b0;
    --text-dim:    #a0a0a0;
    --text-muted:  #707070;
    --red:         #ff5545;
    --gold:        #ffb732;
    --green:       #4eecc8;
    --blue:        #3a86ba;
    --purple:      #b990e6;
    --mono:        'IBM Plex Mono', 'Consolas', monospace;
    --sans:        'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body {
    background-color: var(--bg);
    background-image: radial-gradient(ellipse at center top, rgba(58,134,186,0.13), transparent 62%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── reading container ──────────────────────────── */
.th-wrap { max-width: 880px; margin: 0 auto; padding: 0 36px; }

/* ═══════════════ HERO ═══════════════ */
.th-hero {
    max-width: 880px;
    margin: 0 auto;
    padding: 58px 36px 8px;
    text-align: center;
}
.th-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-subtle);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding: 8px 22px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(255,255,255,0.015);
}
.th-hero h1 {
    font-size: 46px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.12;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}
.th-hero h1 .hot { color: var(--red); }
.th-hero .sub {
    font-size: 19px;
    color: var(--text-subtle);
    max-width: 720px;
    margin: 0 auto 14px;
    line-height: 1.6;
}
.th-case {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 30px;
}
.th-case strong { color: var(--text-dim); font-weight: 700; }

/* download button + offline line */
.th-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--sans);
    font-size: 19px;
    font-weight: 700;
    color: #0c0c12;
    background: linear-gradient(180deg, #ffd27a, var(--gold));
    border: 1px solid var(--gold);
    border-radius: 7px;
    padding: 16px 34px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    box-shadow: 0 6px 22px rgba(255,183,50,0.18);
}
.th-dl-btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 10px 30px rgba(255,183,50,0.28); }
.th-dl-btn .ar { font-size: 22px; line-height: 1; }
.th-offline {
    font-size: 15px;
    color: var(--text-dim);
    margin: 16px auto 0;
    font-style: italic;
    max-width: 620px;
}

/* embedded preview */
.th-embed {
    max-width: 880px;
    margin: 30px auto 0;
    padding: 0 36px;
}
.th-embed iframe {
    display: block;
    width: 100%;
    height: 72vh;
    min-height: 540px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #1a1a2a;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.th-embed .cap {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 1px;
    margin-top: 10px;
}

.th-rule {
    max-width: 880px;
    height: 2px;
    margin: 48px auto 0;
    background: linear-gradient(90deg, transparent, rgba(58,134,186,0.5) 22%, rgba(255,85,69,0.45) 78%, transparent);
}

/* ═══════════════ TIER LEGEND ═══════════════ */
.th-legend {
    max-width: 880px;
    margin: 30px auto 0;
    padding: 0 36px;
}
.th-legend-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    align-items: center;
}
.th-legend .li { display: flex; gap: 9px; align-items: baseline; font-size: 14px; color: var(--text-subtle); }
.th-legend .li b { color: var(--text-bright); font-weight: 600; }

/* tier glyph badges — uniform grayscale, NO color (matches the paper) */
.tier {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-subtle);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 7px;
    white-space: nowrap;
}
.tier .g { color: var(--text); margin-right: 5px; }
.gl { color: var(--text); font-size: 12px; }   /* bare inline glyph (tables) */

/* inline end-of-claim tier tag in running prose */
.tier-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 7px;
    margin-left: 4px;
    vertical-align: 1px;
}
.tier-tag .g { color: var(--text); margin-right: 4px; }

/* ═══════════════ READING BODY ═══════════════ */
.th-main { max-width: 880px; margin: 0 auto; padding: 14px 36px 40px; }

.th-sec { margin-top: 52px; scroll-margin-top: 90px; }
.th-sec:first-child { margin-top: 30px; }

.th-kicker {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 10px;
}
.th-sec > h2 {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.th-sub { margin-top: 30px; }
.th-sub > h3 {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.3;
    margin-bottom: 6px;
}

.th-main p {
    font-size: 17px;
    line-height: 1.78;
    color: var(--text);
    margin-top: 15px;
}
.th-main p.lead {
    font-size: 19px;
    color: var(--text-bright);
    line-height: 1.7;
}
.th-main em { font-style: italic; color: var(--text-bright); }
.th-main strong { font-weight: 700; color: var(--text-white); }
.th-main a { color: var(--blue); text-decoration: none; border-bottom: 1px solid rgba(58,134,186,0.4); }
.th-main a:hover { color: #5aa6da; border-bottom-color: #5aa6da; }

/* centered single-line exhibit */
.th-centerline {
    text-align: center;
    font-size: 21px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.4;
    margin: 30px auto;
    padding: 22px 28px;
    max-width: 760px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: 6px;
}
.th-centerline em { color: var(--gold); font-style: italic; }

/* blockquote (transcript) */
.th-quote {
    margin: 22px 0;
    padding: 14px 24px;
    border-left: 3px solid var(--blue);
    background: rgba(58,134,186,0.05);
    font-style: italic;
    font-size: 17px;
    color: var(--text-bright);
    line-height: 1.7;
}

/* ═══════════════ POWER EXHIBIT CALLOUT ═══════════════ */
.th-power {
    margin: 30px 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: 6px;
    padding: 20px 26px;
}
.th-power .pe-title {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.th-power .pe-title::before { content: "◆"; color: var(--text); }
.th-power p { font-size: 17px; line-height: 1.74; color: var(--text); margin-top: 12px; }
.th-power p:first-of-type { margin-top: 0; }

/* ═══════════════ TABLES ═══════════════ */
.th-table-wrap { margin: 26px 0; overflow-x: auto; }
table.th-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
table.th-table caption {
    caption-side: bottom;
    font-size: 13px;
    color: var(--text-muted);
    text-align: left;
    padding: 10px 4px 0;
    line-height: 1.5;
    font-style: italic;
}
table.th-table th {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-bright);
    text-align: left;
    padding: 11px 14px;
    background: var(--elevated);
    border-bottom: 1px solid var(--border);
}
table.th-table td {
    padding: 10px 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border-dim);
    vertical-align: top;
    line-height: 1.55;
}
table.th-table tr:last-child td { border-bottom: 0; }
table.th-table td.c, table.th-table th.c { text-align: center; }
table.th-table .em { font-style: italic; color: var(--text-bright); }
table.th-table strong { color: var(--text-white); }

/* ═══════════════ SOURCE-VIEWER BLOCK (np-tabs wrapper) ═══════════════ */
.th-src { margin: 28px 0 8px; }
.th-src-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.th-src-label::before { content: "▸ "; color: var(--red); }
/* source-viewer buttons always stack one-per-row (long descriptive labels) */
.th-src .np-tabs { grid-template-columns: 1fr !important; }

/* ═══════════════ THEY ALL KNOW — slim "Closing the Loop" companion band ═══════════════ */
.th-know { max-width: 880px; margin: 30px auto 0; padding: 0 36px; }
.th-know-card {
    background: linear-gradient(180deg, rgba(255,85,69,0.06), var(--surface) 55%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: 10px;
    padding: 22px 28px 24px;
}
.tk-kicker {
    display: block;
    font-family: var(--mono);
    font-size: 12px; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--red); margin-bottom: 8px;
}
.tk-title {
    font-size: 27px; font-weight: 700;
    color: var(--text-white); line-height: 1.16;
    letter-spacing: -0.3px; margin-bottom: 12px;
}
.tk-what { font-size: 15px; line-height: 1.66; color: var(--text-subtle); margin-bottom: 18px; }
.tk-what strong { color: var(--text-bright); font-weight: 600; }
.tk-dl {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--sans); font-size: 16px; font-weight: 700;
    color: #0c0c12; background: linear-gradient(180deg, #ffd27a, var(--gold));
    border: 1px solid var(--gold); border-radius: 7px; padding: 12px 24px;
    text-decoration: none; letter-spacing: 0.2px;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    box-shadow: 0 5px 18px rgba(255,183,50,0.16);
}
.tk-dl:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 9px 26px rgba(255,183,50,0.24); }
.tk-dl .ar { font-size: 18px; line-height: 1; }
.tk-note { font-size: 13px; color: var(--text-muted); margin-top: 10px; font-style: italic; }
.tk-tabs { margin-top: 18px; }
.tk-tabs .np-block { margin: 0; }
.tk-tabs .np-tab {
    justify-content: center; text-align: center;
    text-transform: uppercase; letter-spacing: 1.5px;
    font-size: 12.5px; padding: 13px 14px;
    border: 1px solid var(--border); border-left: 1px solid var(--border);
}
.tk-tabs .np-tab::before { content: "▸ "; color: var(--red); font-weight: 700; }
.tk-tabs .np-tab:hover { color: var(--text-white); background: rgba(255,85,69,0.08); border-color: var(--red); }
.tk-tabs .np-tab.active { color: #000; background: var(--text-subtle); border-color: var(--text-subtle); }
.tk-tabs .np-tab.active::before { content: "▾ "; color: #000; }
@media (max-width: 760px) {
    .th-know { padding-left: 20px; padding-right: 20px; }
    .tk-title { font-size: 22px; }
    .tk-dl { font-size: 15px; width: 100%; justify-content: center; }
}

/* ═══════════════ APPENDIX DOWNLOAD LISTS ═══════════════ */
.th-dl-list { margin: 18px 0; }
.th-dl-list .row {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-dim);
    font-size: 15px;
}
.th-dl-list .row:last-child { border-bottom: 0; }
.th-dl-list .lbl { flex: 1 1 auto; color: var(--text); }
.th-dl-list .lbl b { color: var(--text-white); }
.th-dl-list a.dl {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gold);
    text-decoration: none;
    border: 1px solid rgba(255,183,50,0.4);
    border-radius: 4px;
    padding: 5px 12px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.th-dl-list a.dl:hover { background: rgba(255,183,50,0.1); color: #ffd27a; border-color: var(--gold); }
.th-dl-list a.dl::before { content: "⬇ "; }
.th-note {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.7;
    margin: 14px 0;
}
.th-note a { color: var(--blue); text-decoration: none; border-bottom: 1px solid rgba(58,134,186,0.4); word-break: break-word; }
.th-note a:hover { color: #5aa6da; }

/* jump nav */
.th-jump {
    position: sticky;
    top: 0;
    z-index: 90;
    max-width: 880px;
    margin: 0 auto;
    padding: 10px 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    background: rgba(12,12,18,0.86);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.th-jump a {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-subtle);
    text-decoration: none;
    padding: 3px 4px;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.th-jump a:hover { color: var(--text-white); border-bottom-color: var(--red); }

/* ── responsive ── */
@media (max-width: 760px) {
    .th-wrap, .th-main, .th-hero, .th-embed, .th-legend, .th-jump { padding-left: 20px; padding-right: 20px; }
    .th-hero h1 { font-size: 34px; }
    .th-hero .sub { font-size: 17px; }
    .th-sec > h2 { font-size: 25px; }
    .th-sub > h3 { font-size: 19px; }
    .th-main p { font-size: 16px; }
    .th-centerline { font-size: 18px; padding: 18px 20px; }
    .th-embed iframe { height: 60vh; }
}

/* ═══════════════════════════════════════════════════════════════
   NP-TABS — lifted verbatim from /courts-own-words/
   (exclusive-toggle source-PDF viewers; deep-links honored by np-tabs.js)
   ═══════════════════════════════════════════════════════════════ */
.np-block { margin: 10px 0 0; }
.np-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.np-tabs.cols-3 { grid-template-columns: repeat(3, 1fr); }
.np-tabs.cols-2 { grid-template-columns: repeat(2, 1fr); }
.np-tabs.cols-1 { grid-template-columns: 1fr; }
.np-tab {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-subtle);
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid rgba(255,85,69,0.55);
    border-radius: 4px;
    padding: 9px 14px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.18s;
    line-height: 1.3;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
}
.th-src .np-tab::before { content: "▸ VIEW SOURCE  ·  "; color: var(--red); font-weight: 700; letter-spacing: 1px; }
.np-tab:hover { color: var(--text-white); background: rgba(255,85,69,0.08); border-left-color: var(--red); }
.np-tab.active { color: #000; background: var(--text-subtle); border-left-color: var(--text-subtle); }
.th-src .np-tab.active::before { color: #000; }
.np-viewer {
    display: none;
    width: 100%;
    margin-top: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.np-viewer.open { display: block; }

/* ── CSV / direct content (PDF list / single-file passthrough) ── */
.np-csv-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--surface);
}
.np-loading {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    padding: 20px;
    letter-spacing: 1px;
}
.np-card-list {
    position: absolute; inset: 0;
    overflow-y: auto;
    padding: 8px;
    display: flex; flex-direction: column; gap: 4px;
}
.np-card {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: 4px;
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
}
.np-card:hover { background: var(--elevated); border-color: var(--red); color: var(--text-white); }
.np-card.active { background: var(--bg); color: var(--text-subtle); border-color: var(--text-subtle); }
.np-card-overlay {
    position: absolute; inset: 0;
    display: none;
    flex-direction: column;
    background: var(--surface);
    z-index: 1;
}
.np-card-overlay.open { display: flex; }
.np-card-active {
    flex: 0 0 auto;
    margin: 8px 8px 4px;
    background: var(--bg) !important;
    border-color: var(--text-subtle) !important;
    color: var(--text-subtle) !important;
}
.np-pdf-frame {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: #1a1a2a;
}
.np-csv-content.np-single { overflow-y: auto; }
.np-single-img {
    display: block;
    width: 100%;
    height: auto;
    background: #1a1a2a;
    cursor: zoom-in;
}
.np-csv-content.np-single > .np-pdf-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Fullscreen image lightbox (shared singleton) */
.np-lightbox {
    position: fixed; inset: 0;
    display: none;
    z-index: 9999;
    background: rgba(0,0,0,0.94);
    align-items: center; justify-content: center;
}
.np-lightbox.open { display: flex; }
.np-lightbox .lb-img {
    max-width: 92vw; max-height: 88vh;
    display: block;
    background: #fff;
    border-radius: 4px;
}
.np-lightbox .lb-prev,
.np-lightbox .lb-next,
.np-lightbox .lb-close {
    position: absolute;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-family: var(--mono);
    font-size: 26px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.np-lightbox .lb-prev:hover,
.np-lightbox .lb-next:hover,
.np-lightbox .lb-close:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); }
.np-lightbox .lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.np-lightbox .lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.np-lightbox .lb-close { top: 18px; right: 18px; font-size: 24px; }
.np-lightbox .lb-counter {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,0.65); letter-spacing: 2px;
}

@media (max-width: 760px) {
    .np-tabs, .np-tabs.cols-2, .np-tabs.cols-3 { grid-template-columns: 1fr; }
    .np-tab { font-size: 11.5px; }
}
