:root {
    /* Stitch Neural Editorial Palette: "Cognitive Prism" */
    --primary: #8ff5ff; /* Electric Blue */
    --primary-container: #00eefc;
    --primary-dim: #00deec;
    --primary-glow: rgba(143, 245, 255, 0.25);
    --secondary: #d674ff; /* Neon Purple */
    --accent: #ac89ff; /* Tertiary */
    --primary-hover: #00deec;

    --bg-dark: #0e0e13;
    --bg-main: #0e0e13;
    --hero-bg: linear-gradient(180deg, #0e0e13 0%, #131319 100%);
    
    --surface: #0e0e13;
    --surface-low: #131319;
    --surface-high: #1f1f26;

    --card-bg: rgba(25, 25, 31, 0.6); /* surface-container approx with opacity */
    --glass-bg: rgba(31, 31, 38, 0.4); /* surface-high approx */
    --glass-border: rgba(72, 71, 77, 0.2); /* outline-variant 20% */

    --text-main: #f9f5fd; /* on-surface */
    --text-dim: #acaab1; /* on-surface-variant */
    --text-white: #ffffff;
    --border-color: rgba(72, 71, 77, 0.2); /* Ghost border */
    --shadow: 0 32px 32px rgba(143, 245, 255, 0.08); /* Ambient Glow Shadow */

    --font-body: 'Manrope', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
}



body.news-theme {
    background-color: var(--bg-dark);
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body.light-theme {
    --bg-dark: #f8fafc;
    --bg-main: #ffffff;
    --hero-bg: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    --surface: #ffffff;
    --surface-low: #f1f5f9;
    --surface-high: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(15, 23, 42, 0.1);
    --text-main: #0f172a;
    --text-dim: #475569;
    --text-white: #0f172a;
    --border-color: rgba(15, 23, 42, 0.1);
    --shadow: 0 32px 64px rgba(15, 23, 42, 0.08);
    --primary: #0ea5e9;
    --primary-glow: rgba(14, 165, 233, 0.15);
}

/* Specific Header & Footer Overrides for Light Theme */
body.light-theme .main-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-color);
}
body.light-theme .nav-link {
    color: #475569;
}
body.light-theme .ticker-wrap {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}
body.light-theme .ticker-item span {
    color: #0f172a;
}
body.light-theme .news-card {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
body.light-theme .news-card-image-wrap::after {
    background: linear-gradient(to bottom, transparent 40%, rgba(255, 255, 255, 0.7) 100%);
}
body.light-theme .news-card.featured .news-card-image-wrap::after {
    background: linear-gradient(to right, transparent 60%, rgba(255, 255, 255, 0.95) 100%);
}
body.light-theme .news-card-title {
    color: #0f172a;
}
body.light-theme .news-card-excerpt {
    color: #475569;
}

/* Premium Motion & Entrances */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    animation: none;
    animation-delay: 0s;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    animation: none;
}

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

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Live Intel Ticker */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: #000;
    height: 35px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #222;
    pointer-events: none; /* Let clicks pass through to header links */
}

.ticker {
    display: flex;
    white-space: nowrap;
    padding-right: 100%;
    animation: ticker 60s linear infinite;
    pointer-events: auto; /* Re-enable for ticker content if needed */
}

.ticker-item {
    display: inline-block;
    padding: 0 4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ticker-item span {
    color: #fff;
    margin-left: 10px;
    font-weight: 400;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Base Elements */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* Header & Footer Links */
.main-header {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    position: sticky;
    top: 35px;
    z-index: 9999;
    margin-top: 35px;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.brand-logo-heading {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.1;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.25s ease;
}

.brand-logo-link:hover {
    opacity: 0.92;
}

.brand-logo-mark {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    filter: drop-shadow(0 0 12px rgba(143, 245, 255, 0.15));
}

.brand-logo-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    align-items: flex-start;
    min-width: 0;
}

.brand-logo-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(118deg, #f9f5fd 0%, #c8f8ff 42%, #f0ecf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.light-theme .brand-name {
    background: linear-gradient(118deg, #0f172a 0%, #0284c7 48%, #0f172a 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.brand-ai {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--primary);
    padding: 0.2rem 0.4rem;
    border: 1px solid rgba(143, 245, 255, 0.35);
    border-radius: 3px;
    line-height: 1;
    box-shadow: 0 0 20px rgba(143, 245, 255, 0.08);
}

body.light-theme .brand-ai {
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: none;
}

.brand-division {
    font-family: var(--font-body);
    font-size: 0.52rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(172, 170, 177, 0.88);
}

body.light-theme .brand-division {
    color: #64748b;
}

.logo-container .status-indicator {
    display: none; /* Removed neon indicator */
}

/* Article page compact logo (article.html) */
body.article-page .article-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

body.article-page .article-brand-logo:hover .article-brand-wordmark {
    color: var(--primary);
}

body.article-page .article-brand-mark {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(143, 245, 255, 0.12));
}

body.article-page .article-brand-wordmark {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(249, 245, 253, 0.85);
    transition: color 0.25s ease;
}

body.article-page .article-brand-wordmark span {
    color: var(--primary);
    margin-left: 0.25rem;
}

body.light-theme.article-page .article-brand-wordmark {
    color: #0f172a;
}

.footer-brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.footer-brand-lockup img {
    flex-shrink: 0;
    filter: drop-shadow(0 0 14px rgba(143, 245, 255, 0.12));
}

.footer-brand-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.2;
}

.footer-brand-title span {
    color: var(--primary);
    font-weight: 700;
}

body.light-theme .footer-brand-title {
    color: #0f172a;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.25rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
}

.main-nav {
    margin-left: auto;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.nav-link:hover, .nav-link.active, .footer-nav-link:hover {
    color: var(--primary);
}

.footer-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-social-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

/* AI Magazine-like dropdown header */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 260px;
    padding: 0.75rem;
    background: rgba(11, 18, 32, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 2000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-link {
    position: relative;
    z-index: 10001;
    pointer-events: auto;
}

/* Invisible bridge for the 12px gap */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
}

.dropdown-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    color: rgba(229, 231, 235, 0.9);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
}

.dropdown-link:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--text-white);
}

