/* ===========================================
   martiallaw.wiki — Styles
   Burgundy-Cream palette, paper-aged aesthetic,
   generative constellation, scholarly tone
   =========================================== */

/* --- CSS Variables --- */
:root {
    --aged-cream: #F5E0D8;
    --burgundy-deep: #722F37;
    --leather-brown: #5A3A28;
    --dark-ink: #2A1A18;
    --paper-warm: #F8F0E8;
    --star-gold: #D4A848;
    --foxing-brown: rgba(139, 107, 74, 0.06);
    --foxing-brown-light: rgba(139, 107, 74, 0.04);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.85;
    color: var(--dark-ink);
    background: var(--aged-cream);
    overflow-x: hidden;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--aged-cream);
    overflow: hidden;
}

#constellation-container {
    width: 90%;
    max-width: 800px;
    margin-bottom: 40px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#constellation-container.visible {
    opacity: 1;
}

#constellation-svg {
    width: 100%;
    height: auto;
    display: block;
}

#constellation-svg circle {
    opacity: 0;
    transition: opacity 0.4s ease;
}

#constellation-svg circle.visible {
    opacity: 1;
}

#constellation-svg line {
    stroke-dasharray: var(--line-length, 200);
    stroke-dashoffset: var(--line-length, 200);
    transition: stroke-dashoffset 0.8s ease;
}

#constellation-svg line.drawn {
    stroke-dashoffset: 0;
}

#logotype {
    font-family: 'Zilla Slab', 'Rockwell', serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 56px);
    color: var(--dark-ink);
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 1.5s, transform 1s ease 1.5s;
    text-align: center;
}

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

#hero-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(13px, 1vw, 16px);
    color: var(--leather-brown);
    margin-top: 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease 2s, transform 1s ease 2s;
    text-align: center;
}

#hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Section Connection Lines --- */
#section-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    display: none;
}

/* --- Main Content --- */
#content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 24px 80px;
    z-index: 1;
}

/* --- Wiki Section --- */
.wiki-section {
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* --- Section Marker (Star) --- */
.section-marker {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.star-marker {
    cursor: default;
    transition: transform 0.1s ease;
    filter: drop-shadow(0 0 3px rgba(212, 168, 72, 0.3));
}

.star-marker:hover {
    animation: springBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.star-marker-small {
    filter: drop-shadow(0 0 2px rgba(212, 168, 72, 0.2));
}

@keyframes springBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    60% { transform: scale(0.95); }
    80% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- Paper-Aged Section Content --- */
.section-content {
    position: relative;
    background: var(--paper-warm);
    padding: 40px 36px;
    border-radius: 2px;
    box-shadow: inset 0 0 80px rgba(42, 26, 24, 0.06);
}

.section-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 2px;
    background:
        radial-gradient(circle at 25% 40%, rgba(139, 107, 74, 0.06) 0%, transparent 3%),
        radial-gradient(circle at 65% 75%, rgba(139, 107, 74, 0.04) 0%, transparent 2%),
        radial-gradient(circle at 80% 20%, rgba(139, 107, 74, 0.05) 0%, transparent 2.5%),
        radial-gradient(circle at 15% 80%, rgba(139, 107, 74, 0.03) 0%, transparent 2%),
        radial-gradient(circle at 50% 10%, rgba(139, 107, 74, 0.04) 0%, transparent 1.5%);
}

.paper-aged-variant-1::before {
    background:
        radial-gradient(circle at 35% 55%, rgba(139, 107, 74, 0.05) 0%, transparent 3%),
        radial-gradient(circle at 75% 30%, rgba(139, 107, 74, 0.06) 0%, transparent 2%),
        radial-gradient(circle at 10% 15%, rgba(139, 107, 74, 0.04) 0%, transparent 2.5%),
        radial-gradient(circle at 60% 85%, rgba(139, 107, 74, 0.03) 0%, transparent 2%),
        radial-gradient(circle at 90% 60%, rgba(139, 107, 74, 0.05) 0%, transparent 1.5%);
}

.paper-aged-variant-2::before {
    background:
        radial-gradient(circle at 45% 25%, rgba(139, 107, 74, 0.04) 0%, transparent 3%),
        radial-gradient(circle at 20% 65%, rgba(139, 107, 74, 0.06) 0%, transparent 2%),
        radial-gradient(circle at 70% 50%, rgba(139, 107, 74, 0.05) 0%, transparent 2.5%),
        radial-gradient(circle at 85% 85%, rgba(139, 107, 74, 0.03) 0%, transparent 2%),
        radial-gradient(circle at 30% 90%, rgba(139, 107, 74, 0.04) 0%, transparent 1.5%);
}

.paper-aged-variant-3::before {
    background:
        radial-gradient(circle at 55% 35%, rgba(139, 107, 74, 0.06) 0%, transparent 3%),
        radial-gradient(circle at 15% 70%, rgba(139, 107, 74, 0.04) 0%, transparent 2%),
        radial-gradient(circle at 85% 15%, rgba(139, 107, 74, 0.05) 0%, transparent 2.5%),
        radial-gradient(circle at 40% 90%, rgba(139, 107, 74, 0.03) 0%, transparent 2%),
        radial-gradient(circle at 70% 55%, rgba(139, 107, 74, 0.04) 0%, transparent 1.5%);
}

/* --- Typography --- */
h2 {
    font-family: 'Zilla Slab', 'Rockwell', serif;
    font-weight: 600;
    font-size: clamp(24px, 3.5vw, 44px);
    color: var(--dark-ink);
    margin-bottom: 20px;
    line-height: 1.2;
}

h3 {
    font-family: 'Zilla Slab', 'Rockwell', serif;
    font-weight: 600;
    font-size: clamp(18px, 2vw, 24px);
    color: var(--burgundy-deep);
    margin-top: 28px;
    margin-bottom: 14px;
    line-height: 1.3;
}

p {
    margin-bottom: 16px;
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: 700;
    color: var(--leather-brown);
}

em {
    font-style: italic;
}

/* --- Legal/Citation Text --- */
.citation {
    font-size: 14px;
    color: var(--leather-brown);
    border-left: 3px solid var(--burgundy-deep);
    padding: 12px 16px;
    margin-top: 20px;
    background: rgba(114, 47, 55, 0.03);
}

.legal-ref {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--burgundy-deep);
}

/* --- Wiki List --- */
.wiki-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.wiki-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.7;
}

.wiki-list li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--star-gold);
    border-radius: 50%;
}

/* --- Section Divider --- */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(114, 47, 55, 0.4);
}

.section-divider::before {
    margin-right: 16px;
}

.section-divider::after {
    margin-left: 16px;
}

.divider-ornament {
    color: var(--star-gold);
    font-size: 12px;
    line-height: 1;
}

/* --- Footer --- */
#site-footer {
    background: var(--dark-ink);
    padding: 48px 24px;
    text-align: center;
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
}

.footer-constellation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
}

.footer-line {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: rgba(212, 168, 72, 0.4);
    margin: 0 8px;
}

.footer-text {
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    color: rgba(248, 240, 232, 0.7);
    margin-bottom: 8px;
}

.footer-text-small {
    font-size: 12px;
    color: rgba(248, 240, 232, 0.4);
    margin-bottom: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #content {
        padding: 40px 16px 60px;
    }

    .section-content {
        padding: 28px 20px;
    }

    #constellation-container {
        width: 95%;
        margin-bottom: 28px;
    }
}

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

    .wiki-list li {
        padding-left: 18px;
    }

    .footer-line {
        width: 24px;
    }
}
