/* ============================================
   Still Awake — Ghost Theme
   Anonymous confessional, dark & moody
   ============================================ */

:root {
    --black: #060606;
    --gold: #c9a87e;
    --gold-dim: rgba(201, 168, 126, 0.3);
    --gold-glow: rgba(201, 168, 126, 0.15);
    --white: #e8e0d4;
    --white-muted: rgba(232, 224, 212, 0.6);
    --white-faint: rgba(232, 224, 212, 0.15);
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
}

/* ---- Reset & Base ---- */

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--black);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

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

/* ---- Grain Overlay ---- */

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ---- Layout ---- */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Crisis Bar (Fixed Top) ---- */

.crisis-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(6, 6, 6, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--white-faint);
    padding: 8px 0;
}

.crisis-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    flex-wrap: wrap;
}

.crisis-label {
    color: var(--white-muted);
    font-weight: 500;
}

.crisis-link {
    color: var(--gold);
    font-weight: 500;
}

.crisis-divider {
    color: var(--white-faint);
}

/* ---- Stats Bar (Fixed Bottom) ---- */

.stats-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(6, 6, 6, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--white-faint);
    padding: 10px 0;
}

.stats-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: var(--white-muted);
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-divider {
    color: var(--white-faint);
}

#stat-word {
    color: var(--gold);
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 15px;
}

/* ---- Pulse Dot ---- */

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.pulse-dot-small {
    width: 6px;
    height: 6px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--gold-dim); }
    50% { opacity: 0.6; box-shadow: 0 0 0 6px transparent; }
}

/* ---- Hero Section ---- */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px 24px;
}

#constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.ring {
    position: absolute;
    border: 1px solid var(--gold-dim);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring-1 {
    width: 300px;
    height: 300px;
    animation: breathe 6s ease-in-out infinite;
}

.ring-2 {
    width: 450px;
    height: 450px;
    animation: breathe 6s ease-in-out infinite 1s;
    border-color: rgba(201, 168, 126, 0.15);
}

.ring-3 {
    width: 600px;
    height: 600px;
    animation: breathe 6s ease-in-out infinite 2s;
    border-color: rgba(201, 168, 126, 0.08);
}

@keyframes breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 700px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--white-muted);
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-counter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 40px;
    font-family: var(--font-body);
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Buttons ---- */

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 36px;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gold);
    color: var(--black);
}

.btn-primary:hover {
    background: #d4b78e;
    opacity: 1;
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold-dim);
}

.btn-outline:hover {
    border-color: var(--gold);
    opacity: 1;
}

.btn-large {
    padding: 18px 48px;
    font-size: 15px;
}

/* ---- Section Titles ---- */

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 300;
    text-align: center;
    margin-bottom: 16px;
    color: var(--white);
    letter-spacing: 0.03em;
}

/* ---- Stories / Post Grid ---- */

.stories-section {
    padding: 100px 0;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.post-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--white-faint);
    border-radius: 4px;
    padding: 32px;
    transition: all 0.3s ease;
    display: block;
}

.post-card:hover {
    border-color: var(--gold-dim);
    background: rgba(201, 168, 126, 0.03);
    opacity: 1;
}

.post-card-link {
    display: block;
    color: inherit;
}

.post-card-link:hover {
    opacity: 1;
}

.post-card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--white);
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--white-muted);
    line-height: 1.7;
    font-weight: 300;
}

/* ---- Pagination ---- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 60px;
    font-size: 14px;
    color: var(--white-muted);
}

.pagination a {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 13px;
    font-weight: 500;
}

/* ---- Resources Section ---- */

.resources-section {
    padding: 80px 0 100px;
    border-top: 1px solid var(--white-faint);
}

.resources-intro {
    text-align: center;
    color: var(--white-muted);
    font-size: 1rem;
    font-weight: 300;
    max-width: 500px;
    margin: 0 auto 48px;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.resource-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--white-faint);
    border-radius: 4px;
    padding: 28px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.resource-card:hover {
    border-color: var(--gold-dim);
}

.resource-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    color: var(--gold);
}

.resource-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 8px;
}

.resource-action {
    font-size: 0.95rem;
    color: var(--gold);
    margin-bottom: 4px;
}

.resource-hours {
    font-size: 0.8rem;
    color: var(--white-muted);
    font-weight: 300;
}

/* ---- Tell Yours Section ---- */

.tell-section {
    padding: 80px 0 100px;
    text-align: center;
    border-top: 1px solid var(--white-faint);
}

.tell-intro {
    color: var(--white-muted);
    font-size: 1rem;
    font-weight: 300;
    max-width: 480px;
    margin: 0 auto 32px;
}

.tell-note {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--white-muted);
    font-style: italic;
    font-family: var(--font-heading);
}

/* ---- Subscribe Section ---- */

.subscribe-section {
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid var(--white-faint);
}

.subscribe-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 300;
    margin-bottom: 12px;
    color: var(--white);
}

.subscribe-text {
    color: var(--white-muted);
    font-size: 0.95rem;
    font-weight: 300;
    max-width: 440px;
    margin: 0 auto 28px;
}

.subscribe-form-group {
    display: flex;
    gap: 0;
    max-width: 440px;
    margin: 0 auto;
}

.subscribe-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--white-faint);
    border-right: none;
    border-radius: 2px 0 0 2px;
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--white);
    outline: none;
    transition: border-color 0.3s;
}

.subscribe-input::placeholder {
    color: var(--white-muted);
}

