/* design tokens */
:root {
    --background: #ffffff;
    --accent: #000000;
    --body: #000000;
    --sub: #4f4f4f;
    --highlight: #e0e0e0;
    --glass-bg: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
    --spacing: 8px;
    --spacing-2: 16px;
    --spacing-3: 24px;
    --spacing-4: 32px;
    --weight-body: 400;
    --weight-accent: 500;
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #000000;
        --accent: #e9e9e9;
        --body: #a2a2a2;
        --sub: #6e6e6e;
        --highlight: #222222;
        --glass-bg: rgba(255, 255, 255, 0.03);
        --glass-border: rgba(255, 255, 255, 0.08);
    }
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

*::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--sub);
    opacity: 0.3;
    border-radius: 10px;
}

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

body {
    font-family: "Inter", sans-serif;
    background: var(--background);
    color: var(--accent);
    min-height: 100vh;
    font-weight: var(--weight-body);
}

::selection {
    background: var(--highlight);
}

a {
    color: inherit;
}

/* glass surface */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    transition: filter 0.2s;
}

/* search bar */
.search-container {
    position: sticky;
    top: 0;
    background: var(--background);
    padding-bottom: 10px;
    margin-bottom: var(--spacing-2);
    z-index: 10;
}

.search-bar {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--border-radius);
    color: var(--accent);
    font-size: 14px;
    font-family: "Inter", sans-serif;
    outline: none;
    position: relative;
    z-index: 2;
}

.search-bar::placeholder {
    color: var(--sub);
}

.search-bar:focus {
    color: var(--accent);
}

/* list container, used by projects + blog list */
.list-container {
    overflow-y: auto;
    padding-right: 10px;
}

.no-results {
    display: none;
    text-align: center;
    padding: 40px 20px;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.no-results.show {
    display: flex;
}

.no-results-gif {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.no-results-text {
    font-size: 16px;
    color: var(--sub);
}

/* card, used by projects + blog list. icon is optional */
.card {
    border-radius: var(--border-radius-lg);
    padding: 18px;
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    padding: var(--spacing);
    margin: calc(var(--spacing) * -1);
    border-radius: var(--border-radius);
    margin-bottom: 14px;
    transition: background 0.2s ease;
}

.card-header:hover {
    background: var(--highlight);
}

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

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    object-fit: cover;
    flex-shrink: 0;
}

.card-header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 17px;
    font-weight: var(--weight-accent);
    color: var(--accent);
}

.card-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sub);
    font-size: 13px;
    transition: color 0.2s ease;
}

.card-header:hover .card-link {
    color: var(--body);
}

.card-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.card-description {
    font-size: 14px;
    line-height: 1.6;
    cursor: default;
    color: var(--sub);
}

/* tag pill, e.g. dev / vct / football */
.tag {
    display: inline-block;
    background: var(--highlight);
    color: var(--sub);
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 999px;
}

/* single-column shell for blog list + posts */
.page {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(28px, 6vw, 56px) clamp(20px, 4vw, 40px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sub);
    font-size: 14px;
    text-decoration: none;
    margin-bottom: var(--spacing-4);
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
}

.back-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.page-title {
    font-size: 26px;
    font-weight: var(--weight-accent);
    margin-bottom: 8px;
    color: var(--accent);
}

.page-subtitle {
    color: var(--sub);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: var(--spacing-4);
}

/* post */
.post-title {
    font-size: 26px;
    font-weight: var(--weight-accent);
    margin-bottom: 10px;
    color: var(--accent);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--sub);
    font-size: 13px;
    margin-bottom: var(--spacing-4);
}

.post-content {
    font-size: 16px;
    line-height: 1.75;
    color: var(--body);
}

.post-content p {
    margin-bottom: var(--spacing-3);
}

.post-content h2 {
    font-size: 19px;
    font-weight: var(--weight-accent);
    color: var(--accent);
    margin: var(--spacing-4) 0 var(--spacing-2);
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--glass-border);
    text-underline-offset: 3px;
}

.post-content a:hover {
    text-decoration-color: var(--accent);
}

.post-content ul,
.post-content ol {
    margin: 0 0 var(--spacing-3) 20px;
}

.post-content li {
    margin-bottom: 6px;
}

.post-content code {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}

.post-content blockquote {
    border-left: 2px solid var(--glass-border);
    padding-left: 14px;
    color: var(--sub);
    margin-bottom: var(--spacing-3);
}

/* quiet aside within a post, e.g. a note to self */
.self-note {
    font-style: italic;
    color: var(--sub);
    font-size: 13px;
    text-align: center;
}

.post-content img {
    width: 100%;
    display: block;
    border-radius: var(--border-radius-lg);
    margin: var(--spacing-2) 0 var(--spacing-3);
}

.post-chart {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: var(--spacing-2) auto var(--spacing-3);
}

.post-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin: var(--spacing-2) 0 var(--spacing-3);
}

.post-video iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* smaller centered image, e.g. for closing out a post */
.post-content .post-image {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: var(--spacing-4) auto;
    border-radius: var(--border-radius-lg);
}

/* reading progress bar, fixed to viewport top on post pages */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent);
    z-index: 50;
    transition: width 0.1s ease-out;
}

/* back to top link at the end of a post */
.to-top-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    color: var(--sub);
    font-size: 14px;
    text-decoration: none;
    margin: var(--spacing-4) auto 0;
    transition: color 0.2s ease;
}

.to-top-link:hover {
    color: var(--accent);
}

.to-top-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}