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

html {
    background: var(--an-bg);
    overflow-x: clip;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--an-header-height) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--an-text-body);
    background: var(--an-bg);
    font-family: var(--an-font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

img {
    -webkit-user-drag: none;
}

.is-default-logo {
    filter: var(--an-logo-filter);
}

img,
video {
    max-width: 100%;
}

a {
    color: var(--an-secondary);
    text-decoration: none;
    transition: color var(--an-transition);
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
ul,
ol,
blockquote {
    margin: 0;
}

ul {
    padding: 0;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-wrapper > main {
    flex: 1 0 auto;
}

.inner {
    width: 100%;
    max-width: var(--an-content-width);
    margin: 0 auto;
    padding-inline: 16px;
}

.an-site-footer {
    margin: 32px 0 40px;
    color: var(--an-text-faint);
    font-size: 13px;
    line-height: 20px;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
}

.an-site-footer a {
    color: var(--an-text-muted);
}

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

.an-site-footer-links a + a::before {
    content: "|";
    margin: 0 8px;
    color: var(--an-text-faint);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin: 8px 0 24px;
    color: var(--an-text-muted);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.an-btn,
.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    color: var(--an-accent);
    background: transparent;
    border: 1px solid var(--an-accent-line);
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--an-transition), background var(--an-transition), border-color var(--an-transition);
}

.an-btn:hover,
.pagination a:hover {
    color: var(--an-accent-ink);
    background: var(--an-accent);
    border-color: var(--an-accent);
}

.an-btn.is-active {
    color: var(--an-accent-ink);
    background: var(--an-accent);
    border-color: var(--an-accent);
}

.an-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.feed-more {
    display: flex;
    justify-content: center;
    margin: -8px 0 32px;
}

.an-select {
    position: relative;
}

.an-select-button {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    min-width: 200px;
    padding: 8px 14px 8px 16px;
    color: var(--an-text);
    background: var(--an-surface);
    border: 1px solid var(--an-border-strong);
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color var(--an-transition);
}

.an-select-button:hover,
.an-select.is-open .an-select-button {
    border-color: var(--an-accent);
}

.an-select-value {
    flex: 1;
    text-align: left;
}

.an-select-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--an-accent);
    border-bottom: 2px solid var(--an-accent);
    transform: translateY(-3px) rotate(45deg);
    transition: transform var(--an-transition);
}

.an-select.is-open .an-select-arrow {
    transform: translateY(2px) rotate(-135deg);
}

.an-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 100%;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--an-surface-2);
    border: 1px solid var(--an-border-strong);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(3, 8, 16, 0.5);
}

.an-select-option {
    padding: 9px 12px;
    color: var(--an-text-body);
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.an-select-option:hover {
    color: var(--an-text);
    background: var(--an-surface-3);
}

.an-select-option.is-active {
    color: var(--an-accent);
}

.site-archive {
    padding-top: calc(var(--an-header-height) + 32px);
}

.archive-header {
    margin: 0 0 24px;
}

.archive-header-author {
    display: flex;
    gap: 20px;
    align-items: center;
}

.archive-avatar {
    width: 88px;
    height: 88px;
    border: 2px solid var(--an-accent);
    border-radius: 50%;
    object-fit: cover;
}

.archive-title {
    color: var(--an-text);
    font-family: var(--an-font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 500;
    line-height: 1.1;
}

.archive-description {
    margin-top: 6px;
    color: var(--an-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.error-page {
    padding-top: 40px;
}

.error-page .tape {
    height: 32px;
    height: 4px;
    background: var(--an-accent);
}

.error-message {
    max-width: 420px;
    margin: 60px auto;
    padding-inline: 16px;
    text-align: center;
}

.error-logo {
    width: 120px;
}

.error-message h1 {
    margin: 12px 0 8px;
    padding-bottom: 12px;
    color: var(--an-accent);
    border-bottom: 1px solid var(--an-accent-line);
    font-family: var(--an-font-display);
    font-size: 4rem;
    font-weight: 500;
}

.error-description {
    margin: 16px 0 24px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.error-link {
    color: var(--an-accent);
}

@keyframes an-menu-item {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}