.magnetic {
    display: inline-block;
    will-change: transform;
}

.shimmer-btn {
    position: relative;
    overflow: hidden;
}

.shimmer-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: none;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translate(-30%, -30%) rotate(45deg); }
    100% { transform: translate(30%, 30%) rotate(45deg); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    opacity: 0.8;
}

.subscribe-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: #0e0e13;
    border: none;
    padding: 0.6rem 1.4rem;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    white-space: nowrap;
}

.subscribe-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-container) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Content Layout */
.content-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
}

/* Hero is full viewport width — breaks out of content-wrapper grid */
.hero-full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 0;
}

/* Main News Feed */
/* Category Filter Bar */
.category-filter-bar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.category-filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(143,245,255,0.1);
    padding: 0.45rem 1.2rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: nowrap;
    color: #76747b;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(143,245,255,0.08);
    color: var(--primary);
    border-color: rgba(143,245,255,0.3);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: #0e0e13;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(143,245,255,0.2);
}

.news-feed-container {
    padding-top: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Hero Carousel */
.hero-wrapper {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 2rem;
}

.hero-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: 0;
    background: #000;
}

.hero-carousel::-webkit-scrollbar {
    display: none;
}

.hero-card {
    flex: 0 0 100%;
    height: 540px;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    cursor: pointer;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 40%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    box-sizing: border-box;
    z-index: 2;
}

.hero-badge {
    background: var(--primary);
    color: #000;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 3rem;
    font-family: 'Space Grotesk', sans-serif;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.1;
    max-width: 800px;
    text-shadow: 0 0 20px rgba(0,255,255,0.3);
}

.hero-excerpt {
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-nav-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.hero-dot {
    width: 30px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.feed-header {
    border-bottom: 2px solid var(--bg-dark);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.feed-header h2 {
    font-size: 1.8rem;
    text-transform: uppercase;
}

.search-bar input {
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    width: 250px;
}

/* Masonry Waterfall Layout */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 5rem;
}

/* Square Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-top: 2rem;
    grid-column: 1 / -1;
}

/* Base Card for Waterfall */
.news-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: var(--shadow);
    
    /* Masonry flow properties */
    break-inside: avoid;
    margin-bottom: 1.5rem;
    height: max-content;

    /* Spotlight Engine */
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 40px 60px rgba(143, 245, 255, 0.12);
    border-color: var(--primary-glow);
}

/* Animated Holographic Tech Scanner */
@keyframes cyberScan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(300%); }
}

.news-card::before { 
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 15%;
    background: linear-gradient(to bottom, transparent, rgba(0, 242, 255, 0.6), transparent);
    z-index: 1;
    animation: none;
    mix-blend-mode: overlay;
    opacity: 0.0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.news-card:hover::before { 
    opacity: 0;
}

/* Masonry Authentic Image Layout */
.news-card .news-image {
    position: relative;
    width: 100%; 
    height: auto; 
    aspect-ratio: 16/9; /* Forces a perfect HD ratio, preventing any vertical cropping */
    object-fit: cover;
    z-index: 1;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1), filter 0.8s ease;
    border: none;
    border-radius: 12px;
}

.news-card:hover .news-image {
    filter: brightness(1.1);
}

/* Remove gradient since text sits below image now */
.news-card::after { display: none; }

.news-content {
    position: relative;
    z-index: 2;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding-top: 1.5rem;
}

.news-category {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 10px;
    border: 1px solid rgba(37, 99, 235, 0.45);
    border-radius: 999px;
}

/* Tool cards now handled at bottom of file */

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.75rem;
}

.news-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    color: var(--text-white);
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.news-card p {
    color: rgba(229, 231, 235, 0.85);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    display: flex;
    flex-direction: column;
}

/* Note: Artificial image height staggering removed. 
   Masonry flow is now naturally dictated by the unconstrained length of the typography 
   below each perfect 16:9 image block. */


/* Sidebars */
.sidebar-left { display: none; } /* Combined into right/main for target style */

.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.sidebar-module {
    padding: 0;
}

.sidebar-module h3 {
    font-size: 1rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--bg-dark);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Trending Items */
