/* =========================================
   CognioNews — Dark Gold Aesthetic
   Solutionalized, not sensationalized.
   ========================================= */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0c14;
    --bg-secondary: #0f1219;
    --bg-card: rgba(15, 18, 25, 0.8);
    --bg-card-hover: rgba(20, 24, 35, 0.9);
    --gold: #E5B75F;
    --gold-hover: #F0C96B;
    --gold-dim: rgba(229, 183, 95, 0.15);
    --gold-border: rgba(229, 183, 95, 0.25);
    --gold-glow: rgba(229, 183, 95, 0.08);
    --fg: #e0e0e0;
    --fg-muted: #888;
    --fg-dim: #555;
    --red: #e55f5f;
    --green: #5fe5a0;
    --blue: #5f9ee5;
    --purple: #a55fe5;
    --orange: #e5915f;
    --teal: #5fe5d4;
    --pink: #e55fa5;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--fg);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--gold-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--fg);
    line-height: 1.3;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

.text-gold { color: var(--gold); }
.text-muted { color: var(--fg-muted); }

/* === NEWS TICKER === */
.ticker-wrap {
    background: linear-gradient(90deg, var(--bg-secondary), rgba(229, 183, 95, 0.05), var(--bg-secondary));
    border-bottom: 1px solid var(--gold-border);
    overflow: hidden;
    white-space: nowrap;
    padding: 10px 0;
    position: relative;
}

.ticker-wrap::before {
    content: 'LATEST';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--gold);
    color: var(--bg-primary);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    z-index: 2;
}

.ticker {
    display: inline-block;
    padding-left: 80px;
    animation: ticker-scroll 60s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 40px;
    font-size: 0.9rem;
    color: var(--fg-muted);
}

.ticker-item .ticker-gold {
    color: var(--gold);
    font-weight: 600;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === NAVIGATION === */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(10, 12, 20, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gold-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.nav-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-weight: 900;
    font-size: 1.1rem;
    font-family: var(--font-serif);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: var(--fg-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
}

/* === HERO SECTION === */
.hero {
    text-align: center;
    padding: 80px 24px 60px;
    background: radial-gradient(ellipse at 50% 0%, var(--gold-glow) 0%, transparent 60%);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23E5B75F' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--gold);
    margin-bottom: 16px;
    position: relative;
}

.hero .tagline {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--fg-muted);
    font-style: italic;
    margin-bottom: 24px;
}

.hero .description {
    max-width: 700px;
    margin: 0 auto 32px;
    color: var(--fg-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* === SEARCH & FILTERS === */
.controls {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 32px;
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

.search-bar input::placeholder {
    color: var(--fg-dim);
}

.search-bar button {
    padding: 12px 24px;
    background: var(--gold);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.search-bar button:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
}

.topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-btn {
    padding: 8px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    border-radius: 50px;
    color: var(--fg-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.topic-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}

.topic-btn.active {
    background: var(--gold);
    color: var(--bg-primary);
    border-color: var(--gold);
    font-weight: 600;
}

/* === STORY GRID === */
.stories-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 60px;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.story-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 0 30px var(--gold-glow);
}

.story-card:hover::before {
    opacity: 1;
}

.story-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}

.topic-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.topic-badge.climate     { background: rgba(95, 229, 160, 0.15); color: var(--green); }
.topic-badge.ai          { background: rgba(165, 95, 229, 0.15); color: var(--purple); }
.topic-badge.conflict    { background: rgba(229, 95, 95, 0.15);  color: var(--red); }
.topic-badge.economy     { background: rgba(229, 183, 95, 0.15); color: var(--gold); }
.topic-badge.health      { background: rgba(95, 158, 229, 0.15); color: var(--blue); }
.topic-badge.society     { background: rgba(229, 95, 165, 0.15); color: var(--pink); }
.topic-badge.science     { background: rgba(95, 229, 212, 0.15); color: var(--teal); }
.topic-badge.technology  { background: rgba(229, 145, 95, 0.15); color: var(--orange); }
.topic-badge.general     { background: rgba(136, 136, 136, 0.15); color: var(--fg-muted); }

.card-date {
    font-size: 0.8rem;
    color: var(--fg-dim);
}

.card-source {
    font-size: 0.8rem;
    color: var(--fg-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-source::before {
    content: '◈';
    color: var(--gold-dim);
}

.story-card h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--fg);
    transition: color var(--transition);
}

.story-card:hover h3 {
    color: var(--gold);
}

.card-summary {
    font-size: 0.9rem;
    color: var(--fg-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-original {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(229, 183, 95, 0.1);
    font-size: 0.8rem;
    color: var(--fg-dim);
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-original::before {
    content: 'Original: ';
    color: var(--fg-muted);
    font-style: normal;
    font-weight: 600;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.page-btn {
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-sm);
    color: var(--fg-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
}

.page-btn.active {
    background: var(--gold);
    color: var(--bg-primary);
    border-color: var(--gold);
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    color: var(--fg-muted);
    font-size: 0.9rem;
    padding: 0 12px;
}

/* === LOADING / EMPTY STATES === */
.loading {
    text-align: center;
    padding: 80px 24px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gold-border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--fg-muted);
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 80px 24px;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--fg-muted);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--fg-dim);
}

/* === STORY DETAIL PAGE === */
.story-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.story-detail .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
    transition: color var(--transition);
}

.story-detail .back-link:hover {
    color: var(--gold);
}

.story-detail .story-header {
    margin-bottom: 40px;
}

.story-detail .story-header h1 {
    color: var(--gold);
    margin-bottom: 16px;
}

.story-detail .story-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.story-detail .executive-summary {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    font-size: 1.1rem;
    line-height: 1.8;
    border-left: 4px solid var(--gold);
}

.story-detail .pka {
    background: rgba(229, 95, 95, 0.05);
    border: 1px solid rgba(229, 95, 95, 0.2);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
}

.story-detail .pka h3 {
    color: var(--red);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === DIMENSION SECTIONS === */
.dimensions-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 40px;
}

.dimension-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}

.dimension-card:hover {
    border-color: var(--gold);
}

.dimension-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    transition: background var(--transition);
}

.dimension-header:hover {
    background: var(--gold-glow);
}

.dimension-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
}

