:root {
    --ink: #101010;
    --muted: #77736d;
    --line: #e5e2dd;
    --paper: #f7f4ef;
    --surface: #ffffff;
    --accent: #0a7f89;
    --accent-soft: #dceff1;
    --warm: #d8795f;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    letter-spacing: 0;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration-color: rgba(16, 16, 16, 0.28);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration-color: currentColor;
}

.home-page {
    background:
        radial-gradient(circle at 86% 12%, rgba(10, 127, 137, 0.15), transparent 26rem),
        radial-gradient(circle at 14% 18%, rgba(216, 121, 95, 0.16), transparent 28rem),
        var(--paper);
}

.home-shell {
    width: min(calc(100% - 32px), 1120px);
    margin: 0 auto;
    padding: 28px 0 72px;
}

.home-topbar,
.thread-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-size: 20px;
    font-weight: 800;
}

.home-nav {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 56px;
    align-items: center;
    min-height: 620px;
}

.eyebrow,
.thread-kicker {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(52px, 8vw, 106px);
    line-height: 0.98;
    letter-spacing: 0;
    word-break: keep-all;
}

.home-hero h1 span {
    display: block;
}

.lede {
    max-width: 620px;
    margin: 26px 0 0;
    color: #5f5a54;
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.55;
    word-break: keep-all;
}

.home-visual {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: var(--accent-soft);
    box-shadow: 0 28px 80px rgba(16, 16, 16, 0.12);
}

.index-section {
    padding-top: 20px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.section-heading h2 {
    margin: 0;
    font-size: 28px;
}

.index-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.index-card {
    display: block;
    min-height: 164px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    text-decoration: none;
}

.card-type {
    display: block;
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.index-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 24px;
}

.index-card span:last-child {
    color: var(--muted);
    line-height: 1.5;
}

.thread-page {
    background: #f3f1ec;
}

.thread-shell {
    width: min(100%, 620px);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

.thread-topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 72px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
}

.thread-topbar h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.thread-kicker {
    margin-bottom: 4px;
    font-size: 10px;
}

.back-link,
.open-original {
    flex: 0 0 auto;
    color: var(--ink);
    text-decoration: none;
}

.back-link {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
}

.back-link:hover {
    background: #f3f3f3;
}

.open-original {
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.thread-feed {
    display: grid;
}

.thread-summary {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: #fbfaf8;
}

.thread-summary p {
    margin: 0 0 12px;
    color: #4f4b45;
    font-size: 14px;
    line-height: 1.5;
}

.thread-summary dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.thread-summary div {
    min-width: 0;
}

.thread-summary dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.thread-summary dd {
    margin: 3px 0 0;
    font-size: 15px;
    font-weight: 800;
}

.thread-post {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.thread-post:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 39px;
    top: 64px;
    bottom: -18px;
    width: 2px;
    background: #e7e7e7;
}

.avatar {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #191919;
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
}

.avatar-author {
    background: var(--accent);
}

.post-main {
    min-width: 0;
}

.post-head {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
    white-space: nowrap;
}

.username {
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.dot {
    color: #aaa;
}

.author-badge {
    padding: 2px 7px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #555;
    font-size: 12px;
    font-weight: 700;
}

.post-number {
    margin-left: auto;
    color: #aaa;
    font-size: 12px;
    text-decoration: none;
}

.post-number:hover {
    color: var(--accent);
}

.post-text {
    margin: 8px 0 0;
    font-size: 17px;
    line-height: 1.55;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.post-text-large {
    font-size: clamp(26px, 6vw, 40px);
    line-height: 1.25;
    font-weight: 800;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.related-threads {
    padding: 22px 18px 4px;
    border-top: 8px solid #f3f1ec;
}

.related-threads h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.related-card {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.related-card strong {
    font-size: 15px;
}

.related-card span,
.related-card small {
    color: var(--muted);
    font-size: 13px;
}

.related-card span::before {
    content: " · ";
}

.related-card p {
    margin: 8px 0 8px;
    font-size: 16px;
    line-height: 1.5;
}

.scrape-note {
    margin: 0;
    padding: 18px;
    border-top: 8px solid #f3f1ec;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 760px) {
    .home-shell {
        width: calc(100vw - 24px);
        padding-top: 20px;
    }

    .home-hero {
        grid-template-columns: 1fr;
        gap: 28px;
        min-height: auto;
        padding: 56px 0 38px;
    }

    .home-hero h1 {
        max-width: 100%;
        font-size: clamp(36px, 10vw, 46px);
        line-height: 1.08;
        word-break: keep-all;
        overflow-wrap: normal;
    }

    .lede {
        font-size: 17px;
        word-break: break-all;
        overflow-wrap: anywhere;
    }

    .home-visual {
        max-width: 420px;
        margin: 0 auto;
    }

    .section-heading {
        display: block;
    }

    .thread-shell {
        border-left: 0;
        border-right: 0;
    }

    .thread-topbar {
        justify-content: flex-start;
        min-height: 66px;
        padding: 10px 12px;
    }

    .thread-topbar > div {
        min-width: 0;
    }

    .thread-topbar h1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .thread-kicker {
        display: none;
    }

    .open-original {
        display: none;
    }

    .thread-post {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 10px;
        padding: 16px 12px;
    }

    .thread-post:not(:last-child)::after {
        left: 31px;
    }

    .avatar {
        width: 40px;
        height: 40px;
    }

    .post-head {
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .thread-summary {
        padding: 14px 12px;
    }

    .thread-summary dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .post-text {
        font-size: 16px;
    }

    .post-text-large {
        font-size: clamp(28px, 10vw, 38px);
    }

    .post-actions {
        gap: 14px;
    }
}
