:root {
    /* Rich editorial palette */
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-card: #141414;
    --surface-hover: #1a1a1a;
    --text-primary: #f5f5f5;
    --text-secondary: #888888;
    --text-muted: #555555;
    --accent: #e63946;
    --accent-subtle: #e6394633;
    --link: #a8dadc;
    --link-hover: #f1faee;
    --border: #222222;
    --border-subtle: #1a1a1a;

    /* Typography - Editorial sophistication */
    --font-heading: 'Fraunces', Georgia, serif;
    --font-body: 'Newsreader', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
}

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

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Header - Editorial masthead */
.site-header {
    padding: var(--space-xl) 0 var(--space-lg);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-xl);
    position: relative;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 120px;
    height: 3px;
    background: var(--accent);
}

.site-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 300;
    font-variation-settings: 'SOFT' 50, 'WONK' 0;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: var(--space-xs);
    animation: mastheadReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.site-tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-lg);
    animation: mastheadReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.site-nav {
    display: flex;
    gap: var(--space-lg);
    animation: mastheadReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.25s ease;
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-nav a:hover {
    color: var(--text-primary);
}

.site-nav a:hover::after {
    width: 100%;
}

/* Main content */
main {
    flex: 1;
    padding-bottom: var(--space-xl);
}

/* Brief Card - Editorial feature */
.brief-card {
    animation: cardReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.brief-header {
    margin-bottom: var(--space-lg);
    position: relative;
}

.brief-date {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
    padding-left: var(--space-xs);
    border-left: 2px solid var(--accent);
}

.brief-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 400;
    font-variation-settings: 'SOFT' 30, 'WONK' 0;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.brief-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin-top: var(--space-md);
}

/* Link List - Refined editorial style */
.link-list {
    list-style: none;
    margin-top: var(--space-lg);
}

.link-item {
    position: relative;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.3s ease;
}

.link-item:first-child {
    padding-top: 0;
}

.link-item:last-child {
    border-bottom: none;
}

.link-item a {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-md);
    text-decoration: none;
    color: var(--text-primary);
    padding: var(--space-sm);
    margin: calc(var(--space-sm) * -1);
    border-radius: 8px;
    transition: background-color 0.25s ease;
}

.link-item a:hover {
    background-color: var(--surface-hover);
}

.link-item a:hover .link-title {
    color: var(--link-hover);
}

.link-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: 6px;
    color: var(--accent);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
}

.link-item a:hover .link-icon {
    transform: scale(1.1) rotate(-5deg);
    background: var(--accent);
    color: var(--bg);
}

.link-icon svg {
    width: 16px;
    height: 16px;
}

.link-content {
    min-width: 0;
}

.link-title {
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    transition: color 0.25s ease;
    line-height: 1.4;
}

.link-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.link-domain {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: lowercase;
}

.link-domain::before {
    content: '→';
    margin-right: 0.35em;
    color: var(--accent);
    opacity: 0.6;
}

.link-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--text-secondary);
    animation: fadeIn 0.6s ease-out;
}

.empty-state h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

/* Archive */
.archive-section {
    animation: cardReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.archive-month {
    margin-bottom: var(--space-lg);
}

.archive-month-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border);
    font-weight: 400;
    font-style: italic;
}

.archive-list {
    list-style: none;
}

.archive-item {
    padding: var(--space-sm) 0;
}

.archive-item a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    margin-left: calc(var(--space-sm) * -1);
    border-radius: 6px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.archive-item a:hover {
    background-color: var(--surface-hover);
    color: var(--link-hover);
}

.archive-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.archive-title {
    font-weight: 400;
    font-size: 0.95rem;
}

/* About Page */
.about-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--space-lg);
    border: 1px solid var(--border);
    animation: cardReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.about-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    font-variation-settings: 'SOFT' 30, 'WONK' 0;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.about-content h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 400;
    margin: var(--space-lg) 0 var(--space-sm);
    color: var(--text-primary);
}

.about-content h2:first-of-type {
    margin-top: 0;
}

.about-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    font-variation-settings: 'SOFT' 30, 'WONK' 0;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
}

.about-content code {
    font-family: var(--font-mono);
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--link);
}

.about-content a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease;
}

.about-content a:hover {
    border-bottom-color: var(--link);
}

/* Footer */
.site-footer {
    padding: var(--space-lg) 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.25s ease;
}

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

/* Animations */
@keyframes mastheadReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Staggered link animations */
.link-item {
    opacity: 0;
    animation: linkReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.link-item:nth-child(1) { animation-delay: 0.4s; }
.link-item:nth-child(2) { animation-delay: 0.5s; }
.link-item:nth-child(3) { animation-delay: 0.6s; }
.link-item:nth-child(4) { animation-delay: 0.7s; }
.link-item:nth-child(5) { animation-delay: 0.8s; }

@keyframes linkReveal {
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 640px) {
    :root {
        --space-xl: 2.5rem;
        --space-lg: 1.75rem;
    }

    html {
        font-size: 16px;
    }

    .site-header {
        padding: var(--space-lg) 0 var(--space-md);
    }

    .site-nav {
        gap: var(--space-md);
    }

    .link-item a {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .link-icon {
        width: 28px;
        height: 28px;
    }

    .archive-item a {
        flex-direction: column;
        gap: 0.25rem;
    }

    .about-content {
        padding: var(--space-md);
    }
}

/* Selection */
::selection {
    background: var(--accent-subtle);
    color: var(--text-primary);
}
