/* ppss.ee — Light-Academia Burgundy Infinity */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    --deep-burgundy-dark: #2A1018;
    --warm-burgundy: #4A2838;
    --burgundy-accent: #8A3848;
    --section-border: #D0B8B0;
    --library-cream: #FDF6F0;
    --manuscript-white: #FFFAF4;
    --fish-gold: #C08040;
    --opulent-gold: #D0A060;

    --font-display: 'Albert Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-body: 'Albert Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--library-cream);
    color: var(--warm-burgundy);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.9;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   Tropical Fish Layer
   ======================================== */
.fish-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.fish {
    position: absolute;
    opacity: 0.06;
    transition: transform 0.3s ease;
    will-change: transform;
}

.fish svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--fish-gold);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========================================
   Ornament Canvas
   ======================================== */
.ornament-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 4rem 2rem;
    text-align: center;
    overflow: hidden;
}

.hero-ornament {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.hero-content {
    max-width: 680px;
    animation: heroFadeIn 2s ease-out both;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--deep-burgundy-dark);
    letter-spacing: 0.12em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--warm-burgundy);
    letter-spacing: 0.06em;
    opacity: 0;
    animation: heroSubtitleIn 1.8s ease-out 0.8s both;
}

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

@keyframes heroSubtitleIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* ========================================
   Manuscript Main
   ======================================== */
.manuscript {
    position: relative;
    z-index: 2;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   Manuscript Sections
   ======================================== */
.ms-section {
    padding-top: 12vw;
    padding-bottom: 4vw;
    border-top: 1px solid var(--section-border);
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Section Index Numbers */
.section-index {
    margin-bottom: 2rem;
}

.counter {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--burgundy-accent);
    line-height: 1;
    display: inline-block;
    min-width: 2ch;
}

.counter::before {
    content: '§';
    font-size: 0.5em;
    vertical-align: super;
    margin-right: 0.2em;
    opacity: 0.5;
}

/* Section Content */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    color: var(--deep-burgundy-dark);
    line-height: 1.2;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

.section-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: var(--warm-burgundy);
    line-height: 1.9;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.section-body:last-child {
    margin-bottom: 0;
}

/* Section Ornament */
.section-ornament {
    width: 100%;
    height: 60px;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

.section-ornament::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 1px solid var(--burgundy-accent);
    border-radius: 50%;
    opacity: 0.15;
    animation: ornamentPulse 4s ease-in-out infinite;
}

@keyframes ornamentPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.15;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.08;
    }
}

/* ========================================
   Footer
   ======================================== */
.manuscript-footer {
    position: relative;
    z-index: 2;
    max-width: 680px;
    margin: 0 auto;
    padding: 12vw 2rem 6rem;
    text-align: center;
}

.footer-ornament {
    width: 100%;
    height: 1px;
    background: var(--section-border);
    margin-bottom: 4rem;
}

.footer-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--deep-burgundy-dark);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.footer-colophon {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--burgundy-accent);
    letter-spacing: 0.04em;
    opacity: 0.6;
}

/* ========================================
   Generative Ornament Borders for Sections
   ======================================== */
.ms-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -40px;
    width: calc(100% + 80px);
    height: 100%;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 0% 20%, var(--burgundy-accent) 1px, transparent 1px),
        radial-gradient(circle at 100% 80%, var(--burgundy-accent) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.04;
    z-index: -1;
}

/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--library-cream);
}

::-webkit-scrollbar-thumb {
    background: var(--section-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--burgundy-accent);
}

/* ========================================
   Selection
   ======================================== */
::selection {
    background: var(--burgundy-accent);
    color: var(--manuscript-white);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .manuscript {
        padding: 0 1.5rem;
    }

    .ms-section {
        padding-top: 15vw;
    }

    .hero-title {
        letter-spacing: 0.08em;
    }

    .ms-section::before {
        left: -20px;
        width: calc(100% + 40px);
    }

    .manuscript-footer {
        padding: 15vw 1.5rem 4rem;
    }
}

@media (max-width: 480px) {
    .manuscript {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .manuscript-footer {
        padding: 20vw 1rem 3rem;
    }
}