.dimension-icon {
    font-size: 1.2rem;
}

.dimension-toggle {
    color: var(--fg-muted);
    font-size: 1.2rem;
    transition: transform var(--transition);
}

.dimension-card.open .dimension-toggle {
    transform: rotate(180deg);
}

.dimension-body {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.dimension-card.open .dimension-body {
    padding: 0 24px 24px;
    max-height: 500px;
}

.dimension-body p {
    color: var(--fg-muted);
    line-height: 1.7;
}

/* === SOLUTION PATHWAYS === */
.solutions-section {
    margin-bottom: 40px;
}

.solutions-section h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.solution-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.solution-card {
    background: linear-gradient(135deg, var(--gold-glow), var(--bg-card));
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.solution-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gold);
}

.solution-card .solution-number {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--gold-dim);
    font-weight: 700;
    margin-bottom: 8px;
}

.solution-card p {
    color: var(--fg);
    line-height: 1.6;
}

/* === WHAT'S MISSING === */
.whats-missing {
    background: rgba(229, 183, 95, 0.04);
    border: 1px dashed var(--gold-border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 40px;
}

.whats-missing h3 {
    color: var(--gold);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whats-missing p {
    color: var(--fg-muted);
    line-height: 1.8;
}

/* === SYNTHESIS === */
.synthesis-section {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 40px;
}

.synthesis-section h2 {
    color: var(--gold);
    margin-bottom: 16px;
}

.synthesis-section p {
    line-height: 1.8;
    color: var(--fg);
}

/* === ORIGINAL STORY LINK === */
.original-link {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
    transition: border-color var(--transition);
}

.original-link:hover {
    border-color: var(--gold);
}

.original-link .link-icon {
    font-size: 1.5rem;
    color: var(--gold);
}

.original-link .link-text {
    flex: 1;
}

.original-link .link-label {
    font-size: 0.8rem;
    color: var(--fg-muted);
    margin-bottom: 4px;
}

.original-link .link-url {
    color: var(--gold);
    font-size: 0.9rem;
    word-break: break-all;
}

/* === SHARE BUTTONS === */
.share-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.share-section span {
    color: var(--fg-muted);
    font-size: 0.9rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    color: var(--fg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
}

.share-btn:hover {
    background: var(--gold);
    color: var(--bg-primary);
    border-color: var(--gold);
}

/* === ABOUT PAGE === */
.about-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.about-page h1 {
    color: var(--gold);
    margin-bottom: 32px;
}

.about-page h2 {
    color: var(--gold);
    margin: 40px 0 16px;
}

.about-page p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.principle-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: border-color var(--transition);
}

.principle-card:hover {
    border-color: var(--gold);
}

.principle-card h4 {
    color: var(--gold);
    font-family: var(--font-sans);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.principle-card .principle-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gold);
    color: var(--bg-primary);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.principle-card p {
    color: var(--fg-muted);
    margin: 0;
}

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

.dimension-list li {
    padding: 16px 0;
    border-bottom: 1px solid rgba(229, 183, 95, 0.1);
    display: flex;
    gap: 12px;
}

.dimension-list li:last-child {
    border-bottom: none;
}

.dimension-list .dim-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.dimension-list .dim-name {
    font-weight: 600;
    color: var(--gold);
    display: block;
    margin-bottom: 4px;
}

.dimension-list .dim-desc {
    color: var(--fg-muted);
    font-size: 0.95rem;
}

/* === SUBMIT PAGE === */
.submit-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.submit-page h1 {
    color: var(--gold);
    margin-bottom: 12px;
}

.submit-page .subtitle {
    color: var(--fg-muted);
    margin-bottom: 40px;
    font-size: 1.05rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--fg);
    font-size: 0.95rem;
}

.form-group label .optional {
    color: var(--fg-dim);
    font-weight: 400;
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--gold);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.submit-btn:hover:not(:disabled) {
    background: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(229, 183, 95, 0.3);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-result {
    margin-top: 24px;
    padding: 20px;
    border-radius: var(--radius);
    display: none;
}

.submit-result.success {
    display: block;
    background: rgba(95, 229, 160, 0.1);
    border: 1px solid rgba(95, 229, 160, 0.3);
    color: var(--green);
}

.submit-result.error {
    display: block;
    background: rgba(229, 95, 95, 0.1);
    border: 1px solid rgba(229, 95, 95, 0.3);
    color: var(--red);
}

/* === FOOTER === */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--gold-border);
    padding: 48px 24px;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 12px;
}

