/* Sophisticated editorial layer for the public portal. */
:root {
    --ink: #f3f7fb;
    --ink-soft: #b9c5d2;
    --ink-muted: #7f8b99;
    --panel: rgba(9, 15, 24, 0.78);
    --panel-strong: rgba(12, 19, 30, 0.94);
    --line-soft: rgba(160, 190, 210, 0.14);
    --line-hot: rgba(0, 212, 255, 0.38);
    --signal-amber: #ffcc66;
    --signal-green: #31f2a0;
    --signal-red: #ff5d7a;
    --radius-card: 8px;
    --shadow-elevated: 0 22px 70px rgba(0, 0, 0, 0.45);
    --shadow-subtle: 0 14px 38px rgba(0, 0, 0, 0.28);
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        linear-gradient(180deg, rgba(6, 11, 18, 0.94), rgba(5, 5, 5, 1) 54%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 96px);
    color: var(--ink);
    letter-spacing: 0;
}

body::before {
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.018) 1px, transparent 1px);
    background-size: 72px 72px;
    animation: none;
}

.particles-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 12px;
    z-index: 10001;
    padding: 8px 16px;
    background: var(--neon-cyan);
    color: #001014;
    font-weight: 800;
    text-decoration: none;
}

.skip-link:focus {
    left: 12px;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(5, 8, 13, 0.82);
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.portal-nav {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand-lockup,
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
}

.brand-sigil {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line-hot);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.16), rgba(49, 242, 160, 0.06));
    color: #dffbff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    box-shadow: 0 0 22px rgba(0, 212, 255, 0.16);
}

.brand-copy {
    font-size: 1.02rem;
    letter-spacing: 0;
}

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

.nav-links a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--ink);
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, 0.04);
}

.portal-hero {
    min-height: clamp(560px, 70vh, 760px);
    display: flex;
    align-items: center;
    padding: 72px 22px 54px;
    text-align: left;
    overflow: hidden;
    border-bottom: 1px solid var(--line-soft);
    background:
        linear-gradient(90deg, rgba(0, 212, 255, 0.08) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 38%);
}

.portal-hero .hero-content {
    width: min(1440px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.72fr);
    gap: clamp(26px, 5vw, 72px);
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-copy {
    max-width: 820px;
}

.hero-kicker,
.section-kicker,
.article-kicker {
    display: inline-flex;
    align-items: center;
    color: var(--signal-green);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-title {
    max-width: 820px;
    margin: 14px 0 18px;
    color: var(--ink);
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: clamp(2.7rem, 5.8vw, 5.8rem);
    line-height: 0.98;
    font-weight: 800;
    letter-spacing: 0;
}

.hero-subtitle {
    max-width: 680px;
    margin: 0;
    color: var(--ink-soft);
    font-size: clamp(1.04rem, 1.6vw, 1.28rem);
    line-height: 1.7;
}

.hero-console {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, rgba(11, 18, 29, 0.9), rgba(8, 11, 17, 0.78));
    box-shadow: var(--shadow-elevated);
    padding: 18px;
}

.console-strip {
    display: flex;
    justify-content: space-between;
    margin: -4px 0 18px;
    color: var(--ink-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
}

.console-strip strong {
    color: var(--signal-green);
}

.hero-command-label {
    display: block;
    margin-bottom: 10px;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.search-container {
    max-width: none;
    margin: 0;
}

.search-input {
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid var(--line-hot);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.42);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.search-input:focus {
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hero-metrics,
.feed-intro-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.feed-intro-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
}

.metric-card,
.feed-stat {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.035);
}

.metric-card strong,
.feed-stat strong {
    display: block;
    color: var(--ink);
    font-size: 1.65rem;
    line-height: 1;
}

.metric-card span,
.feed-stat span {
    display: block;
    margin-top: 8px;
    color: var(--ink-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.feed-control {
    width: min(1440px, calc(100% - 44px));
    margin: 42px auto 0;
    position: relative;
    z-index: 10;
}

.feed-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.55fr);
    align-items: end;
    gap: 22px;
}

.section-title {
    margin-top: 10px;
    color: var(--ink);
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.section-copy {
    max-width: 760px;
    margin-top: 12px;
    color: var(--ink-soft);
    line-height: 1.7;
}

.category-filters {
    justify-content: flex-start;
    padding: 26px 0 16px;
    gap: 10px;
}

.filter-pill {
    border-width: 1px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--ink-soft);
}

.filter-pill:hover,
.filter-pill.active,
.filter-pill.is-active {
    color: var(--ink);
    border-color: var(--line-hot);
    background: rgba(0, 212, 255, 0.08);
    box-shadow: none;
}

.home-status {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-card);
    background: var(--panel);
    color: var(--ink-soft);
}

.clear-filters {
    flex: 0 0 auto;
}

.inline-loading {
    position: relative;
    z-index: 10;
    padding: 48px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.inline-loading p {
    margin-top: 14px;
    color: var(--ink-soft);
}

.articles-grid {
    width: min(1440px, calc(100% - 44px));
    padding: 28px 0 42px;
    gap: 18px;
}

.article-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, rgba(14, 21, 33, 0.96), rgba(8, 10, 14, 0.98));
    border-color: var(--line-soft);
    box-shadow: var(--shadow-subtle);
}

