/* style.css — Compounding Insights | Bold Founder Brand */
/* Pedro Lopez — Curated intelligence for founders who think in systems */

/* --- CSS Variables --- */
:root {
    --bg: #050507;
    --bg-subtle: #0a0a0e;
    --surface: #111116;
    --surface-hover: #17171e;
    --surface-active: #1e1e28;
    --border: #222230;
    --border-light: #2e2e40;
    --text: #f0f0f4;
    --text-secondary: #b0b0c4;
    --text-muted: #6a6a84;
    --accent: #6e9fff;
    --accent-hover: #8cb3ff;
    --accent-dim: rgba(110, 159, 255, 0.12);
    --accent-glow: rgba(110, 159, 255, 0.06);
    --white: #ffffff;
    --radius: 6px;
    --radius-lg: 12px;
    --heading: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --serif: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'Space Grotesk', 'Inter', monospace;
    --max-width: 920px;
    --transition: 0.2s ease;

    /* Modular Scale — 1.333 (Perfect Fourth), base 18px */
    --ms-n3: 0.563rem;  /*  9px  */
    --ms-n2: 0.75rem;   /* 12px  */
    --ms-n1: 0.833rem;  /* 13px  */
    --ms-0: 1.125rem;   /* 18px — base */
    --ms-1: 1.5rem;     /* 24px  */
    --ms-2: 2rem;       /* 32px  */
    --ms-3: 2.665rem;   /* 43px  */
    --ms-4: 3.553rem;   /* 57px  */
    --ms-5: 4.736rem;   /* 76px  */
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--ms-0);
    line-height: 1.75;
    letter-spacing: 0.01em;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ═══════════════════════════════════════════════════ */
/*  HERO SECTION                                       */
/* ═══════════════════════════════════════════════════ */
.hero {
    padding: 96px 0 56px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 56px;
}

.hero-eyebrow {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    display: block;
}

