/* ============================================
   HOMIE BLOG THEME — Warm, Bold, Brutalist
   Matches the homie. landing page aesthetic
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: hsl(40, 20%, 97%);
    --bg-card: hsl(0, 0%, 100%);
    --surface: hsl(40, 10%, 92%);
    --border: hsl(0, 0%, 85%);
    --text: hsl(0, 0%, 10%);
    --text-muted: hsl(0, 0%, 40%);
    --text-dim: hsl(0, 0%, 60%);
    --primary: hsl(14, 100%, 57%);
    --primary-light: hsl(14, 100%, 95%);
    --primary-hover: hsl(14, 100%, 50%);
    --primary-foreground: #fff;
    --radius: 0px;
    --max-width: 1400px;
    --content-width: 720px;
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Poppins', sans-serif;
    --font-logo: 'Poppins', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

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

::selection {
    background: var(--primary);
    color: white;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 14px 36px;
    font-size: 16px;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Top Banner --- */
.top-banner {
    background: var(--text);
    color: var(--bg);
    text-align: center;
    padding: 6px 16px;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* --- Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

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

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

.logo-text {
    font-size: 24px;
    font-family: var(--font-logo);
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

.site-nav a {
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.01em;
    position: relative;
    padding: 4px 0;
    transition: color var(--transition);
}

.site-nav a:hover {
    color: var(--primary);
}

.header-actions .btn-glow {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: none;
}

.header-actions .btn-glow:hover {
    background: var(--primary-hover);
    color: white;
}

.header-actions .btn-glow::after {
    display: none;
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 80px;
    overflow: hidden;
    background: var(--bg);
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out;
}

.hero-description {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
    animation: fadeInUp 0.6s ease-out 0.15s both;
}

.hero .btn {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 50% 100%, var(--primary-light), transparent);
    z-index: 1;
}

.hero::before {
    display: none;
}

/* --- Post Feed --- */
.post-feed {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.feed-header {
    margin-bottom: 48px;
}

.section-title {
    font-size: 14px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 12px;
}

.title-line {
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 0;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

/* --- Post Card --- */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--border);
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
}

.post-card::before {
    display: none;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.post-card.featured {
    grid-column: span 2;
}

.post-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.post-card-link:hover {
    color: inherit;
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

.post-card:hover .post-card-image {
    transform: scale(1.03);
}

.post-card-content {
    padding: 24px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-card-tag {
    font-size: 11px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: var(--radius);
}

.post-card-date {
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--font);
}

.post-card-title {
    font-size: 1.3rem;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.post-card-title {
    color: var(--text);
}

.post-card:hover .post-card-title {
    color: var(--primary);
}

.post-card-excerpt {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 2px solid var(--border);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-weight: 500;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 0;
    object-fit: cover;
    border: 2px solid var(--border);
}

.reading-time {
    font-size: 12px;
    color: var(--text-dim);
}

/* --- Post Full --- */
.post-full {
    padding-top: 100px;
}

.post-header {
    text-align: center;
    padding: 40px 24px 48px;
    max-width: 800px;
    margin: 0 auto;
}

.post-tag {
    display: inline-block;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.post-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 20px;
}

.post-excerpt {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 24px;
}

.post-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.post-authors {
    display: flex;
    gap: 16px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-family: var(--font-display);
}

.post-author a {
    color: var(--text);
    font-weight: 600;
}

.post-details {
    font-size: 14px;
    color: var(--text-muted);
}

.post-details .sep {
    margin: 0 8px;
    color: var(--text-dim);
}

.post-feature-image {
    max-width: 1000px;
    margin: 0 auto 48px;
    padding: 0 24px;
}

.post-feature-image img {
    width: 100%;
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.post-feature-image figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 12px;
}

/* --- Ghost Content --- */
.gh-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px 80px;
    font-size: 16px;
    line-height: 1.8;
}

.gh-content > * + * {
    margin-top: 1.5em;
}

.gh-content h2 {
    font-size: 1.8rem;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-top: 2.5em;
    padding-top: 1em;
    border-top: 2px solid var(--border);
}

.gh-content h3 {
    font-size: 1.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-top: 2em;
}

.gh-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--primary);
}

.gh-content a:hover {
    color: var(--primary-hover);
}

.gh-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1px 24px;
    margin: 2em 0;
    font-size: 1.1em;
    color: var(--text-muted);
    font-style: italic;
    background: var(--primary-light);
    border-radius: var(--radius);
}

