/* KINTSUGI.PRESS - research section
   Clean scientific design system. Neutral dark, hairline rules,
   Inter for text, JetBrains Mono for data. One accent, used sparingly. */

:root {
    --bg: #0a0c0f;
    --bg2: #0d0f13;
    --text: #e8eaed;
    --dim: #99a1a9;
    --line: rgba(255, 255, 255, 0.09);
    --line-soft: rgba(255, 255, 255, 0.05);
    --accent: #d4a853;
    --accent-soft: rgba(212, 168, 83, 0.45);
    --warn: #c4826a;
    --text-dim: #99a1a9; /* legacy alias used by inline styles in posts */
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { color-scheme: dark; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

::selection { background: rgba(212, 168, 83, 0.25); }

header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 22px;
    background: rgba(10, 12, 15, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    z-index: 100;
}

.back-landing {
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1;
    color: var(--dim);
    opacity: 0.55;
    text-decoration: none;
    padding: 4px 8px 4px 2px;
    transition: color 0.2s, opacity 0.2s;
}
.back-landing:hover { color: var(--accent); opacity: 1; }

.wordmark { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.wordmark img { width: 26px; height: 26px; border-radius: 4px; }
.wordmark span {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 4px;
    color: var(--accent);
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 1.6px;
}
.nav-right a { color: var(--dim); text-decoration: none; transition: color 0.2s; }
.nav-right a:hover, .nav-right a.here { color: var(--accent); }

.wrap { max-width: 700px; margin: 0 auto; padding: 0 22px 110px; }
.wrap.wide { max-width: 880px; }

.masthead { padding: 74px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.masthead h1 {
    font-family: var(--sans);
    font-weight: 600;
    font-size: clamp(26px, 4.6vw, 38px);
    line-height: 1.22;
    letter-spacing: -0.02em;
}
.masthead .standfirst { margin-top: 18px; color: var(--dim); font-size: 16.5px; max-width: 62ch; }

.eyebrow {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
}

.sechead {
    margin: 58px 0 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--text);
}
.sechead .tag { color: var(--accent); }
.sechead .note { margin-left: auto; color: var(--dim); font-weight: 400; letter-spacing: 1px; text-transform: none; font-size: 10.5px; }

.findings { list-style: none; }
.findings li {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 16px;
    padding: 16px 2px;
    border-bottom: 1px solid var(--line-soft);
}
.findings .fid { font-family: var(--mono); font-size: 11px; color: var(--accent); padding-top: 3px; }
.findings .claim { font-size: 15px; line-height: 1.6; }
.findings .claim a { color: var(--text); text-decoration: none; }
.findings .claim a:hover { color: var(--accent); }
.findings .key { display: block; margin-top: 5px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.findings .key b { color: var(--accent); font-weight: 500; }

.group-label {
    margin: 26px 0 2px;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.75;
}
.sechead + .group-label { margin-top: 14px; }

.postlist { list-style: none; }
.postlist li { border-bottom: 1px solid var(--line-soft); }
.postlist a {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 16px;
    align-items: baseline;
    padding: 18px 2px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.postlist a:hover { background: rgba(255, 255, 255, 0.02); }
.postlist .num { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.postlist h2 { font-family: var(--sans); font-weight: 500; font-size: 16.5px; letter-spacing: -0.01em; line-height: 1.4; }
.postlist a:hover h2 { color: var(--accent); }
.postlist .dek { margin-top: 5px; color: var(--dim); font-size: 13.5px; line-height: 1.6; font-weight: 400; }
.postlist .meta { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--dim); white-space: nowrap; }

article { padding-top: 56px; }
article .kicker {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
}
article h1 {
    font-family: var(--sans);
    font-weight: 600;
    font-size: clamp(25px, 4.4vw, 34px);
    line-height: 1.22;
    letter-spacing: -0.02em;
    margin: 14px 0 16px;
}
article .standfirst { font-size: 17px; color: var(--dim); line-height: 1.6; max-width: 60ch; }
article .byline {
    margin-top: 26px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--dim);
}
.proj-stamp {
    margin: 10px 0 0;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.4px;
    color: var(--dim);
    opacity: 0.85;
}
.proj-stamp strong { color: var(--accent); font-weight: 500; }
.proj-stamp a { color: var(--dim); border-bottom: 1px solid var(--line); }
.proj-stamp a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }

/* recorded clips: portrait phone capture + transcript */
.clipfig { margin: 34px 0; }
.clipwrap {
    display: grid;
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    padding: 18px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 2px;
}
.clipwrap video {
    width: 100%;
    height: auto;
    border-radius: 3px;
    border: 1px solid var(--line-soft);
    background: #000;
    display: block;
}
.cliptx { min-width: 0; }
.cliptx .lbl {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}
.cliptx blockquote {
    margin: 0 0 12px;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.72;
    color: #dde0e3;
    border-left: 2px solid var(--accent-soft);
    padding-left: 14px;
}
.cliptx blockquote + blockquote { margin-top: 12px; }
.cliptx .ask { color: var(--dim); font-style: normal; }
.clipfig figcaption {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--dim);
    border-top: 1px solid var(--line-soft);
    padding-top: 12px;
}
@media (max-width: 700px) {
    .clipwrap { grid-template-columns: 1fr; gap: 16px; padding: 14px; }
    .clipwrap video { max-width: 260px; margin: 0 auto; }
}

/* keep anchor jumps clear of the sticky header */
article h2[id], article h3[id], article p[id] { scroll-margin-top: 76px; }

article h2 {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 21px;
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin: 54px 0 16px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}
article h3 {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    margin: 36px 0 12px;
    color: var(--accent);
}
article p { margin-bottom: 20px; }
article a, .panel a, .tablenote a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); transition: border-color 0.2s; }
article a:hover, .panel a:hover, .tablenote a:hover { border-bottom-color: var(--accent); }
article strong { font-weight: 600; color: #fff; }
article em { font-style: italic; }
article ul, article ol { margin: 0 0 22px 20px; }
article li { margin-bottom: 9px; }

/* quotes rendered as log-excerpt blocks */
.quote {
    margin: 30px 0;
    padding: 16px 20px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.7;
    font-style: normal;
    color: #dde0e3;
}
.quote .attrib {
    display: block;
    margin-top: 12px;
    font-size: 9.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--dim);
}
.quote-stack { margin: 30px 0; display: grid; gap: 10px; }
.quote-stack .q {
    padding: 14px 18px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent-soft);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
    font-style: normal;
    color: #dde0e3;
}

