/* Homepage redesign - single-column, type-forward layout, scoped under .hp. Plain CSS, no precompiler. */
.hp {
    --bg: #fbfbfd;
    --surface: #fff;
    --ink: #0e0e12;
    --ink-muted: #4b4b57;
    --ink-faint: #74747f;
    --rule: rgba(14, 14, 18, .1);
    --border: rgba(14, 14, 18, .18);
    --accent-bright: oklch(0.62 0.14 200);
    --accent-deep: oklch(0.5 0.13 200);
    --accent-grad: linear-gradient(120deg, oklch(0.68 0.15 200), oklch(0.46 0.12 205));
    --diff-minus: #a33a2a;
    --diff-plus: oklch(0.42 0.11 200);

    background: var(--bg);
    color: var(--ink);
    font-family: 'Instrument Sans', system-ui, sans-serif;
    font-size: 17.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.hp ::selection {
    background: var(--accent-bright);
    color: var(--bg);
}

.hp a {
    color: var(--ink);
    text-decoration: none;
}

.hp a:hover {
    color: var(--accent-deep);
}

.hp p {
    margin: 0;
}

.hp-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Nav */
.hp-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    align-items: baseline;
    padding: 26px 0;
    font-size: 14.5px;
    color: var(--ink-faint);
}

.hp-nav a {
    color: var(--ink-faint);
}

.hp-nav .hp-nav-active {
    color: var(--accent-deep);
}

.hp-nav .hp-nav-mail {
    margin-left: auto;
}

/* Headings */
.hp .hp-h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 500;
    font-size: clamp(2.7rem, 7.6vw, 5.4rem);
    line-height: .98;
    letter-spacing: -.025em;
    margin: 0;
    text-align: left;
    padding: 0;
    text-wrap: balance;
}

.hp .hp-h2 {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 500;
    font-size: clamp(1.9rem, 3.8vw, 2.8rem);
    line-height: 1.1;
    margin: 0;
}

.hp .hp-h1,
.hp .hp-h2 {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hp .hp-muted {
    color: var(--ink-muted);
}

.hp .hp-faint {
    color: var(--ink-faint);
    font-size: 14px;
}

/* Hero */
.hp-hero {
    padding: 44px 0 8px;
}

.hp-hero .hp-hero-id {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    align-items: center;
    margin-bottom: 40px;
}

.hp-hero .hp-portrait {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.hp-hero .hp-hero-lines {
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--ink-faint);
}

.hp-hero .hp-lede-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 34px;
    max-width: 62ch;
}

.hp-hero .hp-lede {
    font-size: 20px;
    line-height: 1.55;
}

.hp-hero .hp-link-accent {
    border-bottom: 1px solid var(--accent-bright);
}

.hp-hero .hp-link-faint {
    border-bottom: 1px solid rgba(14, 14, 18, .25);
}

/* Counters */
.hp-counters {
    margin: 56px 0;
    padding: 26px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 26px 20px;
}

.hp-counters .hp-counter-num {
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(2.1rem, 4.8vw, 3.1rem);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--accent-bright);
}

.hp-counters .hp-counter-label {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-faint);
    margin-top: 10px;
}

/* Diagnostic */
.hp-diagnostic {
    padding: 16px 0 8px;
}

.hp-diagnostic .hp-diagnostic-title {
    margin-bottom: 14px;
    max-width: 26ch;
}

.hp-diagnostic .hp-diagnostic-intro {
    margin-bottom: 26px;
    max-width: 60ch;
}

.hp-diagnostic .hp-code {
    font-size: .94em;
    background: rgba(14, 14, 18, .05);
    padding: 1px 5px;
}

.hp-diagnostic .hp-diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 24px 32px;
    align-items: start;
}

.hp-diagnostic .hp-textarea {
    width: 100%;
    min-height: 190px;
    resize: vertical;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    outline: none;
}

.hp-diagnostic .hp-textarea:focus {
    border-color: var(--accent-bright);
}

.hp-diagnostic .hp-diagnostic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.hp-diagnostic .hp-btn-text {
    background: none;
    border: none;
    padding: 13px 0;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--ink-faint);
    cursor: pointer;
    text-decoration: underline;
}

.hp-diagnostic .hp-btn-text:hover {
    color: var(--accent-deep);
}

.hp .hp-btn-primary {
    background: var(--accent-grad);
    color: var(--bg);
    border: none;
    border-radius: 10px;
    padding: 13px 24px;
    font-family: inherit;
    font-size: 14.5px;
    cursor: pointer;
    white-space: nowrap;
}

.hp .hp-btn-primary:hover {
    background: var(--ink);
    color: var(--bg);
}

.hp .hp-btn-link {
    display: inline-block;
}

.hp-result {
    border-left: 1px solid var(--rule);
    padding-left: 28px;
    min-height: 190px;
}

.hp-result .hp-result-idle {
    max-width: 34ch;
}

.hp-result .hp-report-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.hp-result .hp-report-headline {
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(2.4rem, 5.6vw, 3.6rem);
    line-height: 1;
    color: var(--accent-bright);
    font-variant-numeric: tabular-nums;
}

.hp-result .hp-report-headline-label {
    font-size: 14px;
    color: var(--ink-faint);
    max-width: 16ch;
    line-height: 1.4;
}

