/* ============================================
   transactology.org — Dark Academia Scholarly
   ============================================ */

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

:root {
    --bg: #F5ECD7;
    --primary: #6B4226;
    --secondary: #9B7653;
    --accent: #8B4513;
    --dark: #1A0F0A;
    --golden: #D4A96A;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--dark);
    background: var(--bg);
    line-height: 1.75;
    font-size: 18px;
    overflow-x: hidden;
}

/* --- Skeleton Loading --- */
.skeleton-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 60px;
    transition: opacity 0.6s ease;
}

.skeleton-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.skeleton-block {
    border-radius: 4px;
    background: linear-gradient(90deg, #e8dcc4 25%, #f0e6d0 50%, #e8dcc4 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-title {
    width: 400px;
    height: 40px;
}

.skeleton-line {
    width: 600px;
    height: 18px;
}

.skeleton-line.short {
    width: 350px;
}

.skeleton-paragraph {
    width: 600px;
    height: 100px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Navigation --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(26, 15, 10, 0.92);
    backdrop-filter: blur(8px);
}

.nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--golden);
    letter-spacing: 0.05em;
}

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

.nav-links a {
    color: var(--bg);
    text-decoration: none;
    font-family: 'Source Serif 4', serif;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--golden);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    text-align: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 40px;
}

.hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--bg);
    line-height: 1.1;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease 0.5s forwards;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-style: italic;
    color: var(--golden);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 0.8s forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Chapter Numerals --- */
.chapter-numeral {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cormorant Garamond', serif;
    font-size: 20rem;
    font-weight: 700;
    color: rgba(155, 118, 83, 0.07);
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    user-select: none;
}

.chapter-numeral.light {
    color: rgba(245, 236, 215, 0.05);
}

/* --- Wave Transitions --- */
.wave-transition {
    display: block;
    line-height: 0;
    margin-top: -1px;
}

.wave-1 {
    background: var(--dark);
}

.wave-2 {
    background: var(--bg);
}

.wave-3 {
    background: var(--dark);
}

.wave-transition svg {
    width: 100%;
    height: 120px;
    display: block;
}

/* --- Sections --- */
.section {
    position: relative;
    padding: 100px 40px;
    overflow: hidden;
}

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

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

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

.section-content {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
}

.section-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 32px;
}

.dark .section-content h2 {
    color: var(--golden);
}

.section-content p {
    margin-bottom: 20px;
}

/* --- Drop Caps --- */
.drop-cap::first-letter {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.6em;
    float: left;
    line-height: 0.8;
    padding-right: 12px;
    padding-top: 6px;
    color: var(--primary);
    font-weight: 700;
}

.dark .drop-cap::first-letter {
    color: var(--golden);
}

/* --- Pull Quotes --- */
.pull-quote-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 40px;
}

.pull-quote {
    border-left: 3px solid var(--golden);
    padding: 24px 40px;
}

.pull-quote p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.7rem;
    font-style: italic;
    color: var(--primary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.pull-quote cite {
    font-family: 'Source Serif 4', serif;
    font-size: 0.9rem;
    color: var(--secondary);
    font-style: normal;
}

/* --- Footnote References --- */
.footnote-ref {
    font-size: 0.7em;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    vertical-align: super;
    line-height: 0;
    transition: color 0.2s;
}

.footnote-ref:hover {
    color: var(--golden);
}

/* --- Research Grid --- */
.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 40px;
}

.research-card {
    background: rgba(245, 236, 215, 0.06);
    border: 1px solid rgba(212, 169, 106, 0.2);
    padding: 32px 28px;
    border-radius: 4px;
    transition: border-color 0.3s, background 0.3s;
}

.research-card:hover {
    border-color: var(--golden);
    background: rgba(245, 236, 215, 0.1);
}

.research-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--golden);
    margin-bottom: 12px;
}

.research-card p {
    font-size: 0.95rem;
    color: rgba(245, 236, 215, 0.8);
    margin-bottom: 0;
}

/* --- Footer --- */
.site-footer {
    background: var(--dark);
    color: var(--bg);
    padding: 80px 40px 30px;
}

.footer-content {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.footer-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--golden);
    margin-bottom: 20px;
}

.footer-address {
    margin-top: 32px;
    font-style: italic;
    color: var(--secondary);
}

.footer-bottom {
    max-width: 780px;
    margin: 60px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(155, 118, 83, 0.2);
    text-align: center;
    font-size: 0.85rem;
    color: var(--secondary);
}

/* --- Footnotes Aside --- */
.footnotes {
    background: var(--dark);
    color: rgba(245, 236, 215, 0.6);
    padding: 40px;
    font-size: 0.85rem;
}

.footnotes ol {
    max-width: 780px;
    margin: 0 auto;
    padding-left: 24px;
}

.footnotes li {
    margin-bottom: 8px;
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

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

    .chapter-numeral {
        font-size: 10rem;
    }

    .section-content h2 {
        font-size: 2rem;
    }

    .nav-links {
        gap: 18px;
    }

    .skeleton-title, .skeleton-line, .skeleton-paragraph {
        width: 80vw;
    }
}