.trending-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.trending-item .tag {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.trending-item .title {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

/* Agent Log (Restyled for Tech feel) */
.log-entries {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #333;
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 0.5rem;
    border-left: 2px solid var(--primary);
    padding-left: 8px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.hidden { display: none; }

.modal-content {
    background: var(--bg-main);
    color: var(--text-main);
    padding: 3rem;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    background: none;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Remove Cyber Effects */
.grid-background, .glow-overlay, .scanlines {
    display: none;
}

/* Dashboard Styling */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
}

.profile-card {
    background: var(--hero-bg);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.xp-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin: 1.5rem 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.xp-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    animation: growXP 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes growXP {
    from { width: 0%; }
    to { width: var(--progress-width, 0%); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-box {
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.stat-box .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-box .label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 700;
}

/* Member hub (#dashboard) */
.member-dashboard {
    max-width: 1100px;
    margin: 0 auto;
}

.member-dashboard--staff .member-hub-intro--staff {
    background: linear-gradient(135deg, rgba(143, 245, 255, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
    border: 1px solid rgba(143, 245, 255, 0.22);
}

.member-link-btn--staff {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    color: #f8fafc !important;
    border: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.member-link-btn--staff:hover {
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.45);
}

body.light-theme .member-link-btn--staff {
    color: #fff !important;
}

.profile-card--staff {
    position: relative;
    text-align: left;
    padding: 2rem 2rem 2.25rem;
    border: 1px solid rgba(143, 245, 255, 0.25);
    background: linear-gradient(165deg, var(--hero-bg) 0%, rgba(15, 23, 42, 0.55) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

body.light-theme .profile-card--staff {
    background: linear-gradient(165deg, #fff 0%, #f1f5f9 100%);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.profile-staff-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    border: 1px solid rgba(129, 140, 248, 0.45);
}

body.light-theme .profile-staff-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.35);
}

.profile-card--staff .profile-avatar--staff {
    margin: 0 0 1rem;
    width: 88px;
    height: 88px;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.profile-display-name {
    margin: 0;
    font-size: 1.35rem;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.profile-role-line {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.profile-staff-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: #0e0e13;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-staff-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(143, 245, 255, 0.25);
}

.profile-staff-refresh {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(129, 140, 248, 0.45);
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    transition: background 0.2s, border-color 0.2s;
}

.profile-staff-refresh:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(165, 180, 252, 0.6);
}

.profile-staff-refresh:disabled {
    opacity: 0.65;
    cursor: wait;
}

body.light-theme .profile-staff-refresh {
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.08);
}

.profile-staff-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.profile-staff-section-label {
    margin: 0 0 0.5rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
}

.profile-staff-level {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.xp-bar-container--staff {
    height: 8px;
    margin: 0 0 1rem;
}

.stats-grid--staff {
    margin-top: 0;
}

.profile-level-label {
    color: var(--primary);
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0;
}

.profile-xp-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 0.5rem 0 0;
}

/* Header: signed-in user (keep narrow — long emails break the nav row) */
.nav-subscribe {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(360px, 48vw);
}

#auth-status {
    min-width: 0;
    max-width: 100%;
    justify-content: flex-end;
}

.auth-user-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.4rem 0.5rem;
    max-width: 100%;
    min-width: 0;
}

.auth-user-identity {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: visible;
}

.auth-user-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-container) 100%);
    color: #0e0e13;
}

.auth-user-avatar--staff {
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.55);
}

.auth-user-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: #e5e7eb;
    max-width: 104px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.light-theme .auth-user-name {
    color: #1e293b;
}

.auth-user-badge {
    flex-shrink: 0;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.35);
    color: #e0e7ff;
    border: 1px solid rgba(165, 180, 252, 0.45);
}

body.light-theme .auth-user-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.35);
}

.auth-user-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem 0.4rem;
    flex-shrink: 0;
}

.auth-user-link {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--primary);
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.auth-user-link:hover {
    background: rgba(143, 245, 255, 0.08);
}

.auth-user-link--admin {
    color: #a5b4fc;
}

body.light-theme .auth-user-link--admin {
    color: #4f46e5;
}

.auth-user-logout {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #94a3b8;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}

.auth-user-logout:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.mobile-link--staff {
    color: #a5b4fc !important;
    font-weight: 700;
}

body.light-theme .mobile-link--staff {
    color: #4f46e5 !important;
}

.member-hub-intro {
    background: rgba(143, 245, 255, 0.06);
    border: 1px solid rgba(143, 245, 255, 0.12);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.member-hub-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.member-hub-lede {
    color: var(--text-dim);
    max-width: 42rem;
    line-height: 1.65;
    margin: 0;
    font-size: 0.95rem;
}

.member-benefits-list {
    margin: 1rem 0 0 1.15rem;
    color: var(--text-dim);
    line-height: 1.65;
    font-size: 0.9rem;
}

.member-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.member-link-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-link-btn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: #0e0e13;
}

.member-link-btn--ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(143, 245, 255, 0.35);
}

.member-link-btn:hover {
    transform: translateY(-1px);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-container) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: #0e0e13;
    font-family: 'Space Grotesk', sans-serif;
}

.profile-email {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.profile-since {
    margin: 0.75rem 0 0;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.member-section {
    margin-bottom: 2.5rem;
}

.member-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
    color: #e5e7eb;
}

.member-section-hint {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.member-empty-hint {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.member-follow-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.member-follow-chip {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    padding: 0.5rem 0.95rem;
    border-radius: 100px;
    border: 1px solid rgba(143, 245, 255, 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.member-follow-chip:hover {
    border-color: rgba(143, 245, 255, 0.45);
    color: #e5e7eb;
}

.member-follow-chip.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(143, 245, 255, 0.08);
}

.dashboard-bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.dashboard-bookmark-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.dashboard-bookmark-card:hover {
    border-color: rgba(143, 245, 255, 0.35);
    transform: translateY(-2px);
}

.dashboard-bookmark-img-wrap {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111;
}

.dashboard-bookmark-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-bookmark-body {
    padding: 0.85rem 1rem 1rem;
}

.dashboard-bookmark-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0.4rem 0 0;
    color: var(--text-main);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
    cursor: pointer;
}

.history-item:hover {
    border-color: var(--primary);
}

/* Auth modal — Stitch-inspired split card (brand column + OAuth-first form) */
.auth-modal-overlay--stitch {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow-y: auto;
    background: rgba(6, 8, 14, 0.78);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.auth-modal-overlay--stitch.is-visible {
    opacity: 1;
}

.auth-modal-card--stitch {
    position: relative;
    width: 100%;
    max-width: 880px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 32px 80px rgba(0, 0, 0, 0.55),
        0 0 120px rgba(143, 245, 255, 0.06);
    background: #12121a;
}

.auth-modal-aside--stitch {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 2.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.75rem;
    min-height: 100%;
    text-align: center;
    background:
        radial-gradient(120% 80% at 20% 20%, rgba(143, 245, 255, 0.18) 0%, transparent 55%),
        radial-gradient(90% 70% at 80% 90%, rgba(172, 137, 255, 0.14) 0%, transparent 50%),
        linear-gradient(165deg, #0f1219 0%, #151822 50%, #0c0e14 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-modal-aside__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.15rem;
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Soft aurora orbs — drift behind mesh */
.auth-modal-aside--stitch::before,
.auth-modal-aside--stitch::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(56px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.75;
}

.auth-modal-aside--stitch::before {
    width: min(120%, 420px);
    height: min(70%, 320px);
    top: -15%;
    left: -25%;
    background: radial-gradient(
        ellipse at center,
        rgba(143, 245, 255, 0.42) 0%,
        rgba(0, 238, 252, 0.08) 45%,
        transparent 70%
    );
    animation: auth-modal-aurora-a 16s ease-in-out infinite alternate;
}

.auth-modal-aside--stitch::after {
    width: min(100%, 360px);
    height: min(90%, 400px);
    bottom: -35%;
    right: -30%;
    background: radial-gradient(
        ellipse at center,
        rgba(172, 137, 255, 0.38) 0%,
        rgba(214, 116, 255, 0.06) 50%,
        transparent 68%
    );
    animation: auth-modal-aurora-b 20s ease-in-out infinite alternate;
}

@keyframes auth-modal-aurora-a {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.55;
    }
    33% {
        transform: translate(12%, 8%) scale(1.06) rotate(3deg);
        opacity: 0.85;
    }
    66% {
        transform: translate(-8%, 14%) scale(0.98) rotate(-2deg);
        opacity: 0.7;
    }
    100% {
        transform: translate(6%, -4%) scale(1.03) rotate(1deg);
        opacity: 0.6;
    }
}

@keyframes auth-modal-aurora-b {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-18%, -12%) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translate(10%, 16%) scale(1.04);
        opacity: 0.55;
    }
}

.auth-modal-aside__mesh {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
    animation: auth-modal-mesh-drift 28s linear infinite;
}

@keyframes auth-modal-mesh-drift {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 56px 56px;
    }
}

.auth-modal-aside__logo {
    width: 112px;
    height: 112px;
    border-radius: 24px;
    position: relative;
    z-index: 2;
    display: block;
    margin: 0 auto;
    animation: auth-modal-logo-float 5.5s ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(143, 245, 255, 0.4));
}

@keyframes auth-modal-logo-float {
    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 16px rgba(143, 245, 255, 0.32));
    }
    50% {
        transform: translateY(-5px) scale(1.02);
        filter: drop-shadow(0 0 28px rgba(143, 245, 255, 0.5));
    }
}