.subscribe-input:focus {
    border-color: var(--gold-dim);
}

.subscribe-btn {
    border-radius: 0 2px 2px 0;
    padding: 14px 24px;
}

.subscribe-message {
    margin-top: 12px;
    font-size: 0.85rem;
}

.subscribe-success {
    color: var(--gold);
}

.subscribe-error {
    color: #cf6679;
}

/* ---- Post Full (Single Post Page) ---- */

.post-full {
    padding-top: 80px;
    padding-bottom: 60px;
}

.post-header {
    padding: 60px 0 40px;
    text-align: center;
}

.post-tag {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 16px;
    font-weight: 500;
}

.post-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 300;
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 16px;
}

.post-excerpt {
    color: var(--white-muted);
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 520px;
    margin: 0 auto;
}

/* ---- Ghost Editor Width Classes (Koenig) ---- */

.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin: 32px calc(50% - 42.5vw);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    min-width: 100%;
    margin: 32px calc(50% - 50vw);
}

.kg-width-wide img,
.kg-width-full img {
    max-width: 100%;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    max-width: 1040px;
    width: 100vw;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-gallery-row:not(:first-of-type) {
    margin: 0.75em 0 0;
}

.kg-gallery-image:not(:first-of-type) {
    margin: 0 0 0 0.75em;
}

.kg-bookmark-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--white-faint);
    border-radius: 4px;
    overflow: hidden;
    margin: 32px 0;
}

.kg-bookmark-container {
    display: flex;
    color: var(--white);
    text-decoration: none;
}

.kg-bookmark-content {
    flex-grow: 1;
    padding: 20px;
}

.kg-bookmark-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--white);
}

.kg-bookmark-description {
    font-size: 0.85rem;
    color: var(--white-muted);
    margin-top: 8px;
    max-height: 3em;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--white-muted);
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.kg-bookmark-publisher {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.kg-bookmark-thumbnail {
    position: relative;
    min-width: 160px;
    max-width: 160px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Post Content ---- */

.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--white-muted);
}

.post-content h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--white);
    margin: 48px 0 16px;
}

.post-content h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--white);
    margin: 36px 0 12px;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content blockquote {
    border-left: 2px solid var(--gold-dim);
    padding-left: 24px;
    margin: 32px 0;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--white);
}

.post-content a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content ul, .post-content ol {
    margin: 0 0 24px 24px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--white-faint);
    margin: 48px 0;
}

.post-content figcaption {
    font-size: 0.8rem;
    color: var(--white-muted);
    text-align: center;
    margin-top: 8px;
}

/* ---- Resonance Button ("felt this too") ---- */

.resonance-section {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--white-faint);
    border-bottom: 1px solid var(--white-faint);
}

.resonance-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--gold-dim);
    border-radius: 100px;
    padding: 12px 28px;
    cursor: pointer;
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-style: italic;
    transition: all 0.3s ease;
}

.resonance-btn:hover {
    border-color: var(--gold);
    background: rgba(201, 168, 126, 0.06);
}

.resonance-btn.active {
    background: rgba(201, 168, 126, 0.1);
    border-color: var(--gold);
}

.resonance-btn.active .resonance-icon {
    fill: var(--gold);
}

.resonance-icon {
    width: 18px;
    height: 18px;
    transition: fill 0.3s ease;
}

.resonance-count {
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ---- Read Next ---- */

.read-next {
    padding: 60px 0;
}

.read-next-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 400;
    color: var(--white-muted);
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
}

/* ---- Error Page ---- */

.error-page {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 24px;
}

.error-code {
    font-family: var(--font-heading);
    font-size: 6rem;
    font-weight: 300;
    color: var(--gold-dim);
    line-height: 1;
    margin-bottom: 16px;
}

.error-message {
    color: var(--white-muted);
    margin-bottom: 32px;
}

/* ---- Tag Page ---- */

.tag-page {
    padding: 120px 0 80px;
}

.tag-header {
    text-align: center;
    margin-bottom: 20px;
}

.tag-description {
    color: var(--white-muted);
    font-size: 1rem;
    font-weight: 300;
    max-width: 480px;
    margin: 8px auto 0;
}

/* ---- Footer ---- */

.site-footer {
    padding: 60px 0 80px;
    text-align: center;
    border-top: 1px solid var(--white-faint);
}

.footer-text {
    color: var(--white-muted);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-style: italic;
    font-weight: 300;
}

/* ---- Visually Hidden (Accessible) ---- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Hide Author / Bylines / Ghost Branding ---- */

.author-profile,
.post-full-byline,
.post-card-byline,
.author-card,
.author-list,
.post-full-meta,
.gh-powered-by,
.site-footer a[href*="ghost.org"],
[class*="author"],
.post-card-meta,
.gh-powered {
    display: none !important;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .hero {
        min-height: 100svh;
        padding: 100px 20px 80px;
    }

    .ring-1 { width: 200px; height: 200px; }
    .ring-2 { width: 300px; height: 300px; }
    .ring-3 { width: 400px; height: 400px; }

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

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

    .subscribe-form-group {
        flex-direction: column;
    }

    .subscribe-input {
        border-right: 1px solid var(--white-faint);
        border-radius: 2px;
    }

    .subscribe-btn {
        border-radius: 2px;
    }

    .crisis-bar-inner {
        font-size: 11px;
        gap: 8px;
    }

    .stats-bar-inner {
        font-size: 11px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .resources-grid {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
}
