/* AISymantics ... site.css
   Dark semantic intelligence theme. Design tokens set in <style> tag via PHP.
   Palette: bg #080c18, surface #0d1121, card #111726, accent #3d7fff,
            violet #7c5cfc, cyan #00d4ff, green #00c77f, gold #ffc94d
*/

/* ── Reset & base ──────────────────────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    padding-top: var(--header-height);
    min-height: 100vh;
}

img, video, svg { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1.15rem; }
p:last-child { margin-bottom: 0; }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

code { padding: 0.1em 0.35em; }
pre { padding: 1rem 1.25rem; overflow-x: auto; }
pre code { background: none; border: none; padding: 0; }

blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 0.75rem 1.25rem;
    background: var(--color-surface);
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ── Layout helpers ────────────────────────────────────────────────────────── */

.content-wrapper {
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: #2d65df;
    border-color: #2d65df;
    text-decoration: none;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-ghost:hover {
    background: rgba(61, 127, 255, 0.1);
    text-decoration: none;
}

.btn-accent {
    background: var(--color-violet);
    color: #fff;
    border-color: var(--color-violet);
}

.btn-accent:hover {
    background: #6a49df;
    border-color: #6a49df;
    text-decoration: none;
    color: #fff;
}

.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.82rem; }

/* ── Header / Nav ──────────────────────────────────────────────────────────── */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: var(--header-height);
    background: rgba(8, 12, 24, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-primary { color: var(--color-accent); }
.logo-secondary { color: var(--color-text); }

.site-nav { flex: 1; }

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
}

.nav-item { position: relative; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
    border-radius: 0;
}

.nav-link:hover,
.nav-link.is-active { color: var(--color-text); text-decoration: none; }

.nav-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.6;
    transition: transform 0.15s;
}

.nav-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.nav-submenu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 0;
    list-style: none;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-submenu.is-open { display: block; }

.nav-sublink {
    display: block;
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.nav-sublink:hover,
.nav-sublink.is-active {
    color: var(--color-text);
    background: var(--color-surface-card);
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav ────────────────────────────────────────────────────────────── */

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-surface);
    z-index: 190;
    overflow-y: auto;
    padding: 1.5rem;
}

.mobile-nav.is-open { display: block; }

.mobile-nav-list { list-style: none; padding: 0; }

