/* ===== CSS Custom Properties ===== */
:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f6f6;
    --bg-card: #ffffff;
    --bg-code: #1e1e2e;
    --text-primary: #1d1d1d;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-code: #cdd6f4;
    --border: rgba(29, 29, 29, 0.08);
    --border-strong: rgba(29, 29, 29, 0.15);
    --accent: #7c5cfc;
    --accent-hover: #6344e0;
    --accent-light: rgba(124, 92, 252, 0.08);
    --accent-soft: rgba(124, 92, 252, 0.12);
    --aws-orange: #ff9900;
    --tag-bg: #f0edff;
    --tag-text: #6344e0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --header-bg: #1d1d1d;
    --header-text: #ffffff;
}

:root[data-theme="dark"] {
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-code: #161622;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --text-code: #cdd6f4;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --accent: #9b82fc;
    --accent-hover: #b0a0ff;
    --accent-light: rgba(155, 130, 252, 0.1);
    --accent-soft: rgba(155, 130, 252, 0.15);
    --aws-orange: #ff9900;
    --tag-bg: rgba(155, 130, 252, 0.15);
    --tag-text: #b0a0ff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --header-bg: #0a0a0a;
    --header-text: #ffffff;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }

/* ===== Header ===== */
header {
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--header-text);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.3px;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #fff; }

.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 7px 14px;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}
.nav-search:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.nav-search kbd {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-family: inherit;
}

.theme-toggle {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    margin-left: 4px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ===== Search Modal ===== */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    justify-content: center;
    padding-top: 120px;
}
.search-overlay.active { display: flex; }

.search-modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 580px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: 400px;
}

.search-modal-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.search-modal-input svg { color: var(--text-muted); flex-shrink: 0; }

.search-modal-input input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}
.search-modal-input input::placeholder { color: var(--text-muted); }

.search-results-list { padding: 8px; max-height: 300px; overflow-y: auto; }

.search-result-item {
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.search-result-item:hover { background: var(--accent-light); }
.search-result-item .sr-cat { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); font-weight: 600; }
.search-result-item .sr-title { font-size: 0.9rem; font-weight: 600; margin-top: 2px; }

/* ===== Category Filter ===== */
.filter-bar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 40px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    color: var(--text-secondary);
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== Hero / Featured Post ===== */
.hero {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 40px;
}

.hero-card {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s;
}
.hero-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.hero-image {
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #232946 0%, #3a1c71 50%, #d76d77 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hero-card:hover .hero-image img {
    transform: scale(1.03);
}

.hero-image-content {
    color: rgba(255,255,255,0.9);
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    padding: 40px;
    line-height: 1.1;
}

.hero-image-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
}

.hero-body {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-body .category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
    margin-bottom: 16px;
}

.hero-body h2 {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.hero-body .excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hero-meta .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.hero-meta .author-name { font-weight: 600; color: var(--text-primary); }
.hero-meta .dot { color: var(--text-muted); }

@media (max-width: 768px) {
    .hero-card { grid-template-columns: 1fr; }
    .hero-image { aspect-ratio: 16/9; }
    .hero-body { padding: 24px; }
}

/* ===== Post Grid ===== */
.posts-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 40px 60px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-header .see-all {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}
.section-header .see-all:hover { color: var(--accent-hover); }

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }
    .header-inner, .hero, .posts-section, .filter-bar { padding-left: 20px; padding-right: 20px; }
}