.auth-modal-aside__title {
    font-family: var(--font-heading);
    font-size: clamp(2.35rem, 5.5vw, 3.35rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 0;
    color: var(--text-main);
    position: relative;
    z-index: 2;
    text-align: center;
    animation: auth-modal-title-shimmer 10s ease-in-out infinite;
}

@keyframes auth-modal-title-shimmer {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.92;
    }
}

.auth-modal-aside__subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0;
    max-width: 22rem;
    position: relative;
    z-index: 2;
    text-align: center;
    animation: auth-modal-fade-in-up 0.7s ease-out 0.1s both;
}

@keyframes auth-modal-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-modal-aside--stitch::before,
    .auth-modal-aside--stitch::after {
        animation: none;
        opacity: 0.45;
    }

    .auth-modal-aside__mesh {
        animation: none;
    }

    .auth-modal-aside__logo {
        animation: none;
        filter: drop-shadow(0 0 14px rgba(143, 245, 255, 0.28));
    }

    .auth-modal-aside__title {
        animation: none;
    }

    .auth-modal-aside__subtitle {
        animation: none;
    }
}

.auth-modal-panel--stitch {
    padding: 2.25rem 2.25rem 1.75rem;
    background: linear-gradient(180deg, #16161e 0%, #12121a 100%);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-modal-panel__head h2 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
    color: var(--text-main);
}

.auth-modal-panel__head p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.auth-modal-oauth {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-btn-oauth:hover {
    transform: translateY(-1px);
}

.auth-btn-oauth--google {
    background: #fff;
    color: #1f1f1f;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.auth-btn-oauth--google:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.auth-btn-oauth--apple {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.14);
}

.auth-btn-oauth--apple:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.auth-modal-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-family: var(--font-body);
    text-transform: lowercase;
}

.auth-modal-divider::before,
.auth-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-modal-phone-link {
    align-self: center;
    background: none;
    border: none;
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0.25rem;
}

.auth-modal-phone-link:hover {
    color: var(--primary-hover);
}

.auth-field-stitch {
    position: relative;
    margin-bottom: 0.85rem;
}

.auth-field-stitch__label {
    display: block;
    font-size: 0.72rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

.auth-field-stitch__wrap {
    position: relative;
}

.auth-field-stitch__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.75;
}

.auth-input-stitch {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-stitch:focus {
    border-color: rgba(143, 245, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(143, 245, 255, 0.12);
}

.auth-input-stitch--select {
    padding-left: 14px;
    cursor: pointer;
    appearance: none;
}

.auth-modal-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-modal-remember label {
    color: var(--text-dim);
    font-size: 0.85rem;
    cursor: pointer;
}

.auth-modal-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
    color: #f87171;
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.auth-btn-submit-stitch {
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: #0e0e13;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.auth-btn-submit-stitch:hover:not(:disabled) {
    transform: translateY(-1px);
    opacity: 0.95;
}

.auth-btn-submit-stitch:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-modal-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0.25rem 0 0;
    font-family: var(--font-body);
}

.auth-modal-switch button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}

.auth-modal-switch button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-modal-legal {
    font-size: 0.72rem;
    line-height: 1.5;
    color: rgba(172, 170, 177, 0.85);
    margin: 0;
    text-align: center;
    font-family: var(--font-body);
}

.auth-modal-close--stitch {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.auth-modal-close--stitch:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

@media (max-width: 780px) {
    .auth-modal-card--stitch {
        grid-template-columns: 1fr;
        max-width: 440px;
        border-radius: 20px;
    }

    .auth-modal-aside--stitch {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 2rem 1.5rem 1.5rem;
        min-height: auto;
    }

    .auth-modal-aside__logo {
        width: 88px;
        height: 88px;
        border-radius: 20px;
    }

    .auth-modal-aside__title {
        font-size: clamp(1.9rem, 9vw, 2.65rem);
    }

    .auth-modal-aside__subtitle {
        max-width: none;
    }
}

body.light-theme .auth-modal-overlay--stitch {
    background: rgba(248, 250, 252, 0.82);
}

body.light-theme .auth-modal-card--stitch {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 24px 60px rgba(0, 0, 0, 0.12);
}

body.light-theme .auth-modal-panel--stitch {
    background: #fafafa;
}

body.light-theme .auth-input-stitch {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    color: #111;
}

/* ADMIN PANEL STYLES */
.admin-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.admin-card {
    transition: all 0.3s ease;
}

.admin-card:hover {
    border-color: var(--primary) !important;
    transform: translateX(5px);
}

.admin-form input, .admin-form textarea, .admin-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 1.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    font-family: inherit;
}

.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
}