.panel {
    margin: 34px 0;
    padding: 22px 24px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 2px;
}
.panel.gold { border-color: var(--accent-soft); background: var(--bg2); }
.panel .label {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}
.panel p:last-child, .panel ul:last-child, .panel li:last-child { margin-bottom: 0; }
.panel ul { margin-left: 18px; }
.panel li { font-size: 14.5px; color: var(--dim); }
.panel li strong { color: var(--text); }

figure.hl {
    margin: 36px 0;
    padding: 24px 20px 16px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 2px;
}
figure.hl .svg-scroll { overflow-x: auto; }
figure.hl svg { display: block; width: 100%; height: auto; min-width: 620px; }

figure.hl.shot { padding: 10px 10px 16px; }
figure.hl.shot img { display: block; width: 100%; height: auto; border-radius: 2px; border: 1px solid var(--line-soft); }
figure.hl.shot figcaption { padding: 12px 10px 0; }
figure.hl figcaption {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--dim);
    text-align: left;
    border-top: 1px solid var(--line-soft);
    padding-top: 12px;
}
.scroll-hint {
    display: none;
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--dim);
    opacity: 0.6;
    text-align: center;
}

.table-scroll {
    overflow-x: auto;
    margin: 26px 0;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--bg2);
}
.datatable {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 12px;
    min-width: 560px;
}
.datatable caption {
    text-align: left;
    padding: 12px 14px 2px;
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--accent);
}
.datatable th {
    text-align: left;
    font-weight: 500;
    font-size: 9.5px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--dim);
    padding: 11px 13px 9px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.datatable td {
    padding: 8px 13px;
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
    color: var(--text);
}
.datatable tr:last-child td { border-bottom: none; }
.datatable th.num, .datatable td.num { text-align: right; }
.datatable td.dim { color: var(--dim); }
.datatable td.hi { color: var(--accent); font-weight: 600; }
.datatable td.neg { color: var(--warn); }
.datatable td.txt { white-space: normal; min-width: 300px; line-height: 1.55; }
.tablenote { font-size: 13px; color: var(--dim); margin: -14px 0 26px; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 34px 0; }
.stat {
    flex: 1 1 140px;
    padding: 16px 16px 14px;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 2px;
}
.stat .n { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--accent); line-height: 1.15; }
.stat .k { margin-top: 7px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); line-height: 1.6; }

.logbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 28px 0 0;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 1px;
    color: var(--dim);
}
.logbar select {
    background: var(--bg2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 11px;
    padding: 6px 10px;
    outline: none;
}
.logbar select:focus { border-color: var(--accent-soft); }

.postnav {
    margin-top: 76px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 1.2px;
}
.postnav a { color: var(--dim); text-decoration: none; border: none; transition: color 0.2s; }
.postnav a:hover { color: var(--accent); }

.endcap { margin: 64px 0 0; }
.endcap img { display: block; width: 100%; height: auto; border-radius: 2px; border: 1px solid var(--line); opacity: 0.92; }

footer.site {
    padding: 34px 22px 48px;
    text-align: center;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 2.4px;
    color: var(--dim);
    opacity: 0.55;
    border-top: 1px solid var(--line-soft);
}

@media (max-width: 700px) {
    body { font-size: 15.5px; }
    header { flex-wrap: wrap; padding: 10px 14px 6px; gap: 4px 10px; }
    .wordmark span { font-size: 11px; letter-spacing: 3px; }
    .wordmark img { width: 24px; height: 24px; }
    .nav-right {
        flex-basis: 100%;
        justify-content: space-between;
        gap: 0;
        font-size: 10px;
        letter-spacing: 0.8px;
        white-space: nowrap;
    }
    .nav-right a { padding: 8px 6px; }
    .wrap { padding: 0 16px 90px; }
    .masthead { padding: 52px 0 32px; }
    .postlist a { grid-template-columns: 30px 1fr; }
    .postlist .meta { display: none; }
    .findings li { grid-template-columns: 46px 1fr; gap: 10px; }
    article { padding-top: 42px; }
    figure.hl { padding: 18px 14px 12px; }
    .scroll-hint { display: block; }
    .sechead .note { display: none; }

    /* thought log: stacked cards instead of an 800px table */
    #logTable { min-width: 0; }
    #logTable thead { display: none; }
    #logTable, #logTable tbody, #logTable tr, #logTable td { display: block; }
    #logTable tr { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
    #logTable tr:last-child { border-bottom: none; }
    #logTable td { display: inline; padding: 0; border: none; white-space: normal; font-size: 11px; }
    #logTable td:nth-child(3)::before { content: "sal "; color: var(--dim); font-size: 10px; }
    #logTable td:nth-child(4)::before { content: " b7 agg "; color: var(--dim); font-size: 10px; }
    #logTable td.txt { display: block; min-width: 0; margin-top: 7px; font-size: 13px; line-height: 1.65; }
}
