/* ========================================
   Magnifica Humanitas - Styles
   Inspired by autoresearch.lol
   ======================================== */

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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f6f3;
    --bg-dark: #0f0f1a;
    --bg-dark-secondary: #1a1a2e;
    --text-primary: #1a1a2e;
    --text-secondary: #55555e;
    --text-light: #ffffff;
    --text-muted: #8a8a9a;
    --accent: #8b4513;
    --accent-light: #a0522d;
    --border: #e0ddd8;
    --border-light: #eeebe6;
    --card-bg: #ffffff;
    --card-bg-dark: #1e1e30;
    --font-serif: Georgia, 'Times New Roman', Times, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --max-width: 1200px;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--accent-light);
}

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

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: transform 0.3s ease;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.nav-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-dark);
    color: var(--text-light);
    border-radius: 6px;
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-logo-text {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px;
}

.nav-mobile {
    display: none;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 60px;
    background: var(--bg-dark);
    color: var(--text-light);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 69, 19, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 168, 83, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(26, 26, 46, 0.5) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(212, 168, 83, 0.9);
    margin-bottom: 32px;
}

.hero-title {
    margin-bottom: 24px;
}

.hero-title-sub {
    display: block;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.hero-title-main {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(212, 168, 83, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title-pope {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 12px;
    font-style: italic;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 22px);
    color: rgba(255, 255, 255, 0.7);
    max-width: 640px;
    line-height: 1.6;
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-light);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    transform: translateY(-1px);
}

.hero-meta {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
}

.hero-meta-value {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

/* --- Section --- */
.section {
    padding: 100px 0;
}

.section-dark {
    background: var(--bg-secondary);
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section-header {
    max-width: 720px;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(139, 69, 19, 0.08);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-dark .section-title {
    color: var(--text-primary);
}

.section-desc {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Cards Grid --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 32px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.card-number {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: rgba(139, 69, 19, 0.15);
    margin-bottom: 16px;
    line-height: 1;
}

.card-highlight {
    background: var(--bg-dark);
    border-color: var(--bg-dark);
    color: var(--text-light);
}

.card-highlight .card-number {
    color: rgba(212, 168, 83, 0.3);
}

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

.card-highlight .card-text {
    color: rgba(255, 255, 255, 0.7);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.card-link {
    display: inline-block;
    margin-top: 16px;
    font-weight: 600;
    font-size: 14px;
}

/* --- Steps --- */
.steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.step {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 28px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: box-shadow 0.2s ease;
}

.step:hover {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.step-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: var(--text-light);
    border-radius: 10px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
}

.step-content {
    flex: 1;
}

.step-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Why Grid --- */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.why-item {
    text-align: center;
    padding: 32px 24px;
}

.why-icon {
    color: var(--accent);
    margin-bottom: 20px;
    opacity: 0.8;
}

.why-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.why-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Chapter List --- */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chapter {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 36px;
    transition: box-shadow 0.2s ease;
}

.chapter:hover {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.chapter-header {
    margin-bottom: 16px;
}

.chapter-num {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 8px;
}

.chapter-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.chapter-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.chapter-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chapter-topics span {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(139, 69, 19, 0.06);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
}

/* --- Quotes --- */
.quotes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 24px;
}

.quote {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    padding: 28px 32px;
    margin: 0;
}

.quote-text {
    font-family: var(--font-serif);
    font-size: 17px;
    font-style: italic;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.quote-source {
    font-size: 13px;
    font-style: normal;
    color: var(--text-secondary);
}

/* --- FAQ --- */
.faq-list {
    max-width: 720px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
    border-top: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    text-align: left;
    color: var(--text-primary);
}

.faq-question:hover {
    color: var(--accent);
}

.faq-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-arrow,
.faq-question[aria-expanded="true"] + .faq-answer .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.open {
    max-height: 500px;
    padding-bottom: 20px;
}

.faq-answer p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-answer a {
    font-weight: 500;
}

/* --- Sources --- */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.source-card {
    padding: 32px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.source-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.source-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.source-link {
    font-size: 14px;
    font-weight: 600;
}

/* --- Footer --- */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 64px 0 32px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-brand {
    max-width: 400px;
    margin-bottom: 40px;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.footer-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 12px;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.footer-links a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.footer-links a:hover {
    color: var(--text-light);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .nav-mobile {
        display: none;
        padding: 16px 24px 24px;
        border-top: 1px solid var(--border-light);
    }

    .nav-mobile.show {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .nav-mobile a {
        font-size: 16px;
        font-weight: 500;
        color: var(--text-secondary);
    }

    .section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

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

    .step {
        flex-direction: column;
        gap: 16px;
    }

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

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

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

    .hero-meta {
        gap: 24px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .chapter {
        padding: 24px;
    }

    .card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 60px 16px;
    }

    .section-inner {
        padding: 0 16px;
    }

    .hero-meta-item {
        width: calc(50% - 12px);
    }
}
