/* ============================================================
   Neural Companion Ghost Theme — screen.css
   Dark-native. No overrides. No fighting.
   ============================================================ */

/* --- Variables --- */
:root {
    --obsidian: #050505;
    --midnight: #0a0a12;
    --blush: #d4729a;
    --blush-hover: rgba(212, 114, 154, 0.6);
    --neon-blue: #00ccff;
    --text-primary: #e5e5e5;
    --text-secondary: #9ca3af;
    --text-dim: #6b7280;
    --surface: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(212, 114, 154, 0.3);
    --radius: 16px;
    --radius-full: 9999px;
    --max-width: 1280px;
    --content-width: 720px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Cinzel', Georgia, serif;
    --ghost-accent-color: #d4729a;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- Global --- */
html { scroll-behavior: smooth; }
body {
    background-color: var(--obsidian);
    color: var(--text-primary);
    font-family: var(--gh-font-body, var(--font-body));
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--blush); color: #fff; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ============================================================
   NAV — 1:1 match to neuralcompanion.com
   ============================================================ */
#nc-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: transparent;
    padding: 24px 0;
    transition: all 0.7s ease-in-out;
}
#nc-nav.scrolled {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 0;
}

.nc-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.nc-logo { display: flex; align-items: center; text-decoration: none; }
.nc-logo-text {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.5s ease;
}
#nc-nav.scrolled .nc-logo-text { color: #fff; }
.nc-blush { color: var(--blush); }

@media (min-width: 768px) {
    .nc-logo-text { font-size: 1.25rem; }
}

/* Desktop nav links */
.nc-links {
    display: none;
    align-items: center;
    gap: 32px;
}
.nc-links a,
.nc-links .nav a {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s ease;
}
.nc-links a:hover,
.nc-links .nav a:hover { color: var(--blush); }
.nc-links .nav { display: flex; gap: 32px; list-style: none; }
.nc-links .nav li { display: inline; }

.nc-cta {
    padding: 8px 24px !important;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: #fff !important;
    transition: all 0.5s ease;
}
.nc-cta:hover {
    background: rgba(212, 114, 154, 0.25) !important;
    border-color: rgba(212, 114, 154, 0.4) !important;
}

@media (min-width: 768px) {
    .nc-links { display: flex; }
}

/* Burger */
#nc-burger {
    display: block;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
}
@media (min-width: 768px) {
    #nc-burger { display: none; }
}

/* Mobile menu */
#nc-mobile-menu {
    display: none;
    flex-direction: column;
    gap: 24px;
    position: absolute;
    top: 100%; left: 0; width: 100%;
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    text-align: center;
    z-index: 40;
}
#nc-mobile-menu a,
#nc-mobile-menu .nav a {
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}
#nc-mobile-menu .nav { display: flex; flex-direction: column; gap: 24px; list-style: none; }
.nc-mobile-cta { color: var(--blush) !important; }

@media (min-width: 768px) {
    #nc-mobile-menu { display: none !important; }
}

/* ============================================================
   HERO
   ============================================================ */
.nc-hero {
    position: relative;
    padding: 160px 24px 80px;
    text-align: center;
    overflow: hidden;
}
.nc-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.15;
}
.nc-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}
.nc-hero-title {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.07);
    margin-bottom: 24px;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
}
.nc-hero-title .nc-blush {
    color: rgba(212, 114, 154, 0.12);
    -webkit-text-stroke-color: rgba(212, 114, 154, 0.15);
}
.nc-hero-description {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 32px;
}
.nc-hero-signup-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 16px;
}
.nc-hero-cta { margin-top: 8px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.nc-btn {
    display: inline-block;
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.5s ease;
    cursor: pointer;
}
.nc-btn:hover {
    background: rgba(212, 114, 154, 0.25);
    border-color: rgba(212, 114, 154, 0.4);
}
.nc-btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}
.nc-btn-outline:hover {
    border-color: var(--blush);
    color: #fff;
    background: transparent;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.nc-content {
    min-height: 100vh;
}
.nc-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ============================================================
   POST FEED
   ============================================================ */
.nc-feed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 640px) {
    .nc-feed-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .nc-feed-grid { grid-template-columns: repeat(3, 1fr); }
}

.nc-feed-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: var(--content-width);
    margin: 0 auto;
}

/* ============================================================
   POST CARD
   ============================================================ */
.nc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.nc-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}
.nc-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.nc-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.nc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.nc-card:hover .nc-card-image img {
    transform: scale(1.03);
}
.nc-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.nc-card-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--blush);
    margin-bottom: 8px;
}
.nc-card-title {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 8px;
}
.nc-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}
.nc-card-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}
.nc-bull { color: var(--text-dim); }

/* List layout card override */
.nc-feed-list .nc-card { border-radius: var(--radius); }
.nc-feed-list .nc-card-link {
    flex-direction: row;
}
.nc-feed-list .nc-card-image {
    width: 240px;
    min-width: 240px;
    aspect-ratio: auto;
}
@media (max-width: 639px) {
    .nc-feed-list .nc-card-link { flex-direction: column; }
    .nc-feed-list .nc-card-image { width: 100%; aspect-ratio: 16 / 9; }
}

/* ============================================================
   ARTICLE
   ============================================================ */
