@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@400;500&display=swap');

:root {
    /* Themes - Default Dark (Neon Luminary) */
    --primary: #155dfc;
    --primary-glow: rgba(21, 93, 252, 0.4);
    --primary-bright: #3b82f6;
    --accent: #2563eb;

    --bg-main: #0f172a;
    --bg-gradient-1: rgba(21, 93, 252, 0.12);
    --bg-gradient-2: rgba(37, 99, 235, 0.08);

    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-controls: rgba(255, 255, 255, 0.03);

    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-bright: rgba(255, 255, 255, 0.15);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-article: #cbd5e1;
    --text-on-hover: #ffffff;
    --title-gradient: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);

    --card-shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --card-shadow-hover-glow: 0 0 20px rgba(99, 102, 241, 0.1);

    /* Shared Tokens */
    --container-max-width: 1100px;
    --section-padding: clamp(2rem, 8vw, 5rem);
    --card-padding: clamp(1.5rem, 4vw, 2rem);
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode {
    /* Solar Luminary Palette - High contrast, soft depth */
    --bg-main: #f8fafc;
    --bg-gradient-1: rgba(21, 93, 252, 0.05);
    --bg-gradient-2: rgba(37, 99, 235, 0.04);

    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: #ffffff;
    --bg-controls: rgba(0, 0, 0, 0.02);

    --border-glass: rgba(0, 0, 0, 0.06);
    --border-glass-bright: rgba(0, 0, 0, 0.1);

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-article: #334155;
    --text-on-hover: var(--primary);
    --title-gradient: linear-gradient(135deg, #0f172a 0%, #475569 100%);

    --card-shadow-hover: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
    --card-shadow-hover-glow: 0 0 15px rgba(21, 93, 252, 0.04);
}

@media (max-width: 768px) {
    :root {
        --section-padding: 1.5rem;
        --card-padding: 1.25rem;
    }
}

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

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 0% 0%, var(--bg-gradient-1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--bg-gradient-2) 0px, transparent 50%);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
.branding h1 {
    font-family: 'Outfit', sans-serif;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 2rem);
}

/* Header */
.main-header {
    padding: var(--section-padding) 0 1.5rem;
    position: relative;
}

.branding {
    text-align: center;
}

.branding h1 {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    font-weight: 700;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    line-height: 1;
}

.profile-avatar {
    width: clamp(60px, 12vw, 110px);
    height: clamp(60px, 12vw, 110px);
    border-radius: 50%;
    border: 3px solid var(--primary);
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 30px var(--primary-glow);
    object-fit: cover;
    display: block;
    background: var(--bg-card);
    transition: transform var(--transition-fast);
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-avatar.sm {
    width: 48px;
    height: 48px;
    border-width: 2px;
    margin-bottom: 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.branding p {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--text-muted);
    font-weight: 300;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: pointer;
}

.back-link:hover {
    color: var(--primary-bright);
    transform: translateX(-6px);
}

/* Search & Filter Controls */
.search-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 auto 1.5rem;
    align-items: center;
    max-width: 900px;
    padding: 1rem;
    background: var(--bg-controls);
    border-radius: 20px;
    border: 1px solid var(--border-glass);
}

.search-container {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.filter-container {
    width: auto;
    min-width: 160px;
}

@media (max-width: 640px) {
    .filter-container {
        flex: 1;
    }
}

#search-input,
#year-filter {
    width: 100%;
    background: var(--bg-card);
    border: 1.5px solid var(--border-glass);
    padding: 1rem 1.4rem;
    border-radius: 14px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition-fast);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    -webkit-appearance: none;
    appearance: none;
}

#year-filter {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23155dfc'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1.25rem;
    padding-right: 3.5rem;
    cursor: pointer;
}

#search-input:focus,
#year-filter:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(21, 93, 252, 0.15);
    background: var(--bg-card-hover);
}

#year-filter option {
    background: var(--bg-main);
    color: var(--text-main);
}

/* Archive List */
.archive-list {
    padding-bottom: 6rem;
}

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-glass);
    padding-bottom: 0.75rem;
}

.archive-header h2 {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.posts-count {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

.no-results {
    padding: 5rem 2rem;
    text-align: center;
    background: var(--bg-card);
    border-radius: 24px;
    border: 2px dashed var(--border-glass);
    color: var(--text-muted);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 100%, 340px), 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    padding: var(--card-padding);
    border-radius: 20px;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
}

.post-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--border-glass-bright);
    background: var(--bg-card-hover);
    box-shadow: var(--card-shadow-hover), var(--card-shadow-hover-glow);
}

.post-date {
    font-size: 0.75rem;
    color: var(--primary-bright);
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.post-card h3 {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
    transition: color var(--transition-fast);
}

.post-card:hover h3 {
    color: var(--text-on-hover);
}

.post-card h3 a {
    color: inherit;
    text-decoration: none;
}

/* Post Content */
.post-content {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: clamp(2rem, 8vw, 4.5rem);
    margin-bottom: 6rem;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
}

article {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    color: var(--text-article);
    max-width: 75ch;
    margin: 0 auto;
}

article h1,
article h2,
article h3 {
    color: var(--text-main);
    margin: 3.5rem 0 1.5rem;
    line-height: 1.2;
}

article p {
    margin-bottom: 2.25rem;
}

article a {
    color: var(--primary-bright);
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 1px 0 0 transparent;
    transition: var(--transition-fast);
}

article a:hover {
    box-shadow: 0 1px 0 0 var(--primary-bright);
}

article img {
    border-radius: 16px;
    margin: 2rem 0;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-glass);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Video Containers */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 900px;
    margin: clamp(2.5rem, 5vw, 4rem) auto;
    background: #000;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glass-bright);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.theme-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
}

body.light-mode .theme-toggle {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .theme-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3rem;
        height: 3rem;
    }
}

/* Footer */
.main-footer {
    padding: 6rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Focus and Accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
}