:root {
    --page-background: #e5e5e5;
    --border-color: #b8b8b8;
    --text-color: #181818;
    --timestamp-color: #555;
    --section-background: #555;
    --muted-text: #707070;
    --card-background: #f2f2f2;
    --card-text-color: #404040;
    --card-hover-background: #e9e9e9;
    --accent: #181818;
    --accent-soft: #b8b8b8;
}

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

html,
body {
    margin: 0;
    background: var(--page-background);
    color: var(--text-color);
    font-family: Inter, sans-serif;
}

body {
    padding: 40px 20px 80px;
}

.wrapper {
    max-width: 920px;
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--accent);
}

.label {
    color: var(--muted-text);
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
}

.card .label,
.code-item .label,
.tool-item .label,
.section-tab {
    text-transform: uppercase;
}

.label a {
    color: var(--muted-text);
    text-decoration: none;
}

.label a:hover {
    color: var(--accent);
    text-decoration: underline;
}

h1 {
    margin: 2px 0 0;
    font-family: 'Courier Prime', monospace;
    font-size: 44px;
    letter-spacing: -0.01em;
}

.site-header p {
    max-width: 260px;
    margin: 0;
    color: var(--muted-text);
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    line-height: 1.5;
    text-align: right;
}

.section-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 40px 0 16px;
}

.section-wrapper > a {
    border-bottom: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    text-decoration: none;
}

.section-tab {
    display: inline-block;
    margin: 0;
    padding: 6px 14px 6px 10px;
    border-radius: 0 5px 0 0;
    background: var(--section-background);
    color: #f5f5f5;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card,
.tool-item,
.content-card {
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-soft);
    border-radius: 0 5px 0 0;
    background: var(--card-background);
    box-shadow: 2px 3px rgba(15, 143, 163, 0.1);
}

.card {
    padding: 20px 20px 18px;
    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.15s;
}

.card:hover,
.tool-item:hover {
    border-color: var(--accent);
    background: var(--card-hover-background);
    transform: translateY(-1px);
}

.card .label,
.tool-item .label,
.code-item .label {
    font-size: 11px;
}

.card h3 {
    margin: 8px 0 6px;
    font-size: 19px;
    font-weight: 600;
}

.card p {
    margin: 0 0 16px;
    color: var(--card-text-color);
    font-size: 13.5px;
    line-height: 1.55;
}

.card .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timestamp {
    color: var(--timestamp-color);
    font-family: 'Courier Prime', monospace;
    font-size: 10.5px;
}

.page-meta {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 20px;
    color: var(--muted-text);
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
}

.page-meta-label {
    letter-spacing: 0.1em;
}

.page-meta time {
    color: var(--timestamp-color);
}

.tool-info .timestamp {
    display: block;
    margin-top: 10px;
}

.card a,
.code-item a,
.tool-item > a {
    flex-shrink: 0;
    border-bottom: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    text-decoration: none;
}

.card a:hover,
.code-item a:hover,
.tool-item > a:hover {
    border-color: #000;
    color: #000;
}

.code-list,
.tool-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-item,
.tool-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
}

.code-item {
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-soft);
    border-radius: 0 5px 0 0;
    background: var(--card-background);
    transition:
        background 0.15s,
        border-color 0.15s;
}

.code-item:hover {
    border-color: var(--accent);
    background: var(--card-hover-background);
}

.code-item h3,
.tool-item h3 {
    margin: 2px 0 5px;
    font-size: 16px;
}

.code-item p,
.tool-item p {
    margin: 5px 0;
    color: var(--card-text-color);
    font-size: 13px;
    line-height: 1.5;
}

.code-item a,
.tool-item > a {
    white-space: nowrap;
}

.tool-info {
    min-width: 0;
}

.content-card {
    padding: 20px;
}

.content-card > * {
    margin: 0 0 16px;
    color: var(--card-text-color);
    font-size: 14px;
    line-height: 1.65;
}

.content-card p:last-child {
    margin-bottom: 0;
}

.content-card a {
    border-bottom: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.content-card a:hover {
    border-color: #000;
    color: #000;
}

.contact-row {
    display: flex;
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 0 5px 0 0;
}

.contact-row a {
    flex: 1;
    padding: 16px 10px;
    border-right: 1px solid var(--border-color);
    background: var(--card-background);
    color: var(--text-color);
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
}

.contact-row a:last-child {
    border-right: none;
}

.contact-row a:hover {
    background: var(--accent-soft);
}

.empty-state {
    color: var(--muted-text);
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
}

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 50px;
    padding-top: 16px;
    border-top: 1px solid var(--accent);
    color: var(--muted-text);
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
}

footer a {
    color: var(--muted-text);
    text-decoration: underline;
}

footer a:hover {
    color: var(--accent);
}

::selection {
    background: var(--accent);
    color: #fff;
}

@media (max-width: 640px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .site-header p {
        max-width: none;
        text-align: left;
    }

    .code-item,
    .tool-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .tool-item > a {
        align-self: flex-end;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --page-background: #111;
        --border-color: #3a3a3a;
        --text-color: #eee;
        --timestamp-color: #b8b8b8;
        --section-background: #5a5a5a;
        --muted-text: #8d8d8d;
        --card-background: #1b1b1b;
        --card-text-color: #c4c4c4;
        --card-hover-background: #252525;
        --accent: #eee;
        --accent-soft: #3a3a3a;
    }

    .section-tab {
        background: var(--section-background);
        color: #f2f2f2;
    }

    .card a:hover,
    .code-item a:hover,
    .tool-item > a:hover,
    .content-card a:hover {
        border-color: #fff;
        color: #fff;
    }

    ::selection {
        background: var(--accent);
        color: #111;
    }
}