.nc-article {
    max-width: var(--content-width);
    margin: 0 auto;
    padding-top: 120px;
}
.nc-article-header {
    margin-bottom: 48px;
}
.nc-article-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--blush);
    margin-bottom: 16px;
    text-decoration: none;
}
.nc-article-tag:hover { color: var(--blush-hover); }
.nc-article-title {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 16px;
}
@media (max-width: 639px) {
    .nc-article-title { font-size: 1.75rem; }
}
.nc-article-excerpt {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}
.nc-article-meta {
    font-size: 0.875rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}
.nc-article-image {
    margin-top: 32px;
    border-radius: var(--radius);
    overflow: hidden;
}
.nc-article-image img { width: 100%; }
.nc-article-image figcaption {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 8px;
}

/* --- Article Body (gh-content) --- */
.nc-article-body {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-primary);
}
.nc-article-body p { margin-bottom: 1.5em; }
.nc-article-body h2 {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 2em 0 0.75em;
}
.nc-article-body h3 {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 1.75em 0 0.5em;
}
.nc-article-body a {
    color: var(--blush);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 114, 154, 0.3);
    transition: border-color 0.3s ease;
}
.nc-article-body a:hover { border-bottom-color: var(--blush); }
.nc-article-body strong { color: #fff; font-weight: 600; }
.nc-article-body em { font-style: italic; color: var(--text-secondary); }
.nc-article-body blockquote {
    border-left: 3px solid var(--blush);
    padding-left: 24px;
    margin: 1.5em 0;
    color: var(--text-secondary);
    font-style: italic;
}
.nc-article-body code {
    background: var(--surface);
    color: var(--neon-blue);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.9em;
}
.nc-article-body pre {
    background: var(--midnight);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    margin: 1.5em 0;
}
.nc-article-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}
.nc-article-body ul, .nc-article-body ol {
    margin: 1em 0;
    padding-left: 1.5em;
}
.nc-article-body li { margin-bottom: 0.5em; }
.nc-article-body img {
    border-radius: var(--radius);
    margin: 1.5em 0;
}
/* Inline-styled float images from HTML cards — let inline styles win */
.nc-article-body img[style*="float"],
.nc-article-body figure[style*="float"] img {
    margin: 0;
    display: inline-block;
}
.nc-article-body figure[style*="float"] {
    margin: 0;
}
.nc-article-body .kg-html-card::after,
.nc-article-body .kg-card[data-kg-card="html"]::after {
    content: ''; display: table; clear: both;
}
.nc-article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

/* --- Inline float images (use in HTML cards) --- */
.img-right,
.img-left {
    max-width: 45%;
    margin-bottom: 1em;
    border-radius: var(--radius);
}
.img-right {
    float: right;
    margin-left: 1.5em;
}
.img-left {
    float: left;
    margin-right: 1.5em;
}
.img-small { max-width: 30%; }
.img-medium { max-width: 50%; }
.nc-article-body .clearfix::after,
.nc-article-body p:has(+ .img-right),
.nc-article-body p:has(+ .img-left) { clear: both; }
.nc-article-body .clear { clear: both; }

@media (max-width: 639px) {
    .img-right,
    .img-left {
        float: none;
        max-width: 100%;
        margin: 1.5em 0;
    }
}

/* --- Ghost image card width classes --- */
.kg-width-wide {
    max-width: min(1040px, calc(100vw - 48px));
    margin-left: calc(50% - min(520px, calc(50vw - 24px)));
    margin-right: calc(50% - min(520px, calc(50vw - 24px)));
}
.kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}

/* Ghost card styles (bookmark, gallery, etc.) */
.nc-article-body .kg-card { margin: 1.5em 0; }
.nc-article-body .kg-bookmark-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.nc-article-body .kg-bookmark-content { padding: 20px; }
.nc-article-body .kg-bookmark-title { color: #fff; font-weight: 600; }
.nc-article-body .kg-bookmark-description { color: var(--text-secondary); font-size: 0.875rem; }

/* ============================================================
   POST CTA / RELATED
   ============================================================ */
.nc-post-cta {
    text-align: center;
    padding: 48px;
    margin: 64px auto;
    max-width: var(--content-width);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.nc-post-cta h3 {
    font-family: var(--gh-font-heading, var(--font-display));
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 24px;
}

.nc-related {
    margin-top: 80px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}
.nc-related-title {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 32px;
}

/* ============================================================
   TAG / AUTHOR HEADER
   ============================================================ */
.nc-tag-header {
    padding: 120px 24px 48px;
    text-align: center;
}
.nc-tag-name {
    font-family: var(--gh-font-heading, var(--font-display));
    font-size: 2rem;
    color: #fff;
}
.nc-tag-description {
    color: var(--text-secondary);
    margin-top: 12px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.nc-pagination {
    text-align: center;
    margin-top: 48px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.nc-footer {
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid var(--border);
    padding: 32px 24px;
}
.nc-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.nc-copyright {
    color: var(--text-dim);
    font-size: 0.8rem;
}
.nc-copyright a { color: var(--text-dim); }
.nc-copyright a:hover { color: var(--blush); }
.nc-footer-nav {
    display: flex;
    gap: 24px;
    list-style: none;
}
.nc-footer-nav a {
    color: var(--text-dim);
    font-size: 0.8rem;
    transition: color 0.3s ease;
}
.nc-footer-nav a:hover { color: var(--blush); }
.nc-footer-nav .nav { display: flex; gap: 24px; list-style: none; }

/* ============================================================
   GHOST PORTAL OVERRIDES
   ============================================================ */
.gh-portal-popup-wrapper {
    --ghost-accent-color: #d4729a !important;
}