/* Global Responsive Layout Fixes */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        padding: 0 3%;
    }
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100vw;
    }
    
    .content-wrapper {
        padding: 0 1rem;
        margin: 1rem auto;
        width: 100%;
        overflow-x: hidden;
    }

    .main-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .category-filter-bar {
        width: 100vw;
        margin-left: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }

    .news-feed-container {
        width: 100%;
    }
}

/* --- PREMIUM MICRO-INTERACTIONS --- */

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
    mix-blend-mode: difference;
}

.custom-cursor.active {
    width: 50px;
    height: 50px;
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.5);
    backdrop-filter: blur(2px);
}

/* Luxury welcome subscribe popup */
.welcome-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 18, 0.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10080;
    padding: 1rem;
}

.welcome-popup-card {
    position: relative;
    width: min(560px, 100%);
    border-radius: 16px;
    padding: 1.5rem 1.4rem 1.3rem;
    border: 1px solid rgba(143, 245, 255, 0.2);
    background:
        radial-gradient(120% 110% at 0% 0%, rgba(143, 245, 255, 0.13), transparent 42%),
        linear-gradient(170deg, rgba(17, 17, 27, 0.97), rgba(11, 13, 20, 0.96));
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(143, 245, 255, 0.08) inset;
}

.welcome-popup-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #d7dde9;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.welcome-popup-kicker {
    margin: 0 0 0.45rem;
    color: var(--primary);
    letter-spacing: 1.9px;
    font-size: 0.67rem;
    text-transform: uppercase;
    font-weight: 700;
}

.welcome-popup-title {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    color: #f5f8ff;
    font-size: 1.52rem;
    line-height: 1.25;
}

.welcome-popup-copy {
    margin: 0.75rem 0 1rem;
    color: #b6bece;
    line-height: 1.6;
    font-size: 0.95rem;
}

.welcome-popup-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
}

.welcome-popup-form input {
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(143, 245, 255, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: #edf4ff;
    padding: 0.78rem 0.85rem;
}

.welcome-popup-submit {
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    cursor: pointer;
    color: #061821;
    background: linear-gradient(135deg, #8ff5ff, #5eead4);
}

.welcome-popup-checkbox {
    margin-top: 0.72rem;
    display: flex;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.83rem;
    color: #c4ccda;
}

.welcome-popup-msg {
    min-height: 1.1rem;
    margin: 0.7rem 0 0;
    font-size: 0.83rem;
    color: #9ee8bd;
}

.welcome-popup-secondary {
    margin-top: 0.45rem;
    border: none;
    background: transparent;
    color: #9fb0c9;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
}

body.light-theme .welcome-popup-overlay {
    background: rgba(5, 14, 30, 0.36);
}

body.light-theme .welcome-popup-card {
    border-color: rgba(14, 165, 233, 0.3);
    background:
        radial-gradient(120% 110% at 0% 0%, rgba(14, 165, 233, 0.12), transparent 42%),
        linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.98));
    box-shadow:
        0 24px 50px rgba(14, 23, 42, 0.18),
        0 0 0 1px rgba(14, 165, 233, 0.08) inset;
}

