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

:root {
    --color-primary: #c22a3d;
    --color-secondary: #121212;
    --color-surface: #1d1a2452;
    --color-text: #dce0e5;
    --color-text-muted: #afafafe1;
    --color-glow: rgba(194, 42, 61, 0.4);
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-secondary);
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

::selection {
    background: rgba(194, 42, 61, 0.3);
    color: white;
}

body {
    background-color: var(--color-secondary);
    background-image: radial-gradient(rgba(194, 42, 61, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    font-family: Poppins, sans-serif;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    background-color: transparent;
    max-width: 1180px;
    width: 100%;
    margin: auto;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Scroll Reveal --- */

[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Navigation --- */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    top: 0;
    position: sticky;
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(194, 42, 61, 0.1);
    padding: 16px 24px;
    margin: 0 -20px;
    width: calc(100% + 40px);
    max-width: 100vw;
    box-sizing: border-box;
}

.nav-brand {
    color: var(--color-primary);
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
    text-decoration: none;
    text-shadow: 0 0 30px var(--color-glow);
    transition: opacity 0.3s ease;
}

.nav-brand:hover {
    opacity: 0.8;
}

/* Blinking cursor */
.nav-brand::after {
    content: '_';
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: var(--color-text);
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    padding: 4px 12px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

/* --- Page Header --- */

.page-header {
    padding: 60px 0 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 80px;
    font-weight: 900;
    font-family: 'Courier New', Courier, monospace;
    background: linear-gradient(135deg, var(--color-primary), #e84a5f 50%, var(--color-primary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
    letter-spacing: 0.4rem;
    margin-bottom: 12px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.page-header .separator {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* --- Catalog Filters --- */

.catalog-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.catalog-btn {
    background: transparent;
    border: 1px solid rgba(194, 42, 61, 0.15);
    color: var(--color-text-muted);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.catalog-btn:hover {
    border-color: rgba(194, 42, 61, 0.4);
    color: var(--color-primary);
}

.catalog-btn.active {
    background: rgba(194, 42, 61, 0.12);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* --- Article Cards --- */

.notes {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.note {
    color: var(--color-text);
    background: linear-gradient(135deg, rgba(194, 42, 61, 0.03), rgba(194, 42, 61, 0.01));
    border: 1px solid rgba(194, 42, 61, 0.08);
    border-left: 3px solid rgba(194, 42, 61, 0.25);
    border-radius: 4px 12px 12px 4px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.note:hover {
    border-color: rgba(194, 42, 61, 0.2);
    border-left-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(194, 42, 61, 0.08);
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.note .date {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: normal;
}

.note .date i {
    color: var(--color-primary);
    font-size: 0.7rem;
}

.note-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2rem;
    font-weight: 900;
    color: rgba(194, 42, 61, 0.08);
    position: absolute;
    top: 12px;
    right: 20px;
    line-height: 1;
    transition: color 0.3s ease;
    pointer-events: none;
}

.note:hover .note-number {
    color: rgba(194, 42, 61, 0.15);
}

.note h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    line-height: 1.4;
    border: none;
    padding: 0;
    transition: color 0.3s ease;
}

.note:hover h3 {
    color: var(--color-primary);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
}

.tag {
    font-family: 'Courier New', Courier, monospace;
    padding: 3px 10px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: var(--color-text);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.note:hover .tag {
    background: rgba(194, 42, 61, 0.08);
    border-color: rgba(194, 42, 61, 0.2);
    color: var(--color-primary);
}

.note p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--color-text);
}

.note > a {
    text-align: right;
    color: var(--color-primary);
    text-decoration: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.note:hover > a {
    opacity: 1;
}

.note > a i {
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.note:hover > a i {
    transform: translateX(3px);
}

/* --- Article Count --- */

.article-count {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 8px;
    letter-spacing: 1px;
}

.article-count span {
    color: var(--color-primary);
    font-weight: 700;
}

/* --- Footer --- */

footer {
    border-top: 1px solid rgba(194, 42, 61, 0.2);
    padding: 24px 0;
    width: 100%;
    color: var(--color-text-muted);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    margin-top: auto;
}

/* --- Responsive: Tablet --- */

@media screen and (max-width: 768px) {
    .container {
        padding: 0;
    }

    nav {
        margin: 0;
        width: 100%;
        padding: 12px 16px;
    }

    .page-header {
        padding: 30px 16px 15px;
    }

    .page-header h1 {
        font-size: 40px;
        letter-spacing: 0.2rem;
    }

    .page-header p {
        font-size: 0.82rem;
    }

    .notes {
        padding: 0 16px;
    }

    .note {
        padding: 18px 14px;
    }

    .note h3 {
        font-size: 1.1rem;
        padding-right: 30px;
    }

    .note-number {
        font-size: 1.5rem;
        top: 10px;
        right: 14px;
    }

    .article-count {
        padding: 0 16px;
    }

    footer {
        padding: 24px 16px;
    }
}

/* --- Responsive: Mobile --- */

@media screen and (max-width: 480px) {
    nav {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }

    .nav-brand {
        font-size: 13px;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-links a {
        font-size: 12px;
        padding: 4px 6px;
    }

    .page-header {
        padding: 20px 12px 10px;
    }

    .page-header h1 {
        font-size: 28px;
        letter-spacing: 0.1rem;
    }

    .notes {
        gap: 12px;
        padding: 0 12px;
    }

    .note {
        padding: 14px 12px;
    }

    .note h3 {
        font-size: 0.95rem;
    }

    .note p {
        font-size: 0.8rem;
    }

    .note > a {
        font-size: 0.78rem;
    }

    .note-meta {
        gap: 10px;
    }

    .note .date {
        font-size: 0.7rem;
    }

    .tag {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
}
