/* ==========================================================================
   Noesis Ghost theme
   Brand: dark cosmos, MuseoModerno reserved for the Noesis wordmark only,
   Sansation for titles + accents, purple accent.
   ========================================================================== */

:root {
    --void: #000000;
    --cosmos-1: #0E0E12;
    --cosmos-2: #16161d;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-raised: rgba(255, 255, 255, 0.10);
    --surface-raised-hover: rgba(255, 255, 255, 0.14);
    --surface-border: rgba(245, 245, 247, 0.10);
    --starlight: #F5F5F7;
    --muted: rgba(245, 245, 247, 0.62);
    --faint: rgba(245, 245, 247, 0.45);
    --hairline: rgba(245, 245, 247, 0.18);
    --accent: #8E4EC6;
    --accent-bright: #AB68DB;

    --font-display: 'MuseoModerno', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-accent: 'Sansation', -apple-system, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;

    --measure: 42rem;
    --wrap: 68rem;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--starlight);
    background: var(--void);
    line-height: 1.65;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-bright); text-decoration: none; transition: color 160ms ease, opacity 160ms ease; }
a:hover { color: var(--starlight); }

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

canvas#stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: -1;
    pointer-events: none;
}

.site-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.site-main { flex: 1 0 auto; width: 100%; }
.sep { color: var(--hairline); margin: 0 0.5rem; }

/* ==========================================================================
   Top navigation (content pages)
   ========================================================================== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    background: rgba(0, 0, 0, 0.55);
    border-bottom: 1px solid var(--surface-border);
}

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

.site-nav-brand { display: flex; align-items: center; gap: 2px; }
.site-nav-mark { width: 28px; height: 28px; }
.site-nav-wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.06em;
    font-size: 22px;
    color: var(--starlight);
}

.site-nav-menu { display: flex; align-items: center; gap: 22px; }
.nav-item {
    font-family: var(--font-accent);
    font-size: 15px;
    color: var(--muted);
    letter-spacing: 0.01em;
}
.nav-item:hover, .nav-item--current { color: var(--starlight); }
.nav-appstore { display: inline-flex; align-items: center; line-height: 0; transition: opacity 160ms ease, transform 160ms ease; }
.nav-appstore img { height: 36px; width: auto; }
.nav-appstore:hover { opacity: 0.9; transform: translateY(-1px); }
.nav-appstore:active { transform: scale(0.98); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 40px 24px calc(28px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--surface-border);
}
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.footer-nav a {
    color: var(--faint);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-body);
}
.footer-nav a:hover { color: var(--starlight); }
.footer-nav .nav-item:not(:last-child)::after { content: "·"; color: var(--hairline); margin: 0 0.7rem; display: inline-block; }
.footer-legal { margin-top: 14px; color: var(--hairline); font-size: 12px; letter-spacing: 0.04em; }

/* ==========================================================================
   Home splash — faithful port of the original trynoesis.app landing page
   ========================================================================== */
.home-template .site-nav { display: none; }
.home-template .site-main { display: flex; flex-direction: column; justify-content: center; }

.splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    gap: clamp(32px, 4vw, 42px);
}

.brand-splash { display: flex; flex-direction: column; align-items: center; }

