/* CyberSeals - Amber CRT Theme
 * Inspired by IBM 5155 P3 phosphor display
 */

:root {
    /* Amber phosphor palette (P3 phosphor, similar to IBM 5155) */
    --crt-amber: #ffb000;
    --crt-amber-dim: #cc8800;
    --crt-amber-bright: #ffcc00;
    --crt-amber-glow: rgba(255, 176, 0, 0.5);

    /* Background */
    --crt-bg: #0a0a08;
    --crt-bg-scanline: rgba(0, 0, 0, 0.25);

    /* Text glow effect */
    --crt-text-shadow:
        0 0 1px var(--crt-amber-glow),
        0 0 2px var(--crt-amber-glow),
        0 0 4px var(--crt-amber-dim);

    /* Font stack */
    --font-mono: 'IBM Plex Mono', 'Consolas', 'Monaco', monospace;

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

/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-mono);
    background-color: var(--crt-bg);
    color: var(--crt-amber);
    line-height: 1.6;
}

/* Terminal text styling */
.terminal-text {
    font-family: var(--font-mono);
    color: var(--crt-amber);
    text-shadow: var(--crt-text-shadow);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--crt-amber-bright);
    margin-top: 0;
}

/* Links */
a {
    color: var(--crt-amber-bright);
    text-decoration: none;
}

a:hover {
    text-shadow: var(--crt-text-shadow);
}

a:focus {
    outline: 1px solid var(--crt-amber);
    outline-offset: 2px;
}

/* Form elements */
input,
button,
textarea,
select {
    font-family: var(--font-mono);
    background-color: var(--crt-bg);
    color: var(--crt-amber);
    border: 1px solid var(--crt-amber-dim);
    padding: var(--space-sm) var(--space-md);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--crt-amber);
    box-shadow: 0 0 4px var(--crt-amber-glow);
}

button {
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.15s, color 0.15s;
}

button:hover {
    background-color: var(--crt-amber);
    color: var(--crt-bg);
}

button:focus {
    outline: none;
    box-shadow: 0 0 4px var(--crt-amber-glow);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* Utility classes */
.text-dim {
    color: var(--crt-amber-dim);
}

.text-bright {
    color: var(--crt-amber-bright);
}

.glow {
    text-shadow: var(--crt-text-shadow);
}

/* ==========================================================================
   Visual Effects - CRT/Terminal Aesthetic
   ========================================================================== */

/* Phosphor glow enhancement */
.phosphor-glow {
    text-shadow:
        0 0 1px var(--crt-amber-glow),
        0 0 2px var(--crt-amber-glow),
        0 0 4px var(--crt-amber-dim),
        0 0 8px rgba(255, 176, 0, 0.2);
}

.phosphor-glow-bright {
    color: var(--crt-amber-bright);
    text-shadow:
        0 0 2px var(--crt-amber-glow),
        0 0 4px var(--crt-amber-glow),
        0 0 8px var(--crt-amber-dim),
        0 0 16px rgba(255, 176, 0, 0.3);
}

/* Scanline overlay */
.scanlines {
    position: relative;
}

.scanlines::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 100;
}

/* CRT screen curvature */
.crt-screen {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.crt-screen::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 60%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 50;
}

/* Staggered reveal animation */
.reveal-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
    animation-delay: calc(var(--i, 0) * 100ms);
}

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

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--crt-amber);
    white-space: nowrap;
    width: 0;
    animation:
        typing 3.5s steps(40, end) forwards,
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--crt-amber); }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .typewriter {
        animation: none;
        width: auto;
        border-right: none;
    }

    .reveal-item {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .scanlines::before {
        animation: none;
    }
}

/* ==========================================================================
   Landing Page Components
   ========================================================================== */

/* Hero title */
.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.15em;
    margin-bottom: 0;
}

/* Landing page responsive grid */
.landing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: var(--space-md);
}