.footer-tagline {
    color: var(--fg-muted);
    font-style: italic;
    margin-bottom: 24px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--fg-muted);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-copy {
    color: var(--fg-dim);
    font-size: 0.8rem;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--gold-border);
        flex-direction: column;
        padding: 16px 24px;
        gap: 16px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero {
        padding: 50px 20px 40px;
    }

    .stories-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .story-card {
        padding: 20px;
    }

    .search-bar {
        flex-direction: column;
    }

    .topic-filters {
        justify-content: center;
    }

    .solution-cards {
        grid-template-columns: 1fr;
    }

    .story-detail .story-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-section {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .nav {
        padding: 12px 16px;
    }

    .nav-brand {
        font-size: 1.2rem;
    }

    .story-detail {
        padding: 24px 16px 60px;
    }

    .about-page,
    .submit-page {
        padding: 24px 16px 60px;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.story-card {
    animation: fadeIn 0.4s ease forwards;
}

.stories-grid .story-card:nth-child(1) { animation-delay: 0.05s; }
.stories-grid .story-card:nth-child(2) { animation-delay: 0.10s; }
.stories-grid .story-card:nth-child(3) { animation-delay: 0.15s; }
.stories-grid .story-card:nth-child(4) { animation-delay: 0.20s; }
.stories-grid .story-card:nth-child(5) { animation-delay: 0.25s; }
.stories-grid .story-card:nth-child(6) { animation-delay: 0.30s; }
.stories-grid .story-card:nth-child(7) { animation-delay: 0.35s; }
.stories-grid .story-card:nth-child(8) { animation-delay: 0.40s; }
.stories-grid .story-card:nth-child(9) { animation-delay: 0.45s; }

/* === UTILITIES === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Selection */
::selection {
    background: var(--gold);
    color: var(--bg-primary);
}

/* === NEWSLETTER SUBSCRIBE === */
.newsletter-section {
    max-width: var(--max-width);
    margin: 0 auto 40px;
    padding: 0 24px;
}

.newsletter-inner {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.newsletter-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0.6;
}

.newsletter-icon {
    font-size: 28px;
    color: var(--gold);
    margin-bottom: 14px;
    opacity: 0.8;
}

.newsletter-title {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 400;
    color: var(--fg);
    margin-bottom: 10px;
}

.newsletter-desc {
    color: var(--fg-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 24px;
}

.newsletter-form {
    max-width: 440px;
    margin: 0 auto;
}

.newsletter-input-group {
    display: flex;
    gap: 12px;
}

.newsletter-input-group input {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.newsletter-input-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
}

.newsletter-input-group input::placeholder {
    color: var(--fg-dim);
}

.newsletter-input-group button {
    padding: 12px 24px;
    background: var(--gold);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}

.newsletter-input-group button:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
}

.newsletter-input-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.newsletter-status {
    margin-top: 12px;
    font-size: 0.85rem;
    min-height: 20px;
}

.newsletter-status.success {
    color: var(--green);
}

.newsletter-status.error {
    color: var(--red);
}

.newsletter-note {
    color: var(--fg-dim);
    font-size: 0.8rem;
    margin-top: 12px;
}

/* Nav subscribe link */
.nav-subscribe {
    color: var(--gold) !important;
    font-weight: 600 !important;
}

/* Footer subscribe */
.footer-subscribe {
    max-width: 400px;
    margin: 20px auto;
}

.footer-subscribe-form {
    display: flex;
    gap: 12px;
}

.footer-subscribe-form input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-sm);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.footer-subscribe-form input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}

.footer-subscribe-form input::placeholder {
    color: var(--fg-dim);
}

.footer-subscribe-form button {
    padding: 10px 20px;
    background: var(--gold);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.footer-subscribe-form button:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
}

.footer-subscribe-status {
    font-size: 0.8rem;
    margin-top: 8px;
    text-align: center;
    min-height: 16px;
}

.footer-subscribe-status.success {
    color: var(--green);
}

.footer-subscribe-status.error {
    color: var(--red);
}

/* Mobile responsive - newsletter */
@media (max-width: 600px) {
    .newsletter-inner {
        padding: 32px 20px;
    }
    .newsletter-input-group {
        flex-direction: column;
    }
    .footer-subscribe-form {
        flex-direction: column;
    }
}