.gh-content pre {
    background: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--bg);
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: var(--radius);
    color: var(--primary);
}

.gh-content pre code {
    background: none;
    padding: 0;
    color: var(--bg);
}

.gh-content img {
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.gh-content figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 8px;
}

.gh-content ul, .gh-content ol {
    padding-left: 1.5em;
}

.gh-content li + li {
    margin-top: 0.5em;
}

.gh-content hr {
    border: none;
    height: 2px;
    background: var(--border);
    margin: 3em 0;
}

/* --- Related Posts --- */
.related-posts {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 80px;
    border-top: 2px solid var(--border);
}

.related-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* --- Tag & Author Pages --- */
.tag-header, .author-header {
    text-align: center;
    padding: 140px 24px 60px;
}

.tag-title, .author-name {
    font-size: clamp(2rem, 5vw, 3rem);
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 12px;
}

.tag-description, .author-bio {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 16px;
}

.tag-count, .author-count {
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-display);
    font-weight: 600;
}

.author-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 0;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid var(--primary);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 24px 80px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-number {
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--font-display);
    font-weight: 600;
}

/* --- Footer --- */
.site-footer {
    border-top: 2px solid var(--border);
    background: var(--bg-card);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 40px;
    text-align: center;
}

.footer-logo {
    font-size: 24px;
    font-family: var(--font-logo);
    font-weight: 800;
    color: var(--primary);
}

.footer-desc {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 8px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.footer-nav {
    margin: 32px 0;
}

.footer-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-muted);
    font-size: 14px;
    font-family: var(--font-display);
    font-weight: 500;
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 2px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
}

.footer-bottom p + p {
    margin-top: 4px;
}

.powered-by a {
    color: var(--text-muted);
}

/* --- Waitlist CTA --- */
.waitlist-cta {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.waitlist-cta-inner {
    background: var(--text);
    color: var(--bg);
    padding: 60px 40px;
    text-align: center;
    border: 2px solid var(--text);
}

.waitlist-cta-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--bg);
}

.waitlist-cta-desc {
    font-size: 15px;
    color: hsl(0, 0%, 70%);
    max-width: 500px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.waitlist-cta .btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.waitlist-cta .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Scroll animations --- */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

[data-aos="fade-up"].visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- Ghost Required Classes --- */
.kg-width-wide {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    max-width: none;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-card.featured {
        grid-column: span 1;
    }

    .site-nav {
        display: none;
    }

    .header-inner {
        padding: 14px 16px;
    }

    .hero {
        min-height: 50vh;
        padding: 100px 16px 60px;
    }

    .post-feed {
        padding: 40px 16px 60px;
    }

    .gh-content {
        font-size: 16px;
        padding: 0 16px 60px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .post-card-content {
        padding: 16px;
    }
}

/* --- Modal Lightbox --- */
.homie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.homie-modal {
    background: var(--bg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    animation: modalSlideUp 0.25s ease;
}

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

.homie-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.homie-modal-close:hover {
    color: var(--text);
}

.homie-modal-header {
    padding: 32px 32px 16px;
    border-bottom: 1px solid var(--border);
}

.homie-modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.homie-modal-header p {
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.homie-modal-form {
    padding: 24px 32px 32px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-family: monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    background: var(--surface);
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.form-check input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check label {
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    margin-top: 8px;
    padding: 14px 24px;
    font-size: 1rem;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.form-message {
    margin-top: 16px;
    padding: 12px;
    font-family: var(--font);
    font-size: 0.9rem;
    text-align: center;
}

.form-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