@media (min-width: 768px) {
    .landing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .landing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Landing page stat blocks (scoped to prevent style bleed) */
.landing-stat {
    text-align: center;
    padding: var(--space-lg);
    background-color: rgba(255, 176, 0, 0.05);
    border: 1px solid var(--crt-amber-dim);
    border-radius: 4px;
}

.landing-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.landing-stat-cite {
    display: block;
    font-size: 0.85rem;
    margin-bottom: var(--space-xs);
}

.landing-stat-detail {
    display: block;
    font-size: 0.85rem;
}

/* "Why Terminal?" section description */
.landing-why-terminal {
    text-align: center;
    max-width: 650px;
    margin: 0 auto var(--space-md);
    line-height: 1.8;
}

/* Landing page footer */
.landing-footer {
}

.landing-footer-nav {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.landing-footer-nav a:hover {
    color: var(--crt-amber-bright);
}

/* Card component for armory */
.card {
    background-color: rgba(255, 176, 0, 0.05);
    border: 1px solid var(--crt-amber-dim);
    padding: var(--space-lg);
    border-radius: 4px;
}

.card:hover {
    border-color: var(--crt-amber);
    box-shadow: 0 0 8px var(--crt-amber-glow);
}

/* Section styling */
.section {
    padding: var(--space-xl) var(--space-md);
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-lg);
}

/* Hero section specific */
.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

/* CTA button */
.cta-button {
    display: inline-block;
    padding: var(--space-md) var(--space-xl);
    background-color: var(--crt-amber);
    color: var(--crt-bg);
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.cta-button:hover {
    background-color: var(--crt-amber-bright);
    box-shadow: 0 0 16px var(--crt-amber-glow);
}

/* ==========================================================================
   App Shell Layout
   ========================================================================== */

#app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent scrolling on the shell itself */
}

/* App header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background-color: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--crt-amber-dim);
    height: 48px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--crt-amber-bright);
    text-decoration: none;
}

.header-nav {
    display: flex;
    gap: var(--space-md);
}

.nav-link {
    color: var(--crt-amber-dim);
    text-decoration: none;
    padding: var(--space-xs) var(--space-sm);
    transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--crt-amber-bright);
    text-shadow: var(--crt-text-shadow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-username {
    color: var(--crt-amber);
}

.logout-form {
    margin: 0;
}

.logout-button {
    background: transparent;
    border: 1px solid var(--crt-amber-dim);
    color: var(--crt-amber-dim);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.logout-button:hover {
    border-color: var(--crt-amber);
    color: var(--crt-amber);
    background: transparent;
}

/* Terminal container - visibility toggle for persistence */
#terminal-container {
    flex: 1;
    position: relative;
    min-height: 0; /* Allow flex item to shrink below content size */
    height: calc(100vh - 48px); /* Full height minus header */
}

#terminal-container.visible {
    visibility: visible;
    display: flex;
}

#terminal-container.hidden {
    visibility: hidden;
    position: absolute;
    width: 100%;
    height: calc(100vh - 48px);
    z-index: -1;
}

#wetty-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
    border: none;
    background-color: var(--crt-bg);
}

/* Content area for non-terminal views */
#content-area {
    padding: var(--space-lg);
    overflow-y: auto;
}

/* Hide content area when empty (initial terminal view) */
#content-area:empty {
    display: none;
}

/* ==========================================================================
   Settings Page
   ========================================================================== */

#settings-view {
    max-width: 800px;
    margin: 0 auto;
}

#settings-view h1 {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.settings-section {
    background-color: rgba(255, 176, 0, 0.05);
    border: 1px solid var(--crt-amber-dim);
    border-radius: 4px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.settings-section h2 {
    color: var(--crt-amber);
    font-size: 1rem;
    margin-bottom: var(--space-md);
}

.settings-section p {
    margin: var(--space-sm) 0;
}

/* Return button styling */
#settings-view .cta-button {
    display: block;
    width: fit-content;
    margin: var(--space-xl) auto 0;
}

/* ==========================================================================
   Notification System
   ========================================================================== */

/* Notification container (relative positioning for dropdown) */
.notification-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: var(--space-md);
}

/* Bell button */
.notification-button {
    background: transparent;
    border: none;
    color: var(--crt-amber);
    padding: var(--space-xs);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.notification-button:hover,
.notification-button:focus {
    color: var(--crt-amber-bright);
    text-shadow: var(--crt-text-shadow);
}

.notification-button:focus {
    outline: 1px solid var(--crt-amber);
    outline-offset: 2px;
}

.notification-button .notification-bell {
    font-style: normal;
}

/* Badge styling */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--crt-amber);
    color: var(--crt-bg);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notification-badge.hidden {
    display: none;
}

/* Dropdown panel */
.notification-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--crt-bg);
    border: 1px solid var(--crt-amber-dim);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 200;
}

.notification-panel.hidden {
    display: none;
}

/* Panel header */
.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--crt-amber-dim);
}

