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

:root {
    --bg: #0a0a0a;
    --text: #e0e0e0;
    --text-muted: #6e7681;
    --text-secondary: #9ca3af;
    --border: #1a1a2e;
    --accent: #6c63ff;
    --accent-hover: #8b83ff;
    --accent-glow: rgba(108, 99, 255, 0.15);
    --card-bg: #111118;
    --card-border: #1c1c2e;
    --card-hover: #16161f;
    --label-bg: rgba(108, 99, 255, 0.1);
    --label-border: rgba(108, 99, 255, 0.25);
    --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    max-width: 740px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* Header */

header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-family: var(--mono);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

header h1 a {
    color: var(--text);
    transition: color 0.15s ease;
}

header h1 a:hover {
    text-decoration: none;
    color: var(--accent);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    letter-spacing: 0.02em;
}

/* Repo filter - searchable dropdown */

.repo-filter {
    position: relative;
    margin-bottom: 2rem;
}

.filter-input-wrap {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s ease;
}

.filter-input-wrap:focus-within {
    border-color: var(--accent);
}

.filter-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.8rem;
    min-width: 0;
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-count {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    white-space: nowrap;
}

.filter-clear {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    margin-left: 0.5rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.filter-clear:hover {
    color: var(--text);
}

.filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0;
}

.filter-dropdown::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.filter-dropdown::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

.filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.45rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--mono);
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s ease;
}

.filter-option:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

.filter-option.active {
    color: var(--accent);
}

.filter-option-all {
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
}

.filter-option-count {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.filter-group-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.2rem;
    letter-spacing: 0.03em;
}

.filter-empty {
    padding: 1rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* Index page - day entries list */

.day-entry {
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.day-entry:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.day-entry a.day-link {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    transition: color 0.15s ease;
}

.day-entry:hover a.day-link {
    color: var(--accent);
}

.day-entry a.day-link:hover {
    text-decoration: none;
}

.day-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.day-repos {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.repo-tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    background: var(--label-bg);
    color: var(--text-secondary);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    border: 1px solid var(--label-border);
    cursor: pointer;
    transition: all 0.15s ease;
}

.repo-tag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Entry page */

.entry-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

.entry-nav a {
    font-family: var(--mono);
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.entry-nav a:hover {
    color: var(--accent);
}

.entry-date {
    font-family: var(--mono);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.entry-summary {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

/* Repo sections within an entry */

.repo-section {
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
}

.repo-section h3 {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.7rem 1rem;
    background: rgba(108, 99, 255, 0.05);
    border-bottom: 1px solid var(--card-border);
}

.repo-section h3 a {
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.repo-section h3 a:hover {
    color: var(--accent);
}

/* PR items */

.pr-item {
    padding: 0.85rem 1rem;
}

.pr-item + .pr-item {
    border-top: 1px solid var(--card-border);
}

.pr-title a {
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}

.pr-title a:hover {
    color: var(--accent);
}

.pr-body {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    line-height: 1.5;
}

.pr-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.pr-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--label-border);
    background: var(--label-bg);
    color: var(--accent);
}

/* Empty state */

.empty-state {
    text-align: center;
    padding: 5rem 0;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 0.95rem;
}

/* Footer */

footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

/* Responsive */

@media (max-width: 600px) {
    body {
        padding: 1.5rem 1rem;
    }

    header {
        margin-bottom: 1.5rem;
    }

    .entry-date {
        font-size: 1.1rem;
    }

    .day-entry {
        padding: 0.85rem 1rem;
    }

    .entry-nav {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}