.mobile-nav-link {
    display: block;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-sub { list-style: none; padding: 0; }

.mobile-nav-sub-link {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.mobile-nav-sub-link:hover { color: var(--color-text); }

/* ── Breadcrumbs ───────────────────────────────────────────────────────────── */

.breadcrumbs {
    padding: 0.75rem 0 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.breadcrumb-list {
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    padding-bottom: 0.75rem;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.breadcrumb-list li + li::before {
    content: '/';
    opacity: 0.4;
    flex-shrink: 0;
}

.breadcrumb-list a { color: var(--color-text-muted); }
.breadcrumb-list a:hover { color: var(--color-accent); }
.breadcrumb-list [aria-current] { color: var(--color-text); }

/* ── Main content ──────────────────────────────────────────────────────────── */

.site-main {
    min-height: calc(100vh - var(--header-height) - 200px);
    padding-bottom: 4rem;
}

.page-header {
    padding-block: 3rem 2rem;
}

.page-header h1 {
    margin-bottom: 0.75rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 64ch;
}

/* ── Home Hero ─────────────────────────────────────────────────────────────── */

.home-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding-block: 5rem 4rem;
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.hero-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}

.hero-headline {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    font-weight: 300;
}

.hero-body {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 52ch;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.entity-network svg {
    width: 100%;
    max-width: 420px;
    opacity: 0.85;
}

/* ── Stats ─────────────────────────────────────────────────────────────────── */

.home-stats {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding-block: 2.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 300;
    color: var(--color-accent);
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* ── Platform Cards ────────────────────────────────────────────────────────── */

.home-platform { padding-block: 4rem; }

.section-heading {
    text-align: center;
    margin-bottom: 0.75rem;
}

.section-sub {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

.section-cta { text-align: center; margin-top: 2.5rem; }

.platform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.platform-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.platform-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    text-decoration: none;
}

.card-icon-wrap {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
}

.card-desc {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.card-tag {
    margin-top: auto;
    align-self: flex-start;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(61, 127, 255, 0.12);
    color: var(--color-accent);
    border-radius: 4px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Article grid ──────────────────────────────────────────────────────────── */

.home-articles { padding-block: 4rem; }
.home-articles .content-wrapper { max-width: var(--content-width); margin-inline: auto; padding-inline: 1.5rem; }

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.article-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.article-card-title {
    font-size: 1rem;
    font-weight: 400;
}

.article-card-title a {
    color: var(--color-text);
    text-decoration: none;
}

.article-card-title a:hover { color: var(--color-accent); }

.article-card-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.article-card-date {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin-top: auto;
}

/* ── Closing CTA ───────────────────────────────────────────────────────────── */

.home-closing-cta {
    background: linear-gradient(135deg, rgba(61, 127, 255, 0.08) 0%, rgba(124, 92, 252, 0.08) 100%);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding-block: 4rem;
    text-align: center;
}

.home-closing-cta .content-wrapper { max-width: var(--content-width); margin-inline: auto; padding-inline: 1.5rem; }

.home-closing-cta h2 { margin-bottom: 1rem; }
.home-closing-cta p { color: var(--color-text-muted); margin-bottom: 2rem; max-width: 52ch; margin-inline: auto; }

.cta-buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ── Two-column layout (article, category, glossary, faq, directory) ───────── */

.layout-article,
.layout-category,
.layout-glossary,
.layout-glossary-term,
.layout-faq,
.layout-faq-item,
.layout-dir-category,
.layout-dir-listing,
.layout-contact {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    padding-top: 2rem;
}

/* ── Article ───────────────────────────────────────────────────────────────── */

.article-header { margin-bottom: 2.5rem; }

.article-category {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}

.article-category a { color: inherit; }

.article-title { margin-bottom: 0.75rem; }
.article-excerpt { font-size: 1.1rem; color: var(--color-text-muted); font-weight: 300; margin-bottom: 1rem; }

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.article-content h2 { margin-top: 2.5rem; margin-bottom: 1rem; }
.article-content h3 { margin-top: 2rem; margin-bottom: 0.75rem; }
.article-content ul, .article-content ol { margin-bottom: 1.15rem; }
.article-content li { margin-bottom: 0.35rem; }

.article-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-muted);
}

.inline-cta {
    background: linear-gradient(135deg, rgba(61, 127, 255, 0.08), rgba(124, 92, 252, 0.08));
    border: 1px solid rgba(61, 127, 255, 0.25);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.inline-cta h3 { margin-bottom: 0.5rem; }
.inline-cta p { color: var(--color-text-muted); margin-bottom: 1rem; }

.related-articles { padding-block: 3rem; border-top: 1px solid var(--color-border); margin-top: 2rem; }

/* ── Category / Library ────────────────────────────────────────────────────── */

.category-main { }
.category-header { margin-bottom: 2rem; }
.category-title { margin-bottom: 0.5rem; }
.category-desc { color: var(--color-text-muted); font-size: 1.05rem; }

.category-children {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.category-child-link {
    padding: 0.3rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.category-child-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

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

.article-row {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.article-row:last-child { border-bottom: none; }

.article-row-title { font-size: 1.1rem; font-weight: 400; margin-bottom: 0.4rem; }
.article-row-title a { color: var(--color-text); }
.article-row-title a:hover { color: var(--color-accent); }
.article-row-excerpt { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 0.4rem; }
.article-row-date { font-size: 0.78rem; color: var(--color-text-muted); font-family: var(--font-mono); }

/* ── Library index ─────────────────────────────────────────────────────────── */

.library-index .page-header { padding-top: 3rem; }

.library-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    padding-bottom: 4rem;
}

.library-category-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.2s, transform 0.2s;
}

.library-category-card:hover { border-color: var(--color-accent); transform: translateY(-2px); text-decoration: none; }

.lib-cat-title { font-size: 1rem; font-weight: 500; color: var(--color-text); }
.lib-cat-desc { font-size: 0.875rem; color: var(--color-text-muted); }
.lib-cat-count { font-size: 0.75rem; color: var(--color-accent); margin-top: auto; font-family: var(--font-mono); }

/* ── Directory ─────────────────────────────────────────────────────────────── */

.directory-root .page-header { padding-top: 3rem; }

.directory-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.dir-category-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.5rem;
}

.dir-cat-link { text-decoration: none; }
.dir-cat-title { font-size: 1rem; font-weight: 500; color: var(--color-text); margin-bottom: 0.5rem; }
.dir-cat-link:hover .dir-cat-title { color: var(--color-accent); }
.dir-cat-desc { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.dir-cat-preview { list-style: none; padding: 0; font-size: 0.875rem; }
.dir-cat-preview li { padding: 0.25rem 0; border-bottom: 1px solid var(--color-border); }
.dir-cat-preview li:last-child { border-bottom: none; }
.dir-more-link { color: var(--color-text-muted); font-style: italic; }

.dir-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.dir-subcat-link {
    padding: 0.3rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.dir-subcat-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

.dir-listings-list { display: flex; flex-direction: column; gap: 1.5rem; }

.dir-listing-row {
    padding: 1.25rem;
    background: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.dir-listing-title { font-size: 1rem; font-weight: 400; margin-bottom: 0.35rem; }
.dir-listing-title a { color: var(--color-text); }
.dir-listing-title a:hover { color: var(--color-accent); }
.dir-listing-excerpt { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }

.dir-listing-fields { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.dir-field { display: flex; gap: 0.35rem; font-size: 0.82rem; }
.dir-field dt { color: var(--color-text-muted); }
.dir-field dd { color: var(--color-text); }

.listing-category {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-violet);
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}

.listing-category a { color: inherit; }
.listing-title { margin-bottom: 0.5rem; }
.listing-excerpt { font-size: 1.1rem; color: var(--color-text-muted); font-weight: 300; margin-bottom: 1rem; }
.listing-description { margin-bottom: 2rem; }

.listing-details {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.detail-row { display: flex; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--color-border); align-items: baseline; }
.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: var(--color-text-muted); font-size: 0.85rem; min-width: 140px; flex-shrink: 0; }
.detail-row dd { color: var(--color-text); }

.listing-cta { margin-top: 2rem; }

/* ── Glossary ──────────────────────────────────────────────────────────────── */

.glossary-alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.alpha-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.alpha-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

.glossary-letter-section { margin-bottom: 2.5rem; }

.glossary-letter {
    font-size: 1.25rem;
    font-weight: 200;
    color: var(--color-accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.glossary-term-list { display: flex; flex-direction: column; gap: 0; }

.glossary-entry {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(28, 35, 64, 0.6);
    align-items: baseline;
}

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

.glossary-term a {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.95rem;
}

.glossary-term a:hover { color: var(--color-accent); }
.glossary-def { font-size: 0.875rem; color: var(--color-text-muted); line-height: 1.5; }

/* ── Glossary term page ────────────────────────────────────────────────────── */

.term-collection {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-cyan);
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}

.term-collection a { color: inherit; }
.term-title { margin-bottom: 0.5rem; }
.term-aka { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.term-short-def { font-size: 1.05rem; color: var(--color-text-muted); font-weight: 300; margin-bottom: 0.5rem; }

.term-full-def { margin-top: 1.5rem; }
.term-full-def h2, .term-full-def h3 { margin-top: 1.75rem; margin-bottom: 0.75rem; }
.term-full-def ul, .term-full-def ol { margin-bottom: 1rem; }

.related-terms { margin-top: 2.5rem; }
.related-terms h2 { font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); }
.related-terms-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.related-terms-list a { color: var(--color-text); font-size: 0.9rem; }
.related-terms-list a:hover { color: var(--color-accent); }
.related-def { color: var(--color-text-muted); font-size: 0.85rem; }

/* ── FAQ ───────────────────────────────────────────────────────────────────── */

.faq-collections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.faq-collection-link {
    padding: 0.35rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.faq-collection-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

.faq-list { display: flex; flex-direction: column; }

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item[open] {
    background: var(--color-surface);
}

.faq-question {
    padding: 1.1rem 0;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--color-accent);
    flex-shrink: 0;
    margin-left: 1rem;
    font-weight: 300;
}

.faq-item[open] .faq-question::after { content: '...'; }

.faq-question-link { color: inherit; text-decoration: none; flex: 1; }
.faq-question-link:hover { color: var(--color-accent); text-decoration: none; }

.faq-answer {
    padding: 0 0 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.65;
}

.faq-read-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-accent);
}

/* ── FAQ item page ─────────────────────────────────────────────────────────── */

.faq-collection {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}

.faq-collection a { color: inherit; }
.faq-item-question { margin-bottom: 1.5rem; }

.faq-item-answer { margin-bottom: 2rem; }
.faq-short-answer { font-size: 1.1rem; font-weight: 300; margin-bottom: 1rem; color: var(--color-text); }

.faq-related-items, .faq-related-articles { margin-top: 2rem; }
.faq-related-items h2, .faq-related-articles h2 { font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); }
.faq-related-items ul, .faq-related-articles ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.faq-related-items a, .faq-related-articles a { color: var(--color-text); font-size: 0.9rem; }
.faq-related-items a:hover, .faq-related-articles a:hover { color: var(--color-accent); }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.article-sidebar,
.category-sidebar,
.glossary-sidebar,
.term-sidebar,
.faq-sidebar,
.faq-item-sidebar,
.dir-sidebar,
.dir-cat-sidebar,
.listing-sidebar,
.contact-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 2rem;
}

.sidebar-cta,
.sidebar-links,
.sidebar-related,
.sidebar-text {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem;
}

.sidebar-heading {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}

.sidebar-cta p { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 1rem; }
.sidebar-cta .btn { width: 100%; justify-content: center; }

.sidebar-links ul, .sidebar-related ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-links a, .sidebar-related a { font-size: 0.875rem; color: var(--color-text-muted); padding: 0.25rem 0; display: block; }
.sidebar-links a:hover, .sidebar-related a:hover { color: var(--color-accent); }
.sidebar-text p { font-size: 0.875rem; color: var(--color-text-muted); }

.sidebar-empty { font-size: 0.85rem; color: var(--color-text-muted); }

/* ── Contact ───────────────────────────────────────────────────────────────── */

.contact-notice {
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.contact-success { background: rgba(0, 199, 127, 0.1); border: 1px solid rgba(0, 199, 127, 0.3); color: var(--color-green); }
.contact-error { background: rgba(255, 95, 95, 0.1); border: 1px solid rgba(255, 95, 95, 0.3); color: #ff5f5f; }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-field { display: flex; flex-direction: column; gap: 0.4rem; }

.form-field label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.form-field label span { color: var(--color-accent); }

.form-field input,
.form-field select,
.form-field textarea {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.65rem 0.9rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--color-text-muted); opacity: 0.6; }

.form-field textarea { resize: vertical; }

.contact-form .btn { align-self: flex-start; margin-top: 0.5rem; }

/* ── Error ─────────────────────────────────────────────────────────────────── */

.layout-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding-top: 3rem;
}

.error-body { text-align: center; }

.error-code {
    font-size: 8rem;
    font-weight: 100;
    font-family: var(--font-display);
    color: var(--color-border);
    line-height: 1;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.error-title { margin-bottom: 0.75rem; }
.error-desc { color: var(--color-text-muted); margin-bottom: 2rem; }
.error-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ── Empty state ───────────────────────────────────────────────────────────── */

.empty-state { color: var(--color-text-muted); font-size: 0.95rem; padding: 2rem 0; }

/* ── Page blocks ───────────────────────────────────────────────────────────── */

.page-default { padding-top: 3rem; }

.block-hero { padding-bottom: 3rem; }
.block-hero h1 { margin-bottom: 0.75rem; }
.block-hero .hero-body { color: var(--color-text-muted); margin-bottom: 1.5rem; max-width: 60ch; }

.block-text { padding-bottom: 2rem; border-bottom: 1px solid var(--color-border); margin-bottom: 2rem; }
.block-text h2 { margin-bottom: 0.75rem; }

.block-cta {
    background: linear-gradient(135deg, rgba(61, 127, 255, 0.08), rgba(124, 92, 252, 0.08));
    border: 1px solid rgba(61, 127, 255, 0.2);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.block-cta h2 { margin-bottom: 0.75rem; }
.block-cta p { color: var(--color-text-muted); margin-bottom: 1.5rem; }

/* ── Footer ────────────────────────────────────────────────────────────────── */

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding-block: 3rem;
}

.footer-inner {
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 3rem;
    align-items: start;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 300;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-tagline { font-size: 0.85rem; color: var(--color-text-muted); }

.footer-nav ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-nav a { font-size: 0.875rem; color: var(--color-text-muted); }
.footer-nav a:hover { color: var(--color-text); }

.footer-meta { text-align: right; }
.footer-copy { font-size: 0.8rem; color: var(--color-text-muted); }
.footer-by { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.footer-by a { color: var(--color-text-muted); }
.footer-by a:hover { color: var(--color-accent); }

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .platform-grid { grid-template-columns: repeat(2, 1fr); }
    .library-categories { grid-template-columns: repeat(2, 1fr); }
    .directory-category-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .site-nav { display: none; }
    .nav-burger { display: flex; }

    .home-hero { grid-template-columns: 1fr; padding-block: 3rem 2rem; }
    .hero-visual { display: none; }

    .layout-article,
    .layout-category,
    .layout-glossary,
    .layout-glossary-term,
    .layout-faq,
    .layout-faq-item,
    .layout-dir-category,
    .layout-dir-listing,
    .layout-contact {
        grid-template-columns: 1fr;
    }

    .article-sidebar,
    .category-sidebar,
    .glossary-sidebar,
    .term-sidebar,
    .faq-sidebar,
    .faq-item-sidebar,
    .dir-sidebar,
    .listing-sidebar,
    .contact-sidebar { order: -1; padding-top: 0; }

    .article-grid { grid-template-columns: 1fr; }
    .platform-grid { grid-template-columns: 1fr; }
    .library-categories { grid-template-columns: 1fr; }
    .directory-category-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
    .footer-meta { text-align: left; }

    .glossary-entry { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero-ctas { flex-direction: column; }
    .cta-buttons { flex-direction: column; }
}