.articles-grid:hover .article-card:not(:hover) {
    opacity: 1;
}

.article-card:hover,
.article-card:focus-within {
    transform: translateY(-6px);
    border-color: var(--line-hot);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 212, 255, 0.12);
}

.article-image {
    height: 190px;
}

.article-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.article-category {
    width: fit-content;
    border-radius: 6px;
    color: var(--signal-green);
    border-color: rgba(49, 242, 160, 0.25);
    background: rgba(49, 242, 160, 0.07);
}

.article-title {
    font-size: 1.08rem;
    line-height: 1.36;
}

.article-excerpt {
    color: var(--ink-soft);
}

.article-meta {
    margin-top: auto;
}

.load-more-wrap {
    position: relative;
    z-index: 10;
    width: min(1440px, calc(100% - 44px));
    margin: 0 auto;
    padding: 10px 0 62px;
    text-align: center;
}

.btn-neon {
    border-width: 1px;
    border-radius: 8px;
    color: var(--ink);
    background: rgba(0, 212, 255, 0.07);
}

.portal-footer {
    position: relative;
    z-index: 10;
    margin-top: 38px;
    padding: 52px 22px 24px;
    border-top: 1px solid var(--line-soft);
    background: rgba(4, 7, 11, 0.72);
}

.footer-grid {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 34px;
}

.portal-footer h3,
.portal-footer h4 {
    margin-bottom: 12px;
    color: var(--ink);
}

.portal-footer p,
.portal-footer li,
.portal-footer a {
    color: var(--ink-soft);
    text-decoration: none;
    list-style: none;
}

.portal-footer ul {
    list-style: none;
}

.portal-footer a:hover {
    color: var(--neon-cyan);
}

.footer-copy {
    max-width: 1440px;
    margin: 32px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-muted);
    font-size: 0.9rem;
    text-align: center;
}

.cookie-banner {
    background: rgba(5, 8, 12, 0.96);
    border-top: 1px solid var(--line-hot);
    backdrop-filter: blur(18px);
}

.cookie-content a {
    color: var(--neon-cyan);
}

.language-selector {
    border-radius: 8px;
    border-color: var(--line-soft);
    background: rgba(5, 8, 12, 0.82);
    backdrop-filter: blur(16px);
}

.lang-btn {
    border-radius: 6px;
}

/* Article reading experience */
.article-progress-track {
    position: fixed;
    inset: 0 0 auto;
    height: 3px;
    z-index: 300;
    background: rgba(255, 255, 255, 0.04);
}

.article-progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--signal-green), var(--neon-cyan), var(--signal-amber));
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.38);
    transition: width 120ms ease-out;
}

.article-page-shell {
    position: relative;
    z-index: 10;
    padding: 0 22px 70px;
}

.article-container {
    width: min(1180px, 100%);
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.article-header {
    padding: 92px 0 46px;
    margin-bottom: 38px;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
}

.article-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.48fr);
    gap: clamp(24px, 4vw, 58px);
    align-items: end;
}

.article-back-link {
    display: inline-flex;
    margin-bottom: 24px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
}

.article-back-link::before {
    content: "←";
    margin-right: 8px;
    color: var(--neon-cyan);
}

.article-back-link:hover {
    color: var(--ink);
}

.article-category-badge {
    border-radius: 6px;
    border-color: rgba(49, 242, 160, 0.32);
    background: rgba(49, 242, 160, 0.08);
    color: var(--signal-green);
    box-shadow: none;
}

.article-title-main {
    max-width: 890px;
    margin: 0;
    color: var(--ink);
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: clamp(2.25rem, 5vw, 5rem);
    line-height: 1;
    letter-spacing: 0;
}