.icon-wrap {
    width: clamp(176px, 24vw, 216px);
    height: clamp(176px, 24vw, 216px);
    animation: floatIn 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.icon-wrap img { width: 100%; height: 100%; }

.lockup { display: flex; flex-direction: column; align-items: center; margin-top: clamp(-28px, -3.4vw, -20px); }

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(88px, 12vw, 108px);
    letter-spacing: -0.075em;
    color: var(--starlight);
    line-height: 1;
    animation: floatIn 1100ms 120ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tagline {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: clamp(17.6px, 2.4vw, 21.6px);
    color: var(--starlight);
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
    white-space: nowrap;
    margin-top: clamp(-6px, -0.5vw, -3px);
    transform-origin: center top;
    animation: floatIn 1100ms 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.app-store-badge {
    display: inline-block;
    transition: transform 200ms ease, opacity 200ms ease;
    animation: floatIn 1100ms 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.app-store-badge:hover { transform: translateY(-1px); opacity: 0.92; }
.app-store-badge:active { transform: scale(0.98); }
.app-store-badge img { height: 56px; width: auto; }

@keyframes floatIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Page heads (blog index, tag, author)
   ========================================================================== */
.page-head {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(48px, 8vw, 88px) 24px clamp(24px, 4vw, 40px);
    text-align: center;
}
.page-kicker { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--accent-bright); margin-bottom: 12px; }
.page-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(40px, 6vw, 64px); line-height: 1.02; }
.page-subtitle { margin-top: 14px; color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); max-width: 38rem; margin-left: auto; margin-right: auto; }
.author-head { display: flex; flex-direction: column; align-items: center; }
.author-avatar { border-radius: 50%; margin-bottom: 16px; }

/* ==========================================================================
   Post feed / cards
   ========================================================================== */
.post-feed {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 8px 24px 64px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}
.empty-feed { text-align: center; color: var(--muted); padding: 32px 24px 96px; }

.post-card {
    border: 1px solid var(--surface-border);
    background: var(--surface-raised);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 220ms cubic-bezier(0.16,1,0.3,1), border-color 220ms ease, background 220ms ease;
}
.post-card:hover { transform: translateY(-3px); border-color: rgba(171, 104, 219, 0.45); background: var(--surface-raised-hover); }
.post-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.post-card-image-wrap { aspect-ratio: 16 / 9; overflow: hidden; background: var(--cosmos-2); }
.post-card-image { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card-kicker { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: var(--accent-bright); margin-bottom: 10px; }
.post-card-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.01em; font-size: 22px; line-height: 1.2; color: var(--starlight); }
.post-card-excerpt { margin-top: 10px; color: var(--muted); font-size: 15px; flex: 1; }
.post-card-meta { margin-top: 16px; color: var(--faint); font-size: 13px; }

/* Featured pillar — full-width hero card at the top of the feed. */
.featured-wrap { max-width: var(--wrap); margin: 0 auto; padding: 8px 24px 28px; }
.featured-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    border: 1px solid var(--surface-border);
    background: var(--surface-raised);
    border-radius: 18px;
    overflow: hidden;
    color: inherit;
    transition: transform 220ms cubic-bezier(0.16,1,0.3,1), border-color 220ms ease, background 220ms ease;
}
.featured-card:hover { transform: translateY(-3px); border-color: rgba(171, 104, 219, 0.45); background: var(--surface-raised-hover); }
.featured-card-image-wrap { overflow: hidden; background: var(--cosmos-2); min-height: 300px; }
.featured-card-image { width: 100%; height: 100%; object-fit: cover; }
.featured-card-body { padding: clamp(28px, 3.4vw, 46px); display: flex; flex-direction: column; justify-content: center; }
.featured-card-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.015em; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.08; color: var(--starlight); }
.featured-card-excerpt { margin-top: 14px; color: var(--muted); font-size: clamp(15px, 1.6vw, 17px); line-height: 1.6; }
.featured-card .post-card-meta { margin-top: 20px; }

@media (max-width: 700px) {
    .featured-card { grid-template-columns: 1fr; }
    .featured-card-image-wrap { min-height: 0; aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   Single post / page — reading layout
   ========================================================================== */
.post {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(40px, 7vw, 80px) 24px 64px;
}
.post-header { max-width: var(--measure); margin: 0 auto; text-align: center; }
.post-kicker { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--accent-bright); }
.post-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.05; margin-top: 14px; }
.post-dek { margin-top: 18px; color: var(--muted); font-size: clamp(17px, 2.4vw, 21px); line-height: 1.5; }
.post-meta { margin-top: 22px; color: var(--faint); font-size: 14px; }
.post-author { color: var(--muted); }

.post-feature-image { margin: clamp(32px, 5vw, 56px) auto 0; max-width: var(--wrap); border-radius: 18px; overflow: hidden; }
.post-feature-image img { width: 100%; }
.post-feature-image figcaption { text-align: center; color: var(--faint); font-size: 13px; padding-top: 10px; }