body.light-theme .welcome-popup-title { color: #0f172a; }
body.light-theme .welcome-popup-copy { color: #334155; }
body.light-theme .welcome-popup-form input {
    border-color: rgba(14, 165, 233, 0.25);
    background: #ffffff;
    color: #0f172a;
}
body.light-theme .welcome-popup-close {
    background: rgba(15, 23, 42, 0.07);
    color: #334155;
}
body.light-theme .welcome-popup-checkbox { color: #334155; }
body.light-theme .welcome-popup-secondary { color: #475569; }

@media (max-width: 640px) {
    .welcome-popup-card {
        padding: 1.2rem 1rem 1rem;
    }
    .welcome-popup-title {
        font-size: 1.22rem;
    }
    .welcome-popup-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .custom-cursor {
        display: none; /* Disable custom cursor on mobile */
    }
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-img {
    width: 100%;
    height: 200px;
    margin-bottom: 1rem;
}


@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- SUBSCRIBE BUTTON --- */
.subscribe-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 0.6rem 2rem;
    border-radius: 4px;
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.8);
    background: linear-gradient(135deg, #3b82f6 0%, var(--primary) 100%);
}

.subscribe-btn:active {
    transform: translateY(0);
}

/* --- PREMIUM AUTH MODAL (Minimalist) --- */
.auth-modal-card {
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    position: relative;
    animation: modalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-card h2 {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-modal-card .auth-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.auth-input-group {
    margin-bottom: 1.2rem;
}

.auth-input-group label {
    display: block;
    margin-bottom: 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #999;
}

.auth-input-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.auth-input-group input::placeholder {
    color: #444;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #444;
    font-size: 0.75rem;
    margin: 1.5rem 0;
    letter-spacing: 0.5px;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.auth-divider::before { margin-right: 12px; }
.auth-divider::after { margin-left: 12px; }

.auth-social-btn {
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #ccc;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0.6rem;
    transition: all 0.2s ease;
}

.auth-social-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

.auth-footer-text {
    text-align: center;
    font-size: 0.75rem;
    color: #555;
    margin-top: 1.5rem;
    line-height: 1.5;
}

.auth-footer-text a {
    color: #888;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.2);
    text-underline-offset: 2px;
}

/* --- MODAL UTILITIES --- */
.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85); /* Dark cinematic overlay */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: transparent; /* Relying on auth-split-layout for background */
    width: 100%;
    max-width: 900px;
    position: relative;
    border-radius: 12px;
    animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.close-modal:hover {
    opacity: 1;
}

/* Fallback for the article modal explicitly */
#article-modal .modal-content {
    background: var(--bg-color);
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

@keyframes modalPop {
    0% { transform: scale(0.95) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* --- AI TOOLS DIRECTORY LAYOUT --- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-top: 2rem;
}

.tool-card-square {
    position: relative;
    aspect-ratio: 0.85;
    background: var(--surface-low);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.4s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.tool-card-square:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(143, 245, 255, 0.1);
}

.tool-image-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tool-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6) grayscale(0.2);
    transition: transform 0.6s ease, filter 0.4s ease;
}

.tool-card-square:hover img {
    transform: scale(1.05);
    filter: brightness(0.8) grayscale(0);
}

.tool-price-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    border: 1px solid rgba(143, 245, 255, 0.2);
    z-index: 5;
    text-transform: uppercase;
}

.tool-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(14,14,19,1) 0%, rgba(14,14,19,0.8) 50%, transparent 100%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 60%;
}

.tool-info-overlay h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.5rem !important;
    color: #fff;
    letter-spacing: -0.5px;
}

.tool-info-overlay p {
    font-size: 0.8rem !important;
    color: rgba(255,255,255,0.7);
    line-height: 1.5 !important;
    margin-bottom: 1.25rem !important;
}

.tool-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tool-grid-header h2 {
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--text-main);
}

.shimmer-btn {
    overflow: hidden;
    position: relative;
}

.shimmer-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(30deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-150%) rotate(30deg); }
    100% { transform: translateX(150%) rotate(30deg); }
}

/* --- MOBILE RESPONSIVENESS & NAVIGATION --- */

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 10001;
    position: relative;
    width: 40px;
    height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    transition: all 0.3s;
    left: 0;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* Active State (X Morph) */
.mobile-menu-toggle.active .hamburger {
    background: transparent;
}
.mobile-menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}
.mobile-menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile Drawer */
/* Closed: off-screen to the right. Do NOT set `left` — it conflicts with `right` + `width: 100%` and can fill the viewport. */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    min-height: 100dvh;
    background: var(--bg-dark);
    z-index: 10050;
    transition: right 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-sizing: border-box;
    overflow-y: auto;
}

.mobile-drawer.active {
    right: 0;
}

.mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.mobile-drawer-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary);
    margin: 0;
}