.hp-result .hp-report-verdict {
    margin: 18px 0 22px;
}

.hp-result .hp-report-rows {
    display: flex;
    flex-direction: column;
}

.hp-result .hp-report-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--rule);
    font-size: 15px;
}

.hp-result .hp-report-age {
    color: var(--ink-faint);
    text-align: right;
    white-space: nowrap;
}

.hp-result .hp-report-moves {
    margin-top: 26px;
}

.hp-result .hp-report-moves .hp-report-moves-title {
    margin-bottom: 10px;
}

.hp-result .hp-report-moves ol {
    margin: 0;
    padding-left: 1.2em;
    color: var(--ink-muted);
}

.hp-result .hp-report-moves ol li {
    margin-bottom: 8px;
}

/* Shared section head (title + right-aligned meta) */
.hp-section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px 20px;
    margin-bottom: 8px;
}

/* Case file */
.hp-casefile {
    margin-top: 64px;
    padding-top: 36px;
    border-top: 1px solid var(--rule);
}

.hp-casefile .hp-casefile-intro {
    margin-bottom: 30px;
    max-width: 60ch;
}

.hp-casefile .hp-casefile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 28px 36px;
    align-items: start;
}

.hp-casefile .hp-diff {
    background: var(--surface);
    border: 1px solid rgba(14, 14, 18, .14);
    padding: 20px 22px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13.5px;
    line-height: 1.75;
    overflow-x: auto;
}

.hp-casefile .hp-diff > div {
    white-space: pre;
}

.hp-casefile .hp-diff-ctx {
    color: var(--ink-muted);
}

.hp-casefile .hp-diff-minus {
    color: var(--diff-minus);
}

.hp-casefile .hp-diff-plus {
    color: var(--diff-plus);
}

.hp-casefile .hp-diff-meta {
    color: var(--ink-faint);
}

.hp-casefile .hp-notes {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hp-casefile .hp-note-label {
    font-size: 14px;
    color: var(--accent-deep);
    margin-bottom: 6px;
}

/* Writing */
.hp-writing {
    padding: 64px 0 16px;
}

.hp-writing .hp-section-head {
    margin-bottom: 18px;
}

.hp-writing .hp-writing-all {
    font-size: 14px;
}

.hp-writing .hp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.hp-writing .hp-tag {
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 7px 15px;
    border-radius: 999px;
    border: 1px solid rgba(14, 14, 18, .2);
    background: transparent;
    color: var(--ink-muted);
}

.hp-writing .hp-tag:hover {
    border-color: var(--accent-deep);
}

.hp-writing .hp-tag.hp-tag-active {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
    color: var(--ink);
}

.hp-writing .hp-posts {
    display: flex;
    flex-direction: column;
}

.hp-writing .hp-post-row {
    display: grid;
    grid-template-columns: minmax(0, 5.4em) minmax(0, 1fr);
    gap: 2px 22px;
    padding: 18px 0;
    border-top: 1px solid var(--rule);
}

.hp-writing .hp-post-row:hover,
.hp-writing .hp-post-row:hover .hp-post-title,
.hp-writing .hp-post-row:hover .hp-post-note,
.hp-writing .hp-post-row:hover .hp-post-date {
    color: var(--accent-deep);
}

.hp-writing .hp-post-date {
    font-size: 14px;
    color: var(--ink-faint);
    padding-top: 6px;
}

.hp-writing .hp-post-title {
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(1.25rem, 2.3vw, 1.65rem);
    line-height: 1.2;
}

.hp-writing .hp-post-note {
    color: var(--ink-muted);
    font-size: 16.5px;
    margin-top: 5px;
}

.hp .hp-link-deep {
    color: var(--accent-deep);
}

/* CTA */
.hp-cta {
    margin-top: 64px;
    padding: 34px 0;
    border-top: 1px solid var(--rule);
}

.hp-cta .hp-cta-line {
    margin-bottom: 20px;
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    line-height: 1.25;
    max-width: 34ch;
}

.hp-cta .hp-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Full archive */
.hp-archive {
    margin-top: 64px;
    padding-top: 36px;
    border-top: 1px solid var(--rule);
}

.hp-archive .hp-archive-title {
    margin-bottom: 18px;
}

/* Footer */
.hp-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 22px 0 56px;
    font-size: 14px;
    color: var(--ink-faint);
    border-top: 1px solid var(--rule);
}

.hp-footer a {
    color: var(--ink-faint);
}

.hp-footer .hp-footer-quote {
    margin-left: auto;
}

/* Books */
.hp-book {
    margin-top: 56px;
    padding-top: 36px;
    border-top: 1px solid var(--rule);
}

.hp-book .hp-book-intro {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 24px 40px;
    align-items: center;
}

@media (max-width: 600px) {
    .hp-book .hp-book-intro {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hp-book .hp-book-cover {
    width: 100%;
    max-width: 220px;
    border: 1px solid var(--rule);
    box-shadow: 0 8px 24px rgba(14, 14, 18, .12);
}

.hp-book .hp-book-description {
    margin: 14px 0 22px;
    max-width: 52ch;
}

.hp-book .hp-book-contents-title {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 500;
    font-size: 1.5rem;
    margin: 40px 0 16px;
}

.hp-book .hp-book-contents {
    width: 100%;
    height: auto;
    border: 1px solid var(--rule);
}