.notification-panel-header .panel-title {
    font-weight: 700;
    color: var(--crt-amber-bright);
}

.notification-panel-header .mark-read-btn {
    background: transparent;
    border: 1px solid var(--crt-amber-dim);
    color: var(--crt-amber);
    font-size: 0.75rem;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 2px;
}

.notification-panel-header .mark-read-btn:hover {
    border-color: var(--crt-amber);
    color: var(--crt-amber-bright);
}

/* Notification list */
.notification-list {
    max-height: 340px;
    overflow-y: auto;
}

/* Notification item */
.notification-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid rgba(255, 176, 0, 0.1);
}

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

.notification-item:hover {
    background-color: rgba(255, 176, 0, 0.05);
}

.notification-item.unread {
    background-color: rgba(255, 176, 0, 0.1);
}

.notification-item .notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-item .notification-content {
    flex: 1;
    min-width: 0;
}

.notification-item .notification-title {
    font-weight: 700;
    color: var(--crt-amber-bright);
    margin-bottom: 2px;
}

.notification-item .notification-message {
    font-size: 0.85rem;
    color: var(--crt-amber);
    margin-bottom: 4px;
}

.notification-item .notification-time {
    font-size: 0.75rem;
    color: var(--crt-amber-dim);
}

/* Empty state */
.notification-empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--crt-amber-dim);
}

.notification-empty p {
    margin: 0 0 var(--space-xs) 0;
}

.notification-empty .notification-hint {
    font-size: 0.85rem;
}

/* ==========================================================================
   Article Content (scoped to prevent style bleed)
   ========================================================================== */

.article-content {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

@media (min-width: 768px) {
    .article-content {
        max-width: 680px;
    }
}

@media (min-width: 1024px) {
    .article-content {
        max-width: 740px;
    }
}

@media (min-width: 1400px) {
    .article-content {
        max-width: 800px;
    }
}

.article-content header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.article-content h1 {
    font-size: 1.8rem;
    margin-bottom: var(--space-sm);
}

.article-content .article-body h1,
.article-content .article-body h2,
.article-content .article-body h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.article-content .article-body p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.article-content .article-body ul,
.article-content .article-body ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.article-content .article-body li {
    margin-bottom: var(--space-sm);
    line-height: 1.7;
}

.article-content .article-body code {
    background-color: rgba(255, 176, 0, 0.1);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.9em;
}

.article-content .article-body pre {
    position: relative;
    background-color: #1a1a1a;
    border: 1px solid var(--crt-amber-dim);
    border-radius: 6px;
    padding: var(--space-lg) var(--space-md) var(--space-md);
    margin: var(--space-lg) 0;
    overflow-x: auto;
}

/* Window title bar dots (red, yellow, green) */
.article-content .article-body pre::before {
    content: "";
    display: block;
    position: absolute;
    top: 8px;
    left: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ec6a5f;
    box-shadow:
        20px 0 0 #f5c04f,
        40px 0 0 #64cc57;
}

.article-content .article-body pre code {
    background: none;
    padding: 0;
}

/* Article tag links (plain text comma-separated) */
.article-tag-link {
    font-size: 0.85rem;
    color: var(--crt-amber-dim);
    text-decoration: none;
}

.article-tag-link:hover {
    color: var(--crt-amber-bright);
}

/* Research callout block */
.article-content .admonition.research {
    background-color: rgba(255, 176, 0, 0.08);
    border-left: 3px solid var(--crt-amber);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
}

.article-content .admonition.research .admonition-title {
    color: var(--crt-amber-bright);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
}

.article-content .admonition.research p:not(.admonition-title) {
    color: var(--crt-amber);
    line-height: 1.7;
}

/* Stat block */
.article-content .admonition.stat {
    background-color: rgba(255, 176, 0, 0.05);
    border: 1px solid var(--crt-amber-dim);
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
    text-align: center;
}

.article-content .admonition.stat .admonition-title {
    color: var(--crt-amber-bright);
    font-size: 2rem;
    font-weight: 700;
    text-shadow: var(--crt-text-shadow);
    margin-bottom: var(--space-xs);
}

.article-content .admonition.stat p:not(.admonition-title) {
    color: var(--crt-amber-dim);
    font-size: 0.9rem;
}

/* Back to blog link at article bottom */
.article-content footer {
    margin-top: var(--space-xl);
    text-align: center;
}

/* ==========================================================================
   Blog Navigation
   ========================================================================== */

.blog-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background-color: rgba(10, 10, 8, 0.95);
    border-bottom: 1px solid var(--crt-amber-dim);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
}

