html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.cl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: var(--space-md) 0 0;
    color: var(--text-muted);
    font-size: var(--fs-small);
}

.cl-empty {
    padding: var(--space-xl);
    border: 1px dashed var(--surface-line);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-align: center;
}

.cl-empty .material-symbols-rounded {
    font-size: 2.5rem;
}

.cl-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-lg);
}

.cl-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cl-chip {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    color: var(--text-primary);
    font-size: var(--fs-small);
    text-decoration: none;
}

.cl-chip:hover {
    border-color: var(--surface-line-hover);
    background: var(--surface-bg-hover);
}

.cl-chip.is-active {
    border-color: var(--primary);
    background: rgb(49 112 230 / 18%);
}

.cl-chip .material-symbols-rounded {
    font-size: 1.1em;
}

.cl-chip__count {
    color: var(--text-muted);
    font-size: var(--fs-tiny);
    font-variant-numeric: tabular-nums;
}

.cl-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.25rem 0.75rem;
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-md);
    background: var(--surface-bg);
}

.cl-search:focus-within {
    border-color: var(--border-focus);
}

.cl-search .material-symbols-rounded {
    color: var(--text-muted);
    font-size: 1.2em;
}

.cl-search input {
    width: 12rem;
    max-width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    outline: none;
}

.cl-search button {
    padding: 0.35rem 0.9rem;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: var(--fs-small);
    cursor: pointer;
}

.cl-months {
    display: flex;
    gap: 0.5rem;
    margin-top: var(--space-lg);
    padding-bottom: 0.25rem;
    overflow-x: auto;
}

.cl-month {
    display: flex;
    flex: 1 0 3.2rem;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    padding: 0.5rem 0.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--fs-tiny);
    text-decoration: none;
}

.cl-month:hover {
    background: var(--surface-bg-hover);
}

.cl-month.is-active {
    border-color: var(--primary);
    background: rgb(49 112 230 / 12%);
    color: var(--text-primary);
}

.cl-month__count {
    font-variant-numeric: tabular-nums;
}

.cl-month__track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    max-width: 2rem;
    height: 3.5rem;
}

.cl-month__fill {
    display: block;
    width: 100%;
    border-radius: 2px 2px 0 0;
    background: var(--primary);
    opacity: 70%;
}

.cl-month.is-active .cl-month__fill,
.cl-month:hover .cl-month__fill {
    opacity: 100%;
}

.cl-month__label small {
    margin-left: 0.15rem;
    opacity: 60%;
}

.cl-summary {
    margin: var(--space-lg) 0 var(--space-sm);
    color: var(--text-muted);
    font-size: var(--fs-small);
}

.cl-clear {
    margin-left: 0.5rem;
    color: var(--primary-ink);
}

.cl-month-heading {
    margin: var(--space-xl) 0 var(--space-sm);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--surface-line);
    font-size: var(--fs-title);
}

.cl-day {
    margin-top: var(--space-md);
    scroll-margin-top: 5rem;
}

.cl-day__title {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin: 0 0 0.5rem;
    font-size: var(--fs-lead);
}

.cl-day__title a {
    color: var(--text-primary);
    text-decoration: none;
}

.cl-day__title a:hover {
    text-decoration: underline;
}

.cl-day__count {
    color: var(--text-muted);
    font-size: var(--fs-tiny);
}

.cl-entries {
    margin: 0;
    padding: 0;
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-md);
    background: var(--surface-bg-fade);
    list-style: none;
}

.cl-entry {
    --cl-tint: 136 146 168;
    display: grid;
    grid-template-columns: 6.75rem minmax(0, 1fr) auto;
    gap: var(--space-md);
    align-items: start;
    padding: 0.75rem var(--space-md);
}

.cl-entry + .cl-entry {
    border-top: 1px solid var(--surface-line);
}

.cl-entry--feat { --cl-tint: 34 197 94; }
.cl-entry--fix { --cl-tint: 244 63 94; }
.cl-entry--perf { --cl-tint: 245 158 11; }
.cl-entry--security { --cl-tint: 220 38 38; }
.cl-entry--a11y { --cl-tint: 59 130 246; }
.cl-entry--polish { --cl-tint: 168 85 247; }

.cl-badge {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    justify-self: start;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-md);
    background: rgb(var(--cl-tint) / 14%);
    color: rgb(var(--cl-tint));
    font-size: var(--fs-tiny);
    font-weight: 600;
    white-space: nowrap;
}

