/* ═══ Brutalist System ═══ 
   Font sizes: 11px (small), 13px (body), 15px (heading), 18px (title)
   Colors: #1a1a1a (text), #666 (secondary), #999 (muted), #e8e8e8 (bg)
   Spacing: 8px, 16px, 24px
*/

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

body {
    font-family: "Trebuchet MS", sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f8f8f8;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

a { color: #1a1a1a; }

/* Header */
header { border-bottom: 2px solid #1a1a1a; padding-bottom: 8px; margin-bottom: 24px; }
header h1 { font-size: 15px; font-weight: 700; letter-spacing: -0.5px; }
header h1 a { text-decoration: none; }
header .byline { font-size: 10px; font-weight: 400; font-style: italic; color: #666; }
header .byline .author { color: #666; text-decoration: none; }
header .byline .author:hover { font-weight: 700; }

/* Headings */
h2 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #666; margin: 24px 0 8px; border-bottom: 1px solid #ddd; padding-bottom: 4px; }

/* Search */
.how-to-use { font-size: 11px; margin-top: 4px; }
.how-to-use a { color: #999; text-decoration: none; }
.how-to-use a:hover { color: #666; }
.search-container { position: relative; margin: 16px 0; }
#firm-search { width: 100%; padding: 8px 12px; font-family: inherit; font-size: 13px; border: 2px solid #1a1a1a; background: #fff; }
#firm-search:focus { outline: none; background: #fffef8; }
.htmx-indicator { display: none; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: #666; }
.htmx-request .htmx-indicator { display: inline; }

/* Results List */
.firm-results { list-style: none; border: 2px solid #1a1a1a; background: #fff; }
.firm-results li { border-bottom: 1px solid #e8e8e8; }
.firm-results li:last-child { border-bottom: none; }
.firm-results a { 
    display: flex; 
    align-items: center;
    gap: 12px;
    padding: 8px 12px; 
    text-decoration: none; 
    color: inherit; 
}
.firm-results a::before {
    content: '';
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 0%, transparent 100%);
    transition: all 0.15s;
}
.firm-results a:hover { background: #f0f0f0; }
.firm-results a:hover::before { background: radial-gradient(circle, #999 50%, transparent 50%); }
.firm-results a:active::before,
.firm-results a:focus::before { background: radial-gradient(circle, #1a1a1a 50%, transparent 50%); }
.firm-results a:focus { outline: none; }
.firm-results .result-text { flex: 1; min-width: 0; }
.firm-results strong { font-size: 13px; display: block; }
.firm-results .meta { display: block; font-size: 11px; color: #666; margin-top: 2px; }

.search-other { margin-top: 16px; }
button {
    font-family: inherit;
    font-size: 11px;
    padding: 8px 16px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
button:hover { background: #333; }

.no-results { color: #666; margin: 16px 0; }

/* Search Results Page */
.search-results-page h2 { margin-bottom: 4px; }
.search-results-page .website { font-size: 11px; color: #666; margin-bottom: 16px; }
.search-results-page .website a { color: #666; }
.results-count { margin: 16px 0; color: #666; }
.bottom-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }
.bottom-nav .back-link { margin: 0; font-size: 11px; }
.bottom-nav .back-link a { color: #666; text-decoration: none; }
.bottom-nav .back-link a:hover { color: #1a1a1a; }
.pagination { display: flex; align-items: center; gap: 6px; }
.page-btn { font-family: inherit; font-size: 10px; padding: 4px 10px; background: #fff; color: #1a1a1a; border: 1px solid #1a1a1a; cursor: pointer; text-decoration: none; }
.page-btn:hover { background: #f0f0f0; }
.page-num { font-size: 10px; color: #fff; background: #1a1a1a; padding: 4px 10px; border: 1px solid #1a1a1a; }

.back-link { margin-top: 32px; }
.back-link a { color: #666; text-decoration: none; font-size: 11px; }
.back-link a:hover { color: #1a1a1a; }

/* Profile */
.profile h2 { margin-bottom: 4px; }
.profile .cik { font-size: 11px; color: #666; font-family: monospace; }
.profile .website { font-size: 11px; color: #666; margin: 4px 0 16px; }
.profile .website a { color: #666; }

/* Form ADV Data */
.adv-data { font-size: 11px; margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.adv-data span { background: #e8e8e8; padding: 4px 8px; }
.adv-data a { color: #1a1a1a; }
.disclosure-flag { background: #1a1a1a !important; color: #fff; }

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2px;
    background: #1a1a1a;
    border: 2px solid #1a1a1a;
    margin: 16px 0;
}
.metric { background: #fff; padding: 12px; }
.metric .label { display: block; font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.3px; }
.metric .value { display: block; font-size: 18px; font-weight: 700; margin-top: 4px; }

/* Check Estimate */
.check-estimate { margin: 8px 0 24px; }
.check-range { display: flex; gap: 2px; background: #1a1a1a; }
.check-range span { flex: 1; background: #fff; padding: 12px; text-align: center; font-size: 15px; font-weight: 700; }
.check-range .mid { background: #e8e8e8; }
.check-labels { display: flex; font-size: 11px; color: #666; margin-top: 4px; }
.check-labels span { flex: 1; text-align: center; }
.confidence { font-size: 11px; color: #666; margin-top: 8px; }
.conf-low { color: #c33; }
.conf-medium { color: #b90; }
.conf-high { color: #393; }

/* Status */
.status-active { color: #1a1a1a; }
.status-late { color: #666; }
.status-harvest { color: #999; }

/* Tables */
.filings-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.filings-table th, .filings-table td { padding: 8px; text-align: left; border-bottom: 1px solid #e8e8e8; font-size: 13px; }
.filings-table th { background: #e8e8e8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 700; }
.filings-table a { color: #1a1a1a; text-decoration: none; border-bottom: 1px solid #ccc; }
.filings-table a:hover { border-color: #1a1a1a; }
.pdf-icon { font-size: 9px; text-transform: uppercase; margin-right: 4px; letter-spacing: 0.5px; }

/* Lists */
.osint-links, .people-list, .portfolio-exits { list-style: none; }
.osint-links { column-count: 2; column-gap: 24px; }
.osint-links li, .people-list li, .portfolio-exits li { margin-bottom: 8px; font-size: 13px; }
.portfolio-exits .ownership { display: block; font-size: 11px; color: #666; margin-top: 2px; }
.osint-links a { color: #1a1a1a; text-decoration: none; border-bottom: 1px solid #ccc; }
.osint-links a:hover { border-color: #1a1a1a; }
.people-list .role { color: #666; }
.no-data { color: #666; }

/* Tooltip */
.tip { font-size: 9px; color: #999; cursor: help; position: relative; vertical-align: super; text-transform: none; font-weight: normal; }
.tip:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    bottom: 100%;
    background: rgba(90,90,90,0.92);
    color: #f5f5f5;
    padding: 3px 6px;
    font-size: 10px;
    font-style: italic;
    white-space: nowrap;
    z-index: 10;
    letter-spacing: 0.2px;
    text-transform: none;
}

/* Loaders */
#page-loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    grid-template-columns: repeat(4, 8px);
    grid-template-rows: repeat(4, 8px);
    gap: 2px;
}
.matmul-loader .c { background: #ccc; animation: matmul 0.8s ease-in-out infinite; }
.matmul-loader .c:nth-child(1)  { animation-delay: 0.00s; }
.matmul-loader .c:nth-child(2)  { animation-delay: 0.05s; }
.matmul-loader .c:nth-child(3)  { animation-delay: 0.10s; }
.matmul-loader .c:nth-child(4)  { animation-delay: 0.15s; }
.matmul-loader .c:nth-child(5)  { animation-delay: 0.05s; }
.matmul-loader .c:nth-child(6)  { animation-delay: 0.10s; }
.matmul-loader .c:nth-child(7)  { animation-delay: 0.15s; }
.matmul-loader .c:nth-child(8)  { animation-delay: 0.20s; }
.matmul-loader .c:nth-child(9)  { animation-delay: 0.10s; }
.matmul-loader .c:nth-child(10) { animation-delay: 0.15s; }
.matmul-loader .c:nth-child(11) { animation-delay: 0.20s; }
.matmul-loader .c:nth-child(12) { animation-delay: 0.25s; }
.matmul-loader .c:nth-child(13) { animation-delay: 0.15s; }
.matmul-loader .c:nth-child(14) { animation-delay: 0.20s; }
.matmul-loader .c:nth-child(15) { animation-delay: 0.25s; }
.matmul-loader .c:nth-child(16) { animation-delay: 0.30s; }

@keyframes matmul {
    0%, 100% { background: #ddd; }
    50% { background: #1a1a1a; }
}

#s1-loader {
    display: inline-block;
    width: 4px; height: 4px;
    margin-left: 10px;
    vertical-align: 2px;
    background: #1a1a1a;
    box-shadow: 5px 0 0 #888, 10px 0 0 #888, 0 5px 0 #888, 5px 5px 0 #1a1a1a, 10px 5px 0 #888, 0 10px 0 #888, 5px 10px 0 #888, 10px 10px 0 #1a1a1a;
    animation: inlineMatmul 0.6s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.2s;
}

@keyframes inlineMatmul {
    0%, 100% { box-shadow: 5px 0 0 #ccc, 10px 0 0 #ccc, 0 5px 0 #ccc, 5px 5px 0 #999, 10px 5px 0 #ccc, 0 10px 0 #ccc, 5px 10px 0 #ccc, 10px 10px 0 #999; }
    50% { box-shadow: 5px 0 0 #666, 10px 0 0 #333, 0 5px 0 #666, 5px 5px 0 #1a1a1a, 10px 5px 0 #333, 0 10px 0 #333, 5px 10px 0 #1a1a1a, 10px 10px 0 #1a1a1a; }
}

/* Homepage accent bar */
.accent-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: 
        linear-gradient(0deg, rgba(255,255,255,0.3) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            #1a1a1a 0px,
            #1a1a1a 6px,
            #fff 6px,
            #fff 12px
        );
    box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
}