/* Offset content below fixed nav */
.blog-nav + .crt-screen {
    padding-top: 48px;
}

.blog-nav-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--crt-amber-bright);
    text-decoration: none;
}

.blog-nav-links {
    display: flex;
    gap: var(--space-md);
}

.blog-nav-link {
    color: var(--crt-amber-dim);
    text-decoration: none;
    font-size: 0.85rem;
}

.blog-nav-link:hover,
.blog-nav-link.active {
    color: var(--crt-amber-bright);
}

/* ==========================================================================
   Blog Listing (hacker-style minimal rows)
   ========================================================================== */

.blog-listing {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

.blog-listing h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
}

/* Tag filter row */
.blog-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    font-size: 0.85rem;
}

.blog-tags-label {
    font-size: 0.8rem;
    margin-right: var(--space-xs);
}

.blog-tag-link {
    color: var(--crt-amber-dim);
    text-decoration: none;
    border: 1px solid var(--crt-amber-dim);
    padding: 2px var(--space-sm);
    border-radius: 3px;
    font-size: 0.8rem;
}

.blog-tag-link:hover {
    color: var(--crt-amber-bright);
    border-color: var(--crt-amber);
}

.blog-tag-link.active {
    color: var(--crt-bg);
    background-color: var(--crt-amber);
    border-color: var(--crt-amber);
}

/* Blog entry rows */
.blog-entry {
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(255, 176, 0, 0.1);
}

.blog-entry:last-child {
    border-bottom: none;
}

.blog-entry-date {
    display: block;
    font-size: 0.8rem;
    margin-bottom: var(--space-xs);
}

.blog-entry-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--crt-amber-bright);
    text-decoration: none;
    margin-bottom: var(--space-xs);
}

.blog-entry-title:hover {
    text-shadow: var(--crt-text-shadow);
}

.blog-entry-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: var(--space-xs) 0;
}

.blog-entry-meta {
    display: block;
    font-size: 0.8rem;
    margin-top: var(--space-xs);
}

.blog-entry-meta a {
    color: var(--crt-amber-dim);
    text-decoration: none;
}

.blog-entry-meta a:hover {
    color: var(--crt-amber-bright);
}

/* Featured article distinction */
.blog-entry--featured {
    border-left: 3px solid var(--crt-amber);
    padding-left: var(--space-md);
    margin-bottom: var(--space-md);
}

.blog-featured-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

/* Lazy-load hidden state */
.blog-entry[data-lazy] {
    display: none;
}

#load-all-btn {
    margin: var(--space-lg) auto;
    display: block;
}

/* ==========================================================================
   Article Navigation (prev/next)
   ========================================================================== */

.article-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 176, 0, 0.2);
}

.article-nav-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    color: var(--crt-amber);
    text-decoration: none;
    max-width: 45%;
}

.article-nav-link:hover {
    color: var(--crt-amber-bright);
    text-shadow: var(--crt-text-shadow);
}

.article-nav-next {
    text-align: right;
    margin-left: auto;
}

/* ==========================================================================
   Light Mode Toggle Button
   ========================================================================== */

.reading-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: transparent;
    border: 1px solid var(--crt-amber-dim);
    color: var(--crt-amber-dim);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: var(--space-md);
}

.reading-mode-toggle:hover {
    border-color: var(--crt-amber);
    color: var(--crt-amber);
    background: transparent;
}

/* ==========================================================================
   Light Reading Mode (warm paper aesthetic)
   ========================================================================== */

[data-theme="light"] .article-content,
[data-theme="light"] .blog-listing,
[data-theme="light"] .resources-page {
    background-color: #f5f0e8;
    color: #2c2c2c;
}

[data-theme="light"] .article-content a,
[data-theme="light"] .blog-listing a,
[data-theme="light"] .resources-page a {
    color: #1a5a2c;
}

[data-theme="light"] .article-content h1,
[data-theme="light"] .article-content h2,
[data-theme="light"] .article-content h3,
[data-theme="light"] .blog-listing h1,
[data-theme="light"] .resources-page h1,
[data-theme="light"] .resources-page h2,
[data-theme="light"] .resources-page h3 {
    color: #1a1a1a;
    text-shadow: none;
}

[data-theme="light"] .text-dim {
    color: #666666;
}

[data-theme="light"] .text-bright {
    color: #1a1a1a;
}