.close-drawer {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-nav-section-label {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: rgba(172, 170, 177, 0.75);
    margin: 1.35rem 0 0.35rem;
}

.mobile-nav-section-label:first-child {
    margin-top: 0;
}

.mobile-link-sub {
    font-size: 0.78rem !important;
    letter-spacing: 0.1em !important;
    padding-left: 0.35rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.mobile-link {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-nav a { display: block; }

.mobile-link:hover {
    color: var(--primary);
}

/* Base Responsive Rules */
@media (max-width: 1100px) {
    .main-nav ul {
        gap: 0.8rem;
    }
    .nav-link {
        font-size: 0.65rem;
    }
}

.newsletter-form-row {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
    align-items: stretch;
}

@media (max-width: 900px) {
    .main-nav {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: block !important;
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .brand-logo-mark {
        width: 2.2rem;
        height: 2.2rem;
    }

    .brand-division {
        font-size: 0.48rem;
    }

    /* Ticker is hidden below 900px — remove reserved space so the bar sits flush */
    .main-header {
        padding: 0 1rem;
        height: 70px;
        margin-top: 0;
        top: 0;
    }

    .ticker-wrap {
        display: none !important;
    }

    /* Dashboard: single column. News `.feed-grid` is styled in ui.js (hero + 2 cols on mobile). */
    .dashboard-grid {
        display: grid !important;
        column-count: 1 !important;
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
        padding: 0 1rem !important;
    }

    /* AI Tools directory only: two columns on narrow viewports */
    .tool-grid.ai-tools-directory-grid {
        display: grid !important;
        column-count: unset !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem 0.65rem !important;
        padding: 0 0.75rem !important;
        padding-top: 1rem !important;
    }

    .tool-grid.ai-tools-directory-grid .tool-card-square .tool-info-overlay {
        padding: 0.65rem !important;
    }

    .tool-grid.ai-tools-directory-grid .tool-info-overlay h3 {
        font-size: 0.85rem !important;
    }

    .tool-grid.ai-tools-directory-grid .tool-info-overlay p {
        font-size: 0.65rem !important;
        margin-bottom: 0.5rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .tool-grid.ai-tools-directory-grid .tool-price-tag {
        font-size: 0.55rem !important;
        padding: 2px 6px !important;
        top: 8px;
        right: 8px;
    }

    .tool-grid.ai-tools-directory-grid .tool-card-square .magnetic {
        padding: 8px !important;
        font-size: 0.65rem !important;
    }

    .news-card {
        max-width: 100%;
    }

    /* Hero Scaling */
    .hero-card {
        height: 450px !important;
        padding: 2rem !important;
    }

    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }

    .hero-excerpt {
        font-size: 0.9rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Footer Stacking */
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 3rem;
        padding: 4rem 1.5rem !important;
    }

    .footer-column {
        align-items: center !important;
    }

    .footer-newsletter {
        max-width: 100%;
        margin: 0 auto;
    }

    /* Search/Filters */
    .search-filter-controls {
        flex-direction: column !important;
        gap: 1.5rem !important;
        padding: 0 1rem !important;
    }

    .search-bar-container {
        width: 100% !important;
    }

    .filter-pills {
        justify-content: flex-start !important;
        overflow-x: auto;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        scrollbar-width: none;
    }
    
    .filter-pills::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 600px) {
    .newsletter-section {
        padding: 1.5rem 1rem !important;
    }

    .newsletter-form-row {
        flex-direction: column;
        max-width: 100%;
    }

    .newsletter-form-row .cyber-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-card {
        height: 380px !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

    .subscribe-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.75rem;
    }
    
    .auth-modal-card {
        padding: 2rem 1.5rem;
    }
}

/* ========== Mobile editorial luxury (≤900px) ==========
   Refined surfaces, calmer type, safe areas — overrides earlier mobile rules. */
@media (max-width: 900px) {
    body.news-theme {
        background: linear-gradient(168deg, #08080c 0%, #0e0e13 42%, #101018 100%);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    body.light-theme {
        background: linear-gradient(168deg, #f6f7f9 0%, #ffffff 55%, #f1f3f6 100%);
    }

    .content-wrapper {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }

    /* Single-row header: logo + actions (overrides 768px column stack) */
    .main-header {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.75rem !important;
        min-height: 3.25rem;
        height: auto !important;
        padding: 0.65rem max(1.15rem, env(safe-area-inset-right)) 0.65rem max(1.15rem, env(safe-area-inset-left)) !important;
        padding-top: max(0.65rem, env(safe-area-inset-top)) !important;
        background: linear-gradient(180deg, rgba(18, 18, 24, 0.92) 0%, rgba(12, 12, 16, 0.88) 100%) !important;
        backdrop-filter: blur(24px) saturate(1.2);
        -webkit-backdrop-filter: blur(24px) saturate(1.2);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.04) inset,
            0 12px 40px rgba(0, 0, 0, 0.35);
    }

    body.light-theme .main-header {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.9) 100%) !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 8px 32px rgba(15, 23, 42, 0.06);
    }

    .brand-name {
        font-size: 0.88rem !important;
        letter-spacing: 0.12em !important;
    }

    .brand-logo-mark {
        width: 2.05rem !important;
        height: 2.05rem !important;
    }

    .brand-division {
        font-size: 0.42rem !important;
        letter-spacing: 0.26em !important;
        opacity: 0.92;
    }

    .brand-ai {
        font-size: 0.52rem !important;
        padding: 0.12rem 0.28rem !important;
    }

    .header-actions {
        gap: 0.5rem;
        align-items: center;
    }

    .theme-toggle {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.04);
        font-size: 1.05rem;
        opacity: 1;
    }

    body.light-theme .theme-toggle {
        border-color: rgba(15, 23, 42, 0.08);
        background: rgba(255, 255, 255, 0.7);
    }

    .mobile-menu-toggle {
        width: 2.5rem !important;
        height: 2.5rem !important;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.04);
        padding: 0 !important;
    }

    body.light-theme .mobile-menu-toggle {
        border-color: rgba(15, 23, 42, 0.08);
        background: rgba(255, 255, 255, 0.7);
    }

    .hamburger,
    .hamburger::before,
    .hamburger::after {
        background: rgba(249, 245, 253, 0.92);
        height: 1.5px;
        width: 18px;
    }

    body.light-theme .hamburger,
    body.light-theme .hamburger::before,
    body.light-theme .hamburger::after {
        background: rgba(15, 23, 42, 0.75);
    }

    .hamburger::before {
        top: -6px;
    }

    .hamburger::after {
        top: 6px;
    }

    /* Full-screen menu: editorial, not utilitarian */
    .mobile-drawer {
        background:
            linear-gradient(165deg, rgba(10, 10, 14, 0.98) 0%, rgba(14, 14, 19, 0.97) 45%, rgba(18, 16, 28, 0.96) 100%);
        border-left: 1px solid rgba(201, 169, 98, 0.12);
        box-shadow: -24px 0 80px rgba(0, 0, 0, 0.5);
        padding: max(1.75rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
        transition: right 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    }

    body.light-theme .mobile-drawer {
        background: linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
        border-left-color: rgba(15, 23, 42, 0.08);
        box-shadow: -16px 0 48px rgba(15, 23, 42, 0.08);
    }

    .mobile-drawer-header {
        margin-bottom: 2.25rem;
        padding-bottom: 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    body.light-theme .mobile-drawer-header {
        border-bottom-color: rgba(15, 23, 42, 0.08);
    }

    .mobile-drawer-header h2 {
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.35em;
        color: rgba(201, 169, 98, 0.85);
        text-transform: uppercase;
    }

    body.light-theme .mobile-drawer-header h2 {
        color: rgba(100, 116, 139, 0.95);
    }

    .close-drawer {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        font-size: 1.35rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.04);
        color: rgba(249, 245, 253, 0.85);
    }

    body.light-theme .close-drawer {
        border-color: rgba(15, 23, 42, 0.1);
        background: rgba(255, 255, 255, 0.85);
        color: #0f172a;
    }

    .mobile-nav {
        gap: 0.25rem;
    }

    .mobile-link {
        font-size: 0.82rem;
        font-weight: 500;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        padding: 1.1rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        color: rgba(249, 245, 253, 0.92);
    }

    body.light-theme .mobile-link {
        color: #0f172a;
        border-bottom-color: rgba(15, 23, 42, 0.06);
    }

    .mobile-link:hover,
    .mobile-link:active {
        color: rgba(143, 245, 255, 0.95);
        padding-left: 0.35rem;
        transition: padding-left 0.25s ease, color 0.25s ease;
    }

    body.light-theme .mobile-link:hover,
    body.light-theme .mobile-link:active {
        color: #0ea5e9;
    }

    .drawer-footer .subscribe-btn {
        margin-top: 1.5rem !important;
        border-radius: 2px;
        letter-spacing: 0.2em;
        font-weight: 600;
        padding: 0.95rem 1.5rem !important;
        box-shadow: 0 8px 32px rgba(143, 245, 255, 0.12);
    }

    /* Feed & cards: softer, jewelry-box framing */
    .news-feed-container {
        padding-top: 0.25rem;
    }

    .feed-grid {
        gap: 2rem !important;
    }

    .news-card {
        border-radius: 14px !important;
        border: 1px solid rgba(255, 255, 255, 0.07) !important;
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.35),
            0 0 0 1px rgba(255, 255, 255, 0.03) inset !important;
    }

    body.light-theme .news-card {
        border-color: rgba(15, 23, 42, 0.06) !important;
        box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06) !important;
    }

    .category-filter-bar {
        margin-left: calc(-1 * max(1rem, env(safe-area-inset-left)));
        margin-right: calc(-1 * max(1rem, env(safe-area-inset-right)));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: 0.75rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-btn {
        border-radius: 2px;
        letter-spacing: 0.12em;
        font-weight: 600;
        padding: 0.5rem 1rem;
        border-color: rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.03);
    }

    .filter-btn.active {
        border-color: rgba(201, 169, 98, 0.35);
        background: rgba(201, 169, 98, 0.08);
        color: rgba(249, 245, 253, 0.95);
    }

    body.light-theme .filter-btn.active {
        border-color: rgba(14, 165, 233, 0.35);
        background: rgba(14, 165, 233, 0.08);
        color: #0f172a;
    }

    .newsletter-section {
        border-radius: 14px !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        background: linear-gradient(165deg, rgba(22, 22, 30, 0.85) 0%, rgba(14, 14, 19, 0.92) 100%) !important;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    body.light-theme .newsletter-section {
        background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%) !important;
        border-color: rgba(15, 23, 42, 0.08) !important;
        box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
    }

    .newsletter-section h3 {
        font-weight: 600;
        letter-spacing: 0.06em;
    }

    /* AI tool tiles: subtle gilt edge */
    .tool-grid.ai-tools-directory-grid .tool-card-square {
        border-radius: 12px !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    }

    .tool-grid.ai-tools-directory-grid .tool-info-overlay {
        background: linear-gradient(to top, rgba(8, 8, 12, 0.98) 0%, rgba(14, 14, 19, 0.75) 55%, transparent 100%) !important;
    }

    .search-filter-controls .search-bar input,
    .tool-grid-header .search-bar input {
        border-radius: 2px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        background: rgba(255, 255, 255, 0.04) !important;
    }

    body.light-theme .search-filter-controls .search-bar input,
    body.light-theme .tool-grid-header .search-bar input {
        background: #fff !important;
        border-color: rgba(15, 23, 42, 0.1) !important;
    }

    .tool-grid-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1.25rem;
        padding-bottom: 1.25rem !important;
        border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    }

    .tool-grid-header .search-bar {
        min-width: 0 !important;
        width: 100% !important;
    }

    .main-footer {
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
        padding-left: max(1.25rem, env(safe-area-inset-left)) !important;
        padding-right: max(1.25rem, env(safe-area-inset-right)) !important;
        padding-bottom: max(2rem, env(safe-area-inset-bottom)) !important;
    }

    body.light-theme .main-footer {
        border-top-color: rgba(15, 23, 42, 0.08) !important;
    }
}