.article-deck {
    max-width: 760px;
    margin-top: 20px;
    color: var(--ink-soft);
    font-size: clamp(1.05rem, 1.5vw, 1.22rem);
    line-height: 1.72;
}

.article-briefing {
    display: grid;
    gap: 10px;
}

.article-briefing > div {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-card);
    background: var(--panel);
    padding: 14px;
}

.article-briefing span {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    text-transform: uppercase;
}

.article-briefing strong {
    display: block;
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.45;
}

.article-featured-image {
    width: min(980px, 100%);
    max-height: 560px;
    display: block;
    margin: 0 auto 54px;
    border-radius: var(--radius-card);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-elevated);
}

.article-content-body {
    max-width: 74ch;
    margin: 0 auto;
    color: var(--ink);
    font-size: clamp(1.06rem, 1.2vw, 1.16rem);
    line-height: 1.88;
    overflow-wrap: anywhere;
}

.article-content-body > p:first-of-type {
    color: #f9fbfd;
    font-size: clamp(1.12rem, 1.4vw, 1.28rem);
}

.article-content-body h2 {
    margin: 56px 0 18px;
    color: var(--ink);
    font-size: clamp(1.65rem, 2.5vw, 2.3rem);
    line-height: 1.16;
    letter-spacing: 0;
}

.article-content-body h2::before {
    content: "";
    display: block;
    width: 56px;
    height: 2px;
    margin-bottom: 16px;
    background: linear-gradient(90deg, var(--signal-green), var(--neon-cyan));
}

.article-content-body h3 {
    color: var(--ink);
}

.article-content-body p,
.article-content-body li {
    color: var(--ink-soft);
}

.article-content-body strong {
    color: var(--ink);
}

.article-content-body a {
    color: #9df4ff;
    text-decoration-color: rgba(157, 244, 255, 0.42);
    text-underline-offset: 0.18em;
}

.article-content-body blockquote {
    margin: 30px 0;
    padding: 18px 20px;
    border-left: 3px solid var(--neon-cyan);
    background: rgba(0, 212, 255, 0.06);
    color: var(--ink);
}

.article-content-body pre {
    margin: 28px 0;
    padding: 18px;
    overflow-x: auto;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-card);
    background: rgba(1, 5, 9, 0.84);
}

.article-content-body code {
    font-family: 'JetBrains Mono', monospace;
}

.article-endcap,
.share-section {
    width: min(980px, 100%);
    margin: 46px auto 0;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, rgba(14, 21, 33, 0.9), rgba(8, 10, 14, 0.88));
    box-shadow: var(--shadow-subtle);
}

.article-endcap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 22px;
}

.article-endcap h2 {
    margin: 8px 0;
    color: var(--ink);
    font-size: clamp(1.45rem, 2.4vw, 2.1rem);
    line-height: 1.16;
}

.article-endcap p {
    color: var(--ink-soft);
}

.article-post-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--line-hot);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    background: rgba(0, 212, 255, 0.08);
}

.share-section {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.share-section > span {
    color: var(--ink-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    min-height: 40px;
    border-radius: 8px;
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, 0.035);
}

@media (max-width: 980px) {
    .article-hero-grid,
    .article-endcap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .portal-hero .hero-content,
    .feed-intro {
        grid-template-columns: 1fr;
    }

    .portal-hero {
        min-height: auto;
        padding-top: 58px;
    }
}

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

    .nav-toggle {
        display: none;
    }

    .nav-links {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        border-left: 0;
        background: transparent;
        backdrop-filter: none;
        flex-direction: row !important;
        justify-content: flex-end;
        gap: 18px;
    }

    .nav-links a {
        font-size: 0.9rem !important;
        padding: 0;
    }

    .hero-title {
        font-size: 2.65rem;
    }

    .hero-metrics,
    .feed-intro-meta {
        grid-template-columns: 1fr;
    }

    .feed-control,
    .articles-grid,
    .load-more-wrap {
        width: min(100% - 28px, 1440px);
    }

    .home-status {
        align-items: stretch;
        flex-direction: column;
    }

    .clear-filters {
        width: 100%;
    }

    .article-page-shell {
        padding-inline: 14px;
    }

    .article-header {
        padding-top: 70px;
    }

    .article-title-main {
        font-size: 2.45rem;
    }

    .share-section {
        align-items: stretch;
        flex-direction: column;
    }

    .share-btn,
    .article-post-link {
        width: 100%;
    }
}
