/* style.css - AI Digital Karma
   Design tokens are injected as CSS custom properties via site_tokens_css(). */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding-top: var(--header-height, 72px);
    background: var(--color-bg, #0a0a12);
    color: var(--color-text, #f1f0f5);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.65;
}

h1, h2, h3, h4 {
    font-family: var(--font-display, system-ui, sans-serif);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    color: var(--color-accent-strong, #a78bfa);
    text-decoration: none;
}

a:hover {
    color: var(--color-cta, #f59e0b);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height, 72px);
    background: rgba(10, 10, 18, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border, #2a2a3d);
    z-index: 500;
}

.site-header__inner {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display, system-ui, sans-serif);
    font-weight: 300;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--color-text, #f1f0f5);
}

.site-logo img {
    width: 32px;
    height: 32px;
}

.site-logo span:last-of-type {
    color: var(--color-accent-strong, #a78bfa);
    font-weight: 500;
}

/* ── Navigation ────────────────────────────────────────────────────────────── */

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

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.site-nav__list a {
    color: var(--color-text, #f1f0f5);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav__list a:hover,
.site-nav__list a.is-active {
    color: var(--color-cta, #f59e0b);
}

.site-nav__item--has-dropdown {
    position: relative;
}

.nav-chevron::after {
    content: ' \25BE';
    font-size: 0.75em;
}

/* Dropdown sits flush against the trigger ... no transparent gap, so the
   cursor never crosses dead space between link and panel. */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 0.6rem;
    margin: 0;
    min-width: 230px;
    list-style: none;
    z-index: 600;
}

.nav-dropdown__panel {
    background: var(--color-panel, #181826);
    border: 1px solid var(--color-border, #2a2a3d);
    border-radius: var(--radius-small, 8px);
    padding: 0.5rem 0;
    box-shadow: var(--shadow-card);
}

.site-nav__item--has-dropdown.is-open .nav-dropdown {
    display: block;
}

.nav-dropdown li a {
    display: block;
    padding: 0.6rem 1.1rem;
    white-space: nowrap;
    font-size: 0.875rem;
}

.nav-dropdown li a:hover {
    background: var(--color-panel-soft, #1c1c2c);
    color: var(--color-cta, #f59e0b);
}

.nav-cta {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    background: var(--color-cta, #f59e0b);
    color: #0a0a12 !important;
    border-radius: var(--radius-small, 8px);
    font-weight: 600 !important;
}

.nav-cta:hover {
    background: var(--color-cta-strong, #fbbf24);
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
}

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

.nav-hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-active span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-hamburger__label {
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    color: var(--color-text-muted, #9b98ad);
    margin-top: 2px;
}

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

.page-wrapper {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-wrapper--flush {
    max-width: none;
    padding: 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

.content-layout--single {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    position: sticky;
    top: calc(var(--header-height, 72px) + 1.5rem);
}

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

.breadcrumbs {
    margin-bottom: 1.5rem;
}

.breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--color-text-muted, #9b98ad);
}

.breadcrumbs__item + .breadcrumbs__item::before {
    content: '/';
    margin-right: 0.5rem;
}

.breadcrumbs__item.is-current {
    color: var(--color-text, #f1f0f5);
}

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

.sidebar-block {
    background: var(--color-panel, #181826);
    border: 1px solid var(--color-border, #2a2a3d);
    border-radius: var(--radius-medium, 12px);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.sidebar-block__title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #9b98ad);
}

.sidebar-block__links {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cta-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent, #8b5cf6);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-small, 8px);
    font-size: 0.875rem;
    font-weight: 500;
}

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

.btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-small, 8px);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn--primary {
    background: var(--color-cta, #f59e0b);
    color: #0a0a12;
}

.btn--primary:hover {
    background: var(--color-cta-strong, #fbbf24);
    color: #0a0a12;
}

.btn--outline {
    border: 1px solid var(--color-accent, #8b5cf6);
    color: var(--color-accent-strong, #a78bfa);
    background: transparent;
}

.btn--outline:hover {
    border-color: var(--color-cta, #f59e0b);
    color: var(--color-cta, #f59e0b);
}

.text-muted {
    color: var(--color-text-muted, #9b98ad);
}

.eyebrow {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-strong, #a78bfa);
    margin-bottom: 0.75rem;
}

/* ── Card grid (used by directory, constellations, trade schools) ───────────── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--color-panel, #181826);
    border: 1px solid var(--color-border, #2a2a3d);
    border-radius: var(--radius-medium, 12px);
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
    border-color: var(--color-accent, #8b5cf6);
    transform: translateY(-2px);
}

.card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.card p {
    color: var(--color-text-muted, #9b98ad);
    font-size: 0.9rem;
    margin: 0;
}

.card a.card__link {
    color: inherit;
    text-decoration: none;
}

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

.error-page {
    text-align: center;
    padding: 5rem 1rem;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 200;
    margin: 0 0 0.5rem;
    color: var(--color-text-muted, #9b98ad);
}

.error-page p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   HOMEPAGE
   ════════════════════════════════════════════════════════════════════════════ */

.hero {
    position: relative;
    padding: 6rem 0 5rem;
    overflow: hidden;
    background-image: url('/assets/img/homepage-hero-desktop.webp');
    background-size: cover;
    background-position: center top;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,18,0.35) 0%, rgba(10,10,18,0.55) 55%, rgba(10,10,18,0.95) 100%);
}

.hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

.hero__copy h1 {
    font-size: 3.2rem;
    margin: 0 0 1.25rem;
    font-weight: 200;
}

.hero__copy h1 .accent {
    color: var(--color-cta, #f59e0b);
}

.hero__copy p {
    font-size: 1.1rem;
    color: var(--color-text-muted, #cbc8db);
    max-width: 46ch;
    margin: 0 0 1.75rem;
}

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

.hero__constellation {
    position: relative;
}

.hero__constellation svg {
    width: 100%;
    height: auto;
}

/* ── Section scaffolding ──────────────────────────────────────────────────── */

.section {
    padding: 5rem 0;
}

.section--alt {
    background: var(--color-surface, #13131f);
    border-top: 1px solid var(--color-border, #2a2a3d);
    border-bottom: 1px solid var(--color-border, #2a2a3d);
}

.section__head {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.section__head h2 {
    font-size: 2.2rem;
    margin: 0.25rem 0 1rem;
}

.section__head p {
    color: var(--color-text-muted, #9b98ad);
    font-size: 1.05rem;
}

/* Mission */
.mission__lead {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-text, #f1f0f5);
}

/* 4 levels grid (existing card SVGs, dropped in verbatim) */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.levels-grid img {
    border-radius: var(--radius-medium, 12px);
    border: 1px solid var(--color-border, #2a2a3d);
}

/* Pipeline strip (Idea -> Asset -> ... -> Revenue) */
.pipeline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 2.5rem 0 0;
    font-size: 0.9rem;
}

.pipeline span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border, #2a2a3d);
    border-radius: 999px;
    color: var(--color-text-muted, #9b98ad);
}

.pipeline span.is-accent {
    border-color: var(--color-cta, #f59e0b);
    color: var(--color-cta, #f59e0b);
}

/* Trade schools / constellations grids reuse .card-grid + .card */

.tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-panel-soft, #1c1c2c);
    border: 1px solid var(--color-border, #2a2a3d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--color-cta, #f59e0b);
}

/* Membership / pricing */
.membership-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: var(--color-panel, #181826);
    border: 1px solid var(--color-accent, #8b5cf6);
    border-radius: var(--radius-large, 20px);
    padding: 2rem 2.5rem;
}

.membership-banner h3 {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
}

.membership-banner p {
    margin: 0;
    color: var(--color-text-muted, #9b98ad);
}

/* Latest articles */
.article-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.article-row .card time {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted, #9b98ad);
    margin-bottom: 0.6rem;
}

/* Final CTA */
.cta-band {
    text-align: center;
    padding: 4rem 0;
}

.cta-band h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-band p {
    color: var(--color-text-muted, #9b98ad);
    margin-bottom: 2rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   DIRECTORY / GLOSSARY / FAQ
   ════════════════════════════════════════════════════════════════════════════ */

.page-hero {
    padding: 3.5rem 0 2.5rem;
    border-bottom: 1px solid var(--color-border, #2a2a3d);
    background: var(--color-surface, #13131f);
}

.page-hero h1 {
    font-size: 2.4rem;
    margin: 0.25rem 0 0.75rem;
}

.page-hero p {
    color: var(--color-text-muted, #9b98ad);
    max-width: 700px;
    margin: 0;
}

.field-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.field-table th,
.field-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border, #2a2a3d);
    font-size: 0.9rem;
}

.field-table th {
    color: var(--color-text-muted, #9b98ad);
    font-weight: 600;
    width: 35%;
}

.glossary-toc {
    margin-bottom: 2rem;
}

.glossary-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 2.5rem;
}

.glossary-letters a {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border, #2a2a3d);
    border-radius: var(--radius-small, 8px);
    font-size: 0.8rem;
}

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

.glossary-section h2 {
    font-size: 1.3rem;
    border-bottom: 1px solid var(--color-border, #2a2a3d);
    padding-bottom: 0.5rem;
}

.glossary-term-row {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border, #2a2a3d);
}

.glossary-term-row h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.glossary-term-row p {
    margin: 0;
    color: var(--color-text-muted, #9b98ad);
    font-size: 0.92rem;
}

.term-callout {
    background: var(--color-panel, #181826);
    border-left: 3px solid var(--color-accent, #8b5cf6);
    border-radius: var(--radius-small, 8px);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-size: 1.05rem;
}

.related-terms {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-category {
    margin-bottom: 2.5rem;
}

.faq-category h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.faq-item {
    border: 1px solid var(--color-border, #2a2a3d);
    border-radius: var(--radius-small, 8px);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

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

.faq-item summary::after {
    content: '+';
    float: right;
    color: var(--color-cta, #f59e0b);
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-item p {
    padding: 0 1.25rem 1.25rem;
    margin: 0;
    color: var(--color-text-muted, #cbc8db);
}

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

.site-footer {
    border-top: 1px solid var(--color-border, #2a2a3d);
    padding: 3.5rem 0 1.5rem;
    margin-top: 4rem;
    background: var(--color-surface, #13131f);
}

.site-footer__inner {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.site-footer__brand-name {
    font-family: var(--font-display, system-ui, sans-serif);
    font-weight: 300;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.site-footer__tagline {
    margin: 0 0 0.75rem;
    color: var(--color-text-muted, #9b98ad);
    font-size: 0.875rem;
}

.site-footer__contact a {
    color: var(--color-text-muted, #9b98ad);
    font-size: 0.875rem;
}

.site-footer__col-heading {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #9b98ad);
    margin-bottom: 0.9rem;
}

.site-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.site-footer__links a {
    color: var(--color-text, #f1f0f5);
    text-decoration: none;
    font-size: 0.875rem;
}

.site-footer__links a:hover {
    color: var(--color-cta, #f59e0b);
}

.site-footer__bottom {
    border-top: 1px solid var(--color-border, #2a2a3d);
    padding-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--color-text-muted, #9b98ad);
}

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

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

    .site-nav {
        display: none;
        position: fixed;
        top: var(--header-height, 72px);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-bg, #0a0a12);
        padding: 1.5rem;
        z-index: 400;
        overflow-y: auto;
    }

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

    .site-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.1rem;
    }

    .site-nav__list a {
        font-size: 1.1rem;
    }

    .nav-dropdown {
        position: static;
        padding-top: 0.5rem;
        display: none;
    }

    .site-nav__item--has-dropdown.is-open .nav-dropdown {
        display: block;
    }

    .nav-dropdown__panel {
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 1rem;
    }

    .hero__inner {
        grid-template-columns: 1fr;
    }

    .hero__copy h1 {
        font-size: 2.2rem;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .content-sidebar {
        position: static;
    }

    /* Footer collapses to a single column with 2x-sized text/links */
    .site-footer__top {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }

    .site-footer__brand-name { font-size: 1.6rem; }
    .site-footer__tagline,
    .site-footer__contact a { font-size: 1.1rem; }
    .site-footer__col-heading { font-size: 1rem; }
    .site-footer__links a { font-size: 1.4rem; }
    .site-footer__links { gap: 0.9rem; }
}