/* ========== Staff admin (Intelligence CMS) ========== */
.admin-view {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 4rem;
    padding: 2rem 0 3rem;
}

.admin-view__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-view__brand {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.admin-view__eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 0.35rem;
}

.admin-view__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.admin-view__lede {
    margin: 0;
    max-width: 36rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.5;
}

.admin-view__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.admin-view__exit {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
}

.admin-view__exit:hover {
    text-decoration: underline;
}

.admin-view__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.admin-refresh-status {
    width: 100%;
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.45;
    min-height: 1.25em;
}

.profile-refresh-status {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.4;
    min-height: 1.2em;
}

.admin-view__refresh-btn {
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .admin-view__refresh-btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

.admin-view__search {
    flex: 1;
    min-width: 200px;
    padding: 0.65rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: inherit;
    font-family: inherit;
    font-size: 0.9rem;
}

body.light-theme .admin-view__search {
    background: #fff;
}

.admin-view__count {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.admin-article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--hero-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.admin-card__body {
    flex: 1;
    min-width: 200px;
}

.admin-card__cat {
    font-size: 0.65rem;
}

.admin-card__title {
    margin: 0.4rem 0 0.35rem;
    font-size: 1.05rem;
    line-height: 1.3;
}

.admin-card__meta {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.admin-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-empty {
    margin: 2rem 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.cyber-button--sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
}

.cyber-button--danger {
    border-color: rgba(220, 38, 38, 0.45);
    color: #f87171;
}

body.light-theme .cyber-button--danger {
    color: #b91c1c;
}

.admin-modal__panel {
    max-width: 560px;
    width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal__title {
    margin-top: 0;
    font-family: 'Space Grotesk', sans-serif;
}

.admin-modal__hint {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

.admin-modal__grid {
    display: grid;
    grid-template-columns: minmax(0, 140px) 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
}

@media (max-width: 600px) {
    .admin-modal__grid {
        grid-template-columns: 1fr;
    }
}

.admin-modal__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    padding-top: 0.5rem;
}

.admin-modal__req {
    color: var(--primary);
}

.admin-modal__opt {
    font-size: 0.65rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-dim);
}

.admin-modal__input,
.admin-modal__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: inherit;
    font-family: inherit;
    font-size: 0.9rem;
}

.admin-modal__textarea {
    resize: vertical;
    min-height: 120px;
}

.admin-modal__textarea--short {
    min-height: 72px;
}

.admin-modal__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.admin-view__btn-ghost,
.admin-view__btn-primary {
    font-family: inherit;
}

.admin-view__btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    padding: 0.65rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.admin-view__btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}