[data-theme="light"] .phosphor-glow,
[data-theme="light"] .phosphor-glow-bright {
    text-shadow: none;
    color: #1a1a1a;
}

/* Code blocks stay dark in light mode -- terminal aesthetic preserved */
[data-theme="light"] .article-content .article-body pre {
    background-color: #1a1a1a;
    color: #ffb000;
    border-color: #333333;
}

[data-theme="light"] .article-content .article-body code {
    background-color: rgba(0, 0, 0, 0.08);
    color: #2c2c2c;
}

/* Blog entry styles in light mode */
[data-theme="light"] .blog-entry {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .blog-entry-title {
    color: #1a1a1a;
}

[data-theme="light"] .blog-entry-title:hover {
    text-shadow: none;
    color: #1a5a2c;
}

[data-theme="light"] .blog-entry--featured {
    border-left-color: #1a5a2c;
}

[data-theme="light"] .blog-tag-link {
    border-color: #ccc;
    color: #666;
}

[data-theme="light"] .blog-tag-link:hover {
    border-color: #1a5a2c;
    color: #1a5a2c;
}

[data-theme="light"] .blog-tag-link.active {
    background-color: #1a5a2c;
    border-color: #1a5a2c;
    color: #fff;
}

/* Light mode body background for full-page coverage */
[data-theme="light"] body {
    background-color: #f5f0e8;
}

[data-theme="light"] .crt-screen {
    box-shadow: none;
}

[data-theme="light"] .scanlines::before {
    display: none;
}

/* Toggle button in light mode */
[data-theme="light"] .reading-mode-toggle {
    border-color: #999;
    color: #666;
}

[data-theme="light"] .reading-mode-toggle:hover {
    border-color: #333;
    color: #333;
}

/* Article nav in light mode */
[data-theme="light"] .article-nav {
    border-top-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .article-nav-link {
    color: #1a5a2c;
}

[data-theme="light"] .article-nav-link:hover {
    text-shadow: none;
}

/* Admonitions in light mode */
[data-theme="light"] .article-content .admonition.research {
    background-color: rgba(26, 90, 44, 0.08);
    border-left-color: #1a5a2c;
}

[data-theme="light"] .article-content .admonition.research .admonition-title {
    color: #1a5a2c;
}

[data-theme="light"] .article-content .admonition.stat {
    border-color: #ccc;
    background-color: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .article-content .admonition.stat .admonition-title {
    color: #1a1a1a;
    text-shadow: none;
}

/* ==========================================================================
   Resources Section (scoped to prevent style bleed)
   ========================================================================== */

.resources-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

.resources-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.resources-header h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

/* Anchor link navigation */
.resources-nav {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.resources-nav a {
    color: var(--crt-amber-dim);
}

.resources-nav a:hover {
    color: var(--crt-amber-bright);
}

/* Category sections */
.resources-category {
    margin-bottom: var(--space-xl);
}

.resources-category-title {
    font-size: 1.2rem;
    margin-bottom: var(--space-xs);
}

.resources-category-subtitle {
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}

/* Featured callout card (key sources) */
.resource-callout {
    background-color: rgba(255, 176, 0, 0.08);
    border: 1px solid var(--crt-amber);
    border-left: 3px solid var(--crt-amber-bright);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-radius: 4px;
}

.resource-callout h3 a {
    font-size: 1.1rem;
}

/* Regular resource entry */
.resource-entry {
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(255, 176, 0, 0.1);
}

.resource-entry:last-child {
    border-bottom: none;
}

/* Shared resource styles */
.resource-type {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.resource-meta {
    font-size: 0.85rem;
    margin: var(--space-xs) 0;
}

.resource-description {
    line-height: 1.7;
    margin: var(--space-sm) 0;
}

.resource-commentary {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: var(--space-sm);
    padding-left: var(--space-md);
    border-left: 2px solid var(--crt-amber-dim);
}

.commentary-label {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--crt-amber-bright);
    margin-bottom: var(--space-xs);
}

/* ==========================================================================
   Resources Light Mode
   ========================================================================== */

[data-theme="light"] .resource-callout {
    background-color: rgba(26, 90, 44, 0.06);
    border-color: #ccc;
    border-left-color: #1a5a2c;
}

[data-theme="light"] .resource-entry {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .resource-commentary {
    border-left-color: #ccc;
}

[data-theme="light"] .commentary-label {
    color: #1a5a2c;
}