/* ===== Post Card (Riverside style) ===== */
.post-card {
    background: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.post-card:hover .card-image img {
    transform: scale(1.05);
}

.card-image {
    aspect-ratio: 2/1;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Placeholder gradient images */
.card-image .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 2rem;
    font-weight: 800;
}
.gradient-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.gradient-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.gradient-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.gradient-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.gradient-5 { background: linear-gradient(135deg, #fa709a, #fee140); }
.gradient-6 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }

.card-body {
    padding: 20px;
}

.card-body .category-pill {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 3px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

.card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.2px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body .excerpt {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-meta .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.card-meta .meta-text .author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.card-meta .meta-text .date-read {
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* ===== Post Detail View ===== */
.detail-view { display: none; }
.detail-view.active { display: block; }

.detail-hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 40px 32px;
}

.detail-hero .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 24px;
    transition: color 0.2s;
}
.detail-hero .back-link:hover { color: var(--accent); }

.detail-hero .category-pill {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
}

.detail-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 16px;
    max-width: 800px;
}

.detail-hero .detail-excerpt {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 24px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.detail-meta .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.detail-meta .author-name { font-weight: 600; color: var(--text-primary); }
.detail-meta .meta-sub { color: var(--text-muted); font-size: 0.8rem; }

.detail-banner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 40px;
}

.detail-banner-image {
    width: 100%;
    aspect-ratio: 21/9;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #232946, #3a1c71, #d76d77);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.detail-banner-image .hero-image-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ===== Article Content ===== */
.detail-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 40px 60px;
}
.detail-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 16px;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}
.detail-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text-primary);
}
.detail-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 24px 0 8px;
    color: var(--text-primary);
}
.detail-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 20px;
}
.detail-content ul, .detail-content ol {
    margin: 0 0 20px 24px;
    color: var(--text-secondary);
}
.detail-content li {
    margin-bottom: 8px;
    line-height: 1.75;
    font-size: 1rem;
}
.detail-content strong { color: var(--text-primary); }
.detail-content p code, .detail-content li code {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.88em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.detail-content a {
    color: var(--accent);
    font-weight: 500;
}
.detail-content a:hover { color: var(--accent-hover); }
.detail-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}
.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.9rem;
}
.detail-content th {
    background: var(--bg-secondary);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border-strong);
}
.detail-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.tag-pill {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.2s;
}
.tag-pill:hover { background: var(--accent-soft); }

.article-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 40px 60px;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 16px;
    letter-spacing: -0.3px;
}

.article-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 32px 0 12px;
}

.article-body p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 20px;
}

.article-body ul, .article-body ol {
    margin: 0 0 20px 24px;
    color: var(--text-secondary);
}

.article-body li {
    margin-bottom: 8px;
    line-height: 1.75;
    font-size: 1rem;
}

.article-body strong { color: var(--text-primary); }