/* Editor (Koenig) content. card_assets:true supplies the .kg-* card CSS. */
.gh-content {
    max-width: var(--measure);
    margin: clamp(32px, 5vw, 52px) auto 0;
    font-size: 18px;
    line-height: 1.75;
    color: rgba(245, 245, 247, 0.88);
}
.gh-content > * + * { margin-top: 1.5em; }
.gh-content h2, .gh-content h3, .gh-content h4 { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.01em; color: var(--starlight); line-height: 1.2; }
.gh-content h2 { font-size: 1.65em; margin-top: 2em; }
.gh-content h3 { font-size: 1.3em; margin-top: 1.8em; }
.gh-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(171,104,219,0.5); }
.gh-content a:hover { text-decoration-color: var(--accent-bright); }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li + li { margin-top: 0.5em; }
.gh-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.2em 0 0.2em 1.2em;
    color: var(--starlight);
    font-size: 1.15em;
    font-style: italic;
}
.gh-content img, .gh-content figure { border-radius: 12px; }

/* Koenig wide / full-bleed cards break out of the reading measure. */
.gh-content .kg-width-wide { width: min(var(--wrap), 92vw); margin-left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full img { border-radius: 0; }
.gh-content figcaption { text-align: center; color: var(--faint); font-size: 0.8em; margin-top: 0.6em; }
.gh-content hr { border: none; border-top: 1px solid var(--surface-border); margin: 2.5em 0; }
.gh-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 5px; padding: 0.15em 0.4em; }
.gh-content pre { background: var(--cosmos-1); border: 1px solid var(--surface-border); border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.gh-content pre code { background: none; border: none; padding: 0; }

.post-footer { max-width: var(--measure); margin: clamp(40px, 6vw, 64px) auto 0; display: flex; flex-direction: column; gap: 28px; align-items: center; text-align: center; }
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tag-pill { font-family: var(--font-accent); font-size: 13px; color: var(--muted); border: 1px solid var(--surface-border); border-radius: 999px; padding: 6px 14px; }
.tag-pill:hover { color: var(--starlight); border-color: var(--accent); }
.back-link { font-family: var(--font-accent); font-size: 14px; color: var(--faint); }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination { max-width: var(--wrap); margin: 0 auto; padding: 0 24px 80px; display: flex; align-items: center; justify-content: center; gap: 24px; }
.pagination a, .pagination .page-number { font-family: var(--font-accent); font-size: 14px; color: var(--muted); }
.pagination a:hover { color: var(--starlight); }

/* ==========================================================================
   Error page
   ========================================================================== */
.error-content { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; gap: 12px; }
.error-code { font-family: var(--font-accent); font-weight: 700; font-size: clamp(72px, 16vw, 140px); color: var(--accent); line-height: 1; }
.error-title { font-family: var(--font-accent); font-weight: 700; font-size: clamp(24px, 4vw, 34px); }
.error-description { color: var(--muted); }
.error-link { font-family: var(--font-accent); margin-top: 16px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
    .post-feed { grid-template-columns: 1fr; }
    .site-nav-menu { gap: 16px; }
    .gh-content { font-size: 17px; }
}

@media (max-width: 380px) {
    .splash { gap: 28px; }
    .icon-wrap { width: 164px; height: 164px; }
    .wordmark { font-size: 82px; }
    .lockup { margin-top: -18px; }
    .tagline { font-size: 16.4px; margin-top: -3px; }
    .app-store-badge img { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .icon-wrap, .wordmark, .tagline, .app-store-badge { animation: none; }
    .post-card { transition: none; }
}

.post-author-bio {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--hairline);
}
.post-author-bio .author-bio-name {
    font-family: var(--font-accent);
    color: var(--starlight);
    font-size: 15px;
    letter-spacing: 0.02em;
    margin: 0 0 6px;
}
.post-author-bio .author-bio-text {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}
