/* freedom.study — Classic Serif Revival Book */
/* Palette: #faf5eb, #2c2418, #1a1510, #d4c5a0, #8a7b64, #7c3a1e, #4a3520 */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #faf5eb;
    color: #2c2418;
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.8;
}

/* ============================
   Title Page
   ============================ */

.title-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #faf5eb;
    padding: 3rem 1.5rem;
}

.title-page-inner {
    text-align: center;
    max-width: 600px;
}

.book-icon {
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInDown 1s ease 0.2s forwards;
}

.book-icon svg {
    display: inline-block;
}

.site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: #1a1510;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards;
}

.site-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 1.25rem;
    color: #8a7b64;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

/* ============================
   Ornamental Rules
   ============================ */

.ornamental-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto;
    max-width: 300px;
    opacity: 0;
    animation: fadeIn 1s ease 0.8s forwards;
}

.ornamental-rule-small {
    max-width: 200px;
    margin-bottom: 2.5rem;
}

.rule-line {
    flex: 1;
    height: 1px;
    background-color: #d4c5a0;
}

.rule-asterisk {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    color: #d4c5a0;
    line-height: 1;
}

.chapter-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 200px;
    margin: 0 auto;
    padding: 1rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.chapter-divider.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
   Chapter Sections
   ============================ */

.chapter {
    position: relative;
    padding: 4rem 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.chapter.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-header {
    text-align: center;
    margin-bottom: 3rem;
}

.chapter-number {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 3.5rem;
    color: #7c3a1e;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.chapter-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: #1a1510;
    letter-spacing: -0.01em;
}

.chapter-body {
    position: relative;
}

.reading-column {
    max-width: 580px;
    margin: 0 auto;
    padding: 0 24px;
}

.reading-column p {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

.initial-letter {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.4em;
    color: #1a1510;
    line-height: 1;
}

/* ============================
   Margin Notes
   ============================ */

.margin-note-container {
    position: relative;
}

.margin-note {
    position: absolute;
    right: -220px;
    top: 0;
    width: 170px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 13px;
    font-style: italic;
    color: #8a7b64;
    line-height: 1.5;
    padding-left: 12px;
    border-left: 1px solid #d4c5a0;
}

.margin-note::before {
    content: attr(data-note);
    display: block;
    font-style: normal;
    font-weight: 400;
    font-size: 11px;
    color: #7c3a1e;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

/* Responsive margin notes: move inline on smaller screens */
@media (max-width: 1100px) {
    .margin-note {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        margin: 1rem 0 1.5rem 0;
        padding: 0.75rem 1rem;
        border-left: 2px solid #d4c5a0;
        background-color: rgba(212, 197, 160, 0.08);
    }
}

/* ============================
   Inline Pull Quote
   ============================ */

.pull-quote-inline {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    border-left: 3px solid #7c3a1e;
    background-color: rgba(212, 197, 160, 0.1);
}

.pull-quote-inline p {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 1.1rem;
    color: #2c2418;
    margin-bottom: 0.5rem;
    text-align: left;
}

.pull-quote-inline cite {
    display: block;
    font-family: 'Inter', Arial, sans-serif;
    font-style: normal;
    font-size: 0.8rem;
    color: #8a7b64;
}

/* ============================
   Interlude Section
   ============================ */

.interlude {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    background-color: #faf5eb;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.interlude.visible {
    opacity: 1;
    transform: translateY(0);
}

.interlude-inner {
    max-width: 680px;
    text-align: center;
}

.interlude-quote p {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: #1a1510;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.interlude-quote cite {
    display: block;
    font-family: 'Inter', Arial, sans-serif;
    font-style: normal;
    font-size: 0.9rem;
    color: #8a7b64;
    letter-spacing: 0.03em;
}

/* ============================
   Index Section
   ============================ */

.index-section {
    padding: 5rem 2rem;
    background-color: #faf5eb;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.index-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.index-inner {
    max-width: 700px;
    margin: 0 auto;
}

.index-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: #1a1510;
    text-align: center;
    margin-bottom: 1.5rem;
}

.index-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem 3rem;
}

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

.index-letter {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #7c3a1e;
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #d4c5a0;
}

.index-column .index-letter:first-child {
    margin-top: 0;
}

.index-list {
    list-style: none;
    padding: 0;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    color: #4a3520;
    line-height: 1.8;
}

.index-list li {
    padding-left: 0;
}

/* ============================
   Footer
   ============================ */

.site-footer {
    padding: 3rem 2rem 4rem;
    text-align: center;
}

.site-footer .ornamental-rule {
    margin-bottom: 2rem;
    animation: none;
    opacity: 1;
}

.footer-text {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.8rem;
    color: #8a7b64;
    letter-spacing: 0.04em;
}

/* ============================
   Links
   ============================ */

a {
    color: #4a3520;
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: #7c3a1e;
}

/* ============================
   Animations
   ============================ */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================
   Selection
   ============================ */

::selection {
    background-color: rgba(212, 197, 160, 0.4);
    color: #1a1510;
}