.article-body p code {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.88em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ===== Code Blocks ===== */
pre {
    background: var(--bg-code);
    color: var(--text-code);
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    margin-bottom: 24px;
    font-size: 0.85rem;
    line-height: 1.7;
    position: relative;
}

pre .lang-label {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #6c7086;
    font-weight: 600;
    letter-spacing: 0.5px;
}

code { font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace; }

.kw { color: #cba6f7; }
.fn { color: #89b4fa; }
.st { color: #a6e3a1; }
.cm { color: #6c7086; font-style: italic; }
.nu { color: #fab387; }
.op { color: #89dceb; }
.dc { color: #f9e2af; }
.bi { color: #f38ba8; }
.ty { color: #f9e2af; }
.vr { color: #cdd6f4; }

/* ===== Callout ===== */
.callout {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
    padding: 18px 22px;
    margin-bottom: 24px;
}
.callout p { color: var(--text-primary); margin: 0; font-size: 0.95rem; }
.callout a { color: var(--accent); font-weight: 600; }
.callout a:hover { text-decoration: underline; }

/* ===== Tags in article ===== */
.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-tag {
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ===== Comments Section ===== */
.comments-section {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 40px 60px;
}

.comments-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

.comment {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-header .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

.comment-author { font-weight: 600; font-size: 0.9rem; }
.comment-date { font-size: 0.78rem; color: var(--text-muted); }
.comment-body { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; padding-left: 42px; }

.comment-form {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
}
.comment-form h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

.form-group { margin-bottom: 12px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-group textarea { min-height: 100px; resize: vertical; }

.btn-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 28px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-submit:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,92,252,0.3); }

/* ===== Footer ===== */
footer {
    background: var(--header-bg);
    color: rgba(255,255,255,0.5);
    padding: 48px 40px;
    margin-top: 20px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 0.82rem; line-height: 1.6; color: rgba(255,255,255,0.4); }

.footer-col h4 {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 14px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.4); font-size: 0.82rem; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }

.footer-bottom {
    max-width: 1280px;
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    text-align: center;
}

/* ===== Skip to Content (Accessibility) ===== */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 999;
}
.skip-to-content:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    z-index: 999;
}

/* ===== Disclaimer Banner ===== */
.disclaimer-banner {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 8px 40px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== AI Pulse Section ===== */
.ai-pulse-preview {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 40px 0;
}
.ai-pulse-preview h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 20px;
}
.ai-pulse-preview h2 a { color: var(--text-primary); }
.ai-pulse-preview h2 a:hover { color: var(--accent); }

.ai-pulse-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.ai-pulse-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}
.ai-pulse-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.ai-pulse-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ai-pulse-item-header img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ai-pulse-item-headline {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}
.ai-pulse-item-headline:hover { color: var(--accent); }

.ai-pulse-source {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ai-pulse-description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
}

.ai-pulse-view-all {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 8px;
}
.ai-pulse-view-all:hover { color: var(--accent-hover); }

.ai-pulse-disclaimer {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 16px;
}

/* AI Pulse full digest page */
.ai-pulse-full { max-width: 820px; margin: 0 auto; padding: 32px 40px 60px; }
.ai-pulse-full .ai-pulse-item { margin-bottom: 16px; border-left-width: 3px; }
.ai-pulse-full .ai-pulse-item .ai-pulse-description { margin-top: 8px; }
.ai-pulse-full .ai-pulse-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 8px;
}
.ai-pulse-full .ai-pulse-link:hover { color: var(--accent-hover); }

/* AI Pulse archive page */
.ai-pulse-archive { max-width: 1280px; margin: 0 auto; padding: 32px 40px 60px; }
.ai-pulse-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.ai-pulse-archive-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s, transform 0.3s;
}
.ai-pulse-archive-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.ai-pulse-archive-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.ai-pulse-archive-card h3 a { color: var(--text-primary); }
.ai-pulse-archive-card h3 a:hover { color: var(--accent); }
.ai-pulse-archive-card .preview-items { list-style: none; }
.ai-pulse-archive-card .preview-items li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.ai-pulse-archive-card .preview-items li:last-child { border-bottom: none; }

/* AI Pulse nav between days */
.ai-pulse-nav {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}
.ai-pulse-nav a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}
.ai-pulse-nav a:hover { color: var(--accent-hover); }

/* ===== Roadmap Page ===== */
.roadmap-page { max-width: 820px; margin: 0 auto; padding: 32px 40px 60px; }
.roadmap-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }

.suggestion-form {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin: 24px 0;
}
.suggestion-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.suggestion-form input,
.suggestion-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}
.suggestion-form input:focus,
.suggestion-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.suggestion-form textarea { min-height: 80px; resize: vertical; }
.suggestion-form button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.suggestion-form button:hover { background: var(--accent-hover); }
.suggestion-form .honeypot { position: absolute; left: -9999px; }

.suggestion-cards { margin-top: 32px; }
.suggestion-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.suggestion-card .suggestion-title { font-weight: 600; font-size: 0.95rem; }
.suggestion-card .suggestion-desc { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }

/* ===== Table Overflow (mobile scrollable) ===== */
.table-wrapper { overflow-x: auto; margin: 1.5rem 0; }
.table-wrapper table { min-width: 600px; }

/* ===== Blockquote ===== */
.detail-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 1.5rem 0;
    background: var(--accent-light);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Print Stylesheet ===== */
@media print {
    header, footer, .theme-toggle, .search-overlay, .filter-bar,
    .disclaimer-banner, .nav-search, .ai-pulse-preview { display: none !important; }
    body { background: #fff; color: #000; }
    .detail-content a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
    .detail-content pre, .detail-content code { page-break-inside: avoid; }
    .detail-content { max-width: 100%; padding: 0; }
}

/* ===== Responsive tweaks ===== */
@media (max-width: 640px) {
    .disclaimer-banner { padding: 8px 20px; }
    .ai-pulse-preview { padding: 24px 20px 0; }
    .ai-pulse-items { grid-template-columns: 1fr; }
    .ai-pulse-full, .roadmap-page { padding: 24px 20px 40px; }
    .ai-pulse-archive { padding: 24px 20px 40px; }
    .ai-pulse-archive-grid { grid-template-columns: 1fr; }
    .detail-hero { padding: 24px 20px 0; }
    .detail-content { padding: 0 20px 40px; }
    .detail-hero h1 { font-size: 1.6rem; }
}
