/* ===========================
   VARIABLES
=========================== */
:root {
    --bg:           #05060f;
    --bg-card:      rgba(12, 14, 32, 0.88);
    --bg-card-hover: rgba(18, 20, 48, 0.96);
    --border:       rgba(255, 255, 255, 0.07);
    --border-glow:  rgba(123, 97, 255, 0.35);

    --text-1: #e8eaff;
    --text-2: #8890bb;
    --text-3: #50547a;

    --purple: #7b61ff;
    --cyan:   #00d4ff;

    --bsky-color: #0085ff;
    --ig-color:   #e1306c;
    --fb-color:   #1877f2;
    --x-color:    #ffffff;

    --radius:    16px;
    --radius-sm: 8px;
    --shadow-glow: 0 0 40px rgba(123, 97, 255, 0.18);
    --ease: 0.25s ease;

    --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

/* ===========================
   RESET
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-1);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }

/* ===========================
   STARFIELD CANVAS
=========================== */
#starfield {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Everything sits above the canvas */
.site-header, .hero, .site-main, .site-footer { position: relative; z-index: 1; }

/* ===========================
   HEADER
=========================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 6, 15, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.logo-star {
    font-size: 22px;
    color: var(--purple);
    text-shadow: 0 0 18px var(--purple);
    line-height: 1;
    user-select: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.logo-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.logo-subtitle {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Header social links */
.header-social {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.header-social::-webkit-scrollbar { display: none; }

.header-social-link {
    padding: 6px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    transition: color var(--ease), background var(--ease);
    white-space: nowrap;
}
.header-social-link:hover {
    color: var(--text-1);
    background: rgba(255,255,255,0.06);
}

/* ===========================
   HERO
=========================== */
.hero {
    padding: 96px 24px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-nebula {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%,
        rgba(123, 97, 255, 0.15) 0%,
        rgba(0, 212, 255, 0.08) 40%,
        transparent 70%
    );
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 18px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(36px, 6.5vw, 66px);
    font-weight: 700;
    line-height: 1.08;
    margin-bottom: 22px;
    background: linear-gradient(140deg, #ffffff 0%, #c8bcff 45%, #60dfff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-title em { font-style: italic; }

.hero-desc {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-2);
    margin-bottom: 38px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 9px 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--ease);
    border: 1px solid transparent;
}

.bsky-btn { background: rgba(0,133,255,0.12); border-color: rgba(0,133,255,0.35); color: #5cc8ff; }
.bsky-btn:hover { background: rgba(0,133,255,0.22); transform: translateY(-2px); }

.ig-btn { background: rgba(225,48,108,0.12); border-color: rgba(225,48,108,0.35); color: #ff7db0; }
.ig-btn:hover { background: rgba(225,48,108,0.22); transform: translateY(-2px); }

.fb-btn { background: rgba(24,119,242,0.12); border-color: rgba(24,119,242,0.35); color: #6db8ff; }
.fb-btn:hover { background: rgba(24,119,242,0.22); transform: translateY(-2px); }

.x-btn { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.2); color: #ffffff; }
.x-btn:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }

/* ===========================
   MAIN & SECTION LAYOUT
=========================== */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

/* ===========================
   BLOG
=========================== */
.blog-section {
    position: relative;
    z-index: 1;
    padding: 0 24px 60px;
}

.blog-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* Arrow navigation */
.blog-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-2);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ease);
    flex-shrink: 0;
}
.blog-arrow:hover:not(:disabled) {
    border-color: var(--purple);
    color: var(--text-1);
    background: rgba(123, 97, 255, 0.12);
}
.blog-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.blog-counter {
    font-size: 13px;
    color: var(--text-3);
    min-width: 36px;
    text-align: center;
}

/* Slider */
.blog-slider {
    position: relative;
    overflow: hidden;
}

.blog-card {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius);
    padding: 28px 32px;
    backdrop-filter: blur(12px);
    animation: fadeUp 0.3s ease both;
}
.blog-card.active { display: block; }

.blog-date {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--purple);
    display: block;
    margin-bottom: 10px;
}

.blog-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 18px;
    line-height: 1.3;
}

.blog-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.blog-body p {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-2);
}

/* Feed header */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 10px;
}

.feed-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-title-group h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-1);
}

.live-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 100px;
    background: rgba(0, 212, 255, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.follow-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    transition: color var(--ease);
    white-space: nowrap;
}
.follow-link:hover { color: var(--bsky-color); }

/* ===========================
   BLUESKY POSTS GRID
=========================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

/* Post card */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.post-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

/* Image area */
.post-images {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    flex-shrink: 0;
}
.post-images > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.post-card:hover .post-images > img { transform: scale(1.04); }

/* Multi-image grid */
.img-grid {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
}
.img-grid.c2 { grid-template-columns: 1fr 1fr; }
.img-grid.c3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.img-grid.c3 .gi:first-child { grid-row: span 2; }
.img-grid.c4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gi { overflow: hidden; }
.gi img { width: 100%; height: 100%; object-fit: cover; }

/* Post body */
.post-body {
    padding: 15px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-1);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.post-text a {
    color: var(--cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* External link preview */
.post-external {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.post-ext-thumb img {
    width: 100%;
    height: 110px;
    object-fit: cover;
}
.post-ext-info { padding: 10px 12px; }
.post-ext-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 3px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.post-ext-desc {
    font-size: 11px;
    color: var(--text-2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Post meta row */
.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.post-date { font-size: 11px; color: var(--text-3); }
.post-stats { display: flex; gap: 12px; }
.post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-3);
}
.post-stat svg { width: 12px; height: 12px; flex-shrink: 0; }

/* "View on Bluesky" link */
.post-view-link {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--cyan);
    padding: 9px 16px;
    border-top: 1px solid var(--border);
    background: rgba(0, 212, 255, 0.04);
    transition: background var(--ease), color var(--ease);
    letter-spacing: 0.02em;
}
.post-view-link:hover { background: rgba(0, 212, 255, 0.10); color: #44e8ff; }

/* ===========================
   SKELETON LOADERS
=========================== */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    padding-bottom: 16px;
}
.skeleton-img {
    width: 100%;
    aspect-ratio: 4/3;
    background: rgba(255,255,255,0.04);
}
.skeleton-text {
    height: 13px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    margin: 14px 16px 6px;
}
.skeleton-text.short { width: 45%; }
.skeleton-img, .skeleton-text { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
    0%,100% { opacity: 0.35; }
    50%      { opacity: 0.65; }
}

/* Error state */
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    color: var(--text-2);
    font-size: 15px;
}
.error-state a { color: var(--cyan); text-decoration: underline; }

/* ===========================
   FOOTER
=========================== */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 36px 24px;
    background: rgba(5, 6, 15, 0.75);
    backdrop-filter: blur(10px);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-star {
    font-size: 26px;
    color: var(--purple);
    text-shadow: 0 0 16px var(--purple);
    line-height: 1;
    user-select: none;
}

.footer-brand strong { font-size: 14px; font-weight: 600; display: block; }
.footer-brand p { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.footer-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-nav a {
    font-size: 13px;
    color: var(--text-3);
    transition: color var(--ease);
}
.footer-nav a:hover { color: var(--text-1); }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
    .header-social-link { padding: 6px 9px; font-size: 12px; }

    .hero { padding: 64px 20px 56px; }
    .hero-desc { font-size: 15px; }

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

    .feed-header { flex-direction: column; align-items: flex-start; }

    .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (max-width: 480px) {
    .hero-links { flex-direction: column; align-items: stretch; }
    .hero-btn { text-align: center; }
    .logo-subtitle { display: none; }
}