.cl-badge .material-symbols-rounded {
    font-size: 1.15em;
}

.cl-entry__subject {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.45;
}

.cl-entry__details {
    margin-top: 0.4rem;
}

.cl-entry__details summary {
    width: fit-content;
    color: var(--primary-ink);
    font-size: var(--fs-small);
    cursor: pointer;
}

.cl-entry__body {
    margin-top: 0.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--surface-line);
    color: var(--text-muted);
    font-size: var(--fs-small);
    line-height: 1.55;
}

.cl-entry__body p {
    margin: 0 0 0.5rem;
}

.cl-entry__body ul {
    margin: 0 0 0.5rem;
    padding-left: 1.2rem;
}

.cl-entry__when {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-end;
    color: var(--text-muted);
    font-size: var(--fs-tiny);
    white-space: nowrap;
}

.cl-entry__when code {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-family: var(--font-mono);
    font-size: inherit;
    opacity: 70%;
}

.cl-pager {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
    justify-content: center;
    margin-top: var(--space-xl);
}

.cl-pager__btn {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    color: var(--text-primary);
    text-decoration: none;
}

.cl-pager__btn:hover {
    border-color: var(--surface-line-hover);
    background: var(--surface-bg-hover);
}

.cl-pager__info {
    color: var(--text-muted);
    font-size: var(--fs-small);
}

.cl-note {
    margin-top: var(--space-xl);
    color: var(--text-muted);
    font-size: var(--fs-tiny);
    text-align: center;
}

.cl-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--surface-line-hover);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    backdrop-filter: blur(8px);
    text-decoration: none;
    opacity: 85%;
}

@media (width <= 640px) {
    .cl-search {
        flex: 1 1 100%;
    }

    .cl-search input {
        flex: 1;
        width: auto;
    }

    .cl-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.4rem;
    }

    .cl-entry__when {
        flex-direction: row;
        gap: 0.75rem;
        align-items: center;
    }
}

.cl-month--empty {
    opacity: 45%;
}

.cl-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: var(--space-xl);
    align-items: stretch;
    margin-top: var(--space-lg);
    padding: var(--space-xl);
    border: 1px solid rgb(50 115 235 / 20%);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgb(59 130 246 / 10%), rgb(139 92 246 / 8%));
}

.cl-hero__intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cl-kicker {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin: 0 0 var(--space-sm);
    color: var(--primary-ink);
    font-size: var(--fs-small);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cl-hero h1 {
    margin: 0;
    font-size: var(--fs-hero);
    line-height: 1.1;
}

.cl-hero__lead {
    margin: var(--space-md) 0 0;
    color: var(--text-muted);
    font-size: var(--fs-lead);
    line-height: 1.5;
}

.cl-latest {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    border: 1px solid var(--surface-line-hover);
    border-radius: var(--radius-md);
    background: rgb(0 0 0 / 20%);
}

.cl-latest__title {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: baseline;
    justify-content: space-between;
    margin: 0;
    font-size: var(--fs-small);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cl-latest__title time {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.cl-latest__list {
    --cl-tint: 136 146 168;
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cl-latest__list li {
    display: grid;
    grid-template-columns: 6.75rem minmax(0, 1fr);
    gap: var(--space-sm);
    align-items: start;
}

.cl-latest__text {
    color: var(--text-primary);
    line-height: 1.4;
}

.cl-latest__more {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    margin-top: auto;
    color: var(--primary-ink);
    font-size: var(--fs-small);
    text-decoration: none;
}

.cl-latest__more:hover {
    text-decoration: underline;
}

.cl-latest__more .material-symbols-rounded {
    font-size: 1.1em;
}

.cl-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
    margin: var(--space-md) 0 0;
}

.cl-stats > div {
    padding: var(--space-md);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-md);
    background: var(--surface-bg);
}

.cl-stats dt {
    color: var(--text-muted);
    font-size: var(--fs-small);
}

.cl-stats dd {
    margin: 0.25rem 0 0;
    color: var(--text-primary);
    font-size: var(--fs-figure);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (width <= 900px) {
    .cl-hero {
        grid-template-columns: minmax(0, 1fr);
        padding: var(--space-lg);
    }

    .cl-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (width <= 640px) {
    .cl-latest__list li {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
    }
}