.hero h1 {
    font-family: var(--heading);
    font-size: clamp(var(--ms-3), 5vw, var(--ms-5));
    font-weight: 700;
    line-height: 1.05;
    color: var(--white);
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero .tagline {
    font-size: var(--ms-1);
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.55;
    letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════════ */
/*  CATEGORY NAV                                       */
/* ═══════════════════════════════════════════════════ */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.category-btn {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.category-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text);
    background: transparent;
}

.category-btn.active {
    border-color: var(--white);
    background: transparent;
    color: var(--white);
    font-weight: 500;
}

.category-btn .count {
    font-size: var(--ms-n3);
    opacity: 0.4;
    margin-left: 6px;
}

/* ═══════════════════════════════════════════════════ */
/*  SEARCH BAR                                         */
/* ═══════════════════════════════════════════════════ */
.search-container {
    margin-bottom: 40px;
}

.search-input {
    width: 100%;
    padding: 16px 24px 16px 52px;
    font-family: var(--sans);
    font-size: var(--ms-0);
    font-weight: 300;
    letter-spacing: 0.02em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder { color: var(--text-muted); font-weight: 300; }

.search-input:focus {
    border-color: var(--text-secondary);
    background: var(--bg-subtle);
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--ms-1);
    pointer-events: none;
}

.search-count {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════ */
/*  ARTICLE LIST                                       */
/* ═══════════════════════════════════════════════════ */
.articles-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.article-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-radius: var(--radius);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.article-item:hover {
    background: var(--surface);
    border-color: var(--border);
    color: inherit;
}

.article-title {
    font-family: var(--sans);
    font-size: var(--ms-0);
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.45;
    letter-spacing: 0.005em;
    transition: color 0.3s ease;
}

.article-item:hover .article-title { color: var(--white); }

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.article-date {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.article-category-tag {
    font-family: var(--heading);
    font-size: var(--ms-n3);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 100px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════ */
/*  SUBSCRIBE SECTION                                  */
/* ═══════════════════════════════════════════════════ */
.subscribe-section {
    margin-top: 80px;
    padding: 56px 0;
    border-top: 1px solid var(--border);
}

.subscribe-hero {
    margin-top: 0;
    padding: 0 0 56px;
    border-top: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.subscribe-label {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.subscribe-heading {
    font-family: var(--heading);
    font-size: var(--ms-2);
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.subscribe-desc {
    color: var(--text-secondary);
    font-size: var(--ms-0);
    font-weight: 300;
    line-height: 1.7;
    max-width: 520px;
    margin-bottom: 28px;
}

.subscribe-form {
    display: flex;
    gap: 12px;
    max-width: 520px;
}

.subscribe-input {
    flex: 1;
    padding: 14px 20px;
    font-family: var(--sans);
    font-size: var(--ms-n1);
    font-weight: 300;
    letter-spacing: 0.02em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: all 0.3s ease;
}

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

.subscribe-input:focus {
    border-color: var(--text-secondary);
    background: var(--bg-subtle);
}

.subscribe-btn {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 14px 28px;
    border-radius: var(--radius);
    border: 1px solid var(--white);
    background: var(--white);
    color: var(--bg);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.subscribe-btn:hover {
    background: transparent;
    color: var(--white);
}

.subscribe-success {
    display: none;
    font-family: var(--heading);
    font-size: var(--ms-n1);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-top: 16px;
}

.subscribe-privacy {
    font-size: var(--ms-n3);
    color: var(--text-muted);
    margin-top: 12px;
    font-weight: 300;
}

/* Article page inline subscribe */
.article-subscribe {
    margin-top: 48px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.article-subscribe .subscribe-heading {
    font-size: var(--ms-1);
    margin-bottom: 8px;
}

.article-subscribe .subscribe-desc {
    font-size: var(--ms-n1);
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .subscribe-form {
        flex-direction: column;
    }
    .subscribe-btn {
        width: 100%;
        text-align: center;
    }
    .article-subscribe {
        padding: 24px 20px;
    }
}

/* ═══════════════════════════════════════════════════ */
/*  ABOUT SECTION                                      */
/* ═══════════════════════════════════════════════════ */
.about-section {
    margin-top: 80px;
    padding: 48px 0;
    border-top: 1px solid var(--border);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.about-label {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}

.about-name {
    font-family: var(--heading);
    font-size: var(--ms-2);
    font-weight: 600;
    color: var(--white);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.about-bio {
    color: var(--text-secondary);
    font-size: var(--ms-0);
    font-weight: 300;
    line-height: 1.85;
    max-width: 680px;
}

.about-bio p { margin-bottom: 12px; }

.about-links {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.about-link {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.about-link:hover {
    border-color: var(--white);
    color: var(--white);
}

/* ═══════════════════════════════════════════════════ */
/*  FOOTER                                             */
/* ═══════════════════════════════════════════════════ */
.site-footer {
    padding: 32px 0;
    margin-top: 48px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════ */
/*  ARTICLE PAGE                                       */
/* ═══════════════════════════════════════════════════ */
.article-page { padding: 64px 0 80px; }

.article-page-header { margin-bottom: 40px; }

.article-page-back {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 32px;
    display: inline-block;
    transition: color 0.3s ease;
}

.article-page-back:hover { color: var(--white); }

.article-page-title {
    font-family: var(--heading);
    font-size: clamp(var(--ms-2), 4vw, var(--ms-3));
    font-weight: 600;
    line-height: 1.12;
    color: var(--white);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.article-page-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.article-page-date {
    font-family: var(--heading);
    font-size: var(--ms-n1);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.article-page-source {
    font-family: var(--heading);
    font-size: var(--ms-n2);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.article-page-source a {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-dim);
}

.article-page-source a:hover { border-bottom-color: var(--accent); }

/* Article body content */
.article-body {
    font-family: var(--sans);
    font-size: var(--ms-0);
    font-weight: 350;
    line-height: 1.9;
    letter-spacing: 0.01em;
    color: var(--text);
}

.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
    font-family: var(--heading);
    color: var(--white);
    margin-top: 2.2em;
    margin-bottom: 0.7em;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.article-body h2 { font-size: var(--ms-2); font-weight: 600; }
.article-body h3 { font-size: var(--ms-1); font-weight: 500; }

.article-body p { margin-bottom: 1.3em; }

.article-body strong { color: var(--white); font-weight: 500; }

.article-body em { color: var(--text-secondary); font-style: italic; }

.article-body ul, .article-body ol {
    margin-bottom: 1.3em;
    padding-left: 1.5em;
}

.article-body li { margin-bottom: 0.5em; }

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5em 0;
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin: 1.5em 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-body a {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-dim);
}

.article-body a:hover { border-bottom-color: var(--accent); }

.article-footer {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.article-footer a {
    font-family: var(--heading);
    font-size: var(--ms-n1);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.article-footer a:hover { color: var(--white); }

/* ═══════════════════════════════════════════════════ */
/*  PAGINATION / LOAD MORE                             */
/* ═══════════════════════════════════════════════════ */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    font-family: var(--heading);
    font-size: var(--ms-n1);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 16px 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    border-color: var(--white);
    color: var(--white);
    background: transparent;
}

/* ═══════════════════════════════════════════════════ */
/*  NO RESULTS STATE                                   */
/* ═══════════════════════════════════════════════════ */
.no-results {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.no-results-icon { font-size: var(--ms-4); margin-bottom: 16px; opacity: 0.3; }
.no-results-text { font-size: var(--ms-0); }

/* ═══════════════════════════════════════════════════ */
/*  RESPONSIVE — TABLET (≤768px)                       */
/* ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero { padding: 56px 0 36px; margin-bottom: 36px; }
    .hero h1 { font-size: var(--ms-4); }
    .hero .tagline { font-size: var(--ms-0); line-height: 1.6; }

    /* Article list — stack layout */
    .article-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px 16px;
    }

    .article-meta {
        justify-content: flex-start;
        gap: 8px;
    }

    /* Category nav — horizontal scroll */
    .category-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
        padding-bottom: 4px;
        margin-bottom: 28px;
    }
    .category-nav::-webkit-scrollbar { display: none; }
    .category-btn { padding: 8px 16px; font-size: var(--ms-n3); flex-shrink: 0; }

    /* Search */
    .search-input { padding: 14px 20px 14px 46px; font-size: var(--ms-n1); }
    .search-container { margin-bottom: 28px; }

    /* About */
    .about-section { margin-top: 48px; padding: 32px 0; }
    .about-name { font-size: var(--ms-1); }

    /* Article page */
    .article-page { padding: 40px 0 56px; }
    .article-page-title { font-size: var(--ms-2); }
    .article-page-back { margin-bottom: 20px; }
    .article-body { font-size: var(--ms-n1); line-height: 1.85; }
    .article-body h2 { font-size: var(--ms-1); }
    .article-body h3 { font-size: var(--ms-0); }

    /* Load more — full width */
    .load-more-btn { width: 100%; padding: 14px 24px; }
}

/* ═══════════════════════════════════════════════════ */
/*  RESPONSIVE — MOBILE (≤480px)                       */
/* ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .container { padding: 0 16px; }

    .hero { padding: 40px 0 28px; margin-bottom: 28px; }
    .hero h1 { font-size: var(--ms-3); }
    .hero .tagline { font-size: var(--ms-n1); }
    .hero-eyebrow { font-size: var(--ms-n3); margin-bottom: 14px; }

    /* Tighter article rows */
    .article-item { padding: 12px 12px; }
    .article-title { font-size: var(--ms-n1); }
    .article-category-tag { font-size: 0.5rem; padding: 3px 8px; }
    .article-date { font-size: var(--ms-n3); }

    /* Search */
    .search-input { padding: 12px 16px 12px 42px; }
    .search-icon { left: 14px; font-size: var(--ms-0); }

    /* About */
    .about-bio { font-size: var(--ms-n1); }
    .about-links { gap: 10px; }
    .about-link { padding: 8px 14px; font-size: var(--ms-n3); }

    /* Article page */
    .article-page { padding: 28px 0 40px; }
    .article-page-header { margin-bottom: 28px; }
    .article-page-title { font-size: var(--ms-1); line-height: 1.2; }
    .article-page-meta { gap: 10px; }
    .article-body { font-size: var(--ms-n1); line-height: 1.8; }
    .article-body h2 { font-size: var(--ms-0); }
    .article-body h3 { font-size: var(--ms-n1); font-weight: 600; }
    .article-body blockquote { padding-left: 14px; }
    .article-footer { margin-top: 40px; padding-top: 24px; }

    /* Footer */
    .footer-text { font-size: var(--ms-n3); }
}

/* ═══════════════════════════════════════════════════ */
/*  TOUCH & ACCESSIBILITY                              */
/* ═══════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
    /* Ensure 44px minimum tap targets on touch devices */
    .category-btn { min-height: 44px; display: inline-flex; align-items: center; }
    .article-item { min-height: 48px; }
    .load-more-btn { min-height: 48px; }
    .about-link { min-height: 44px; display: inline-flex; align-items: center; }

    /* Remove hover states that don't apply on touch */
    .article-item:hover { background: transparent; border-color: transparent; }
    .article-item:active { background: var(--surface); border-color: var(--border); }
}
