/* ============================================
   ppuzzle.dev - Dark Academia + Wabi-Sabi
   Color Palette:
     Primary Dark: #1A1410
     Academic Gold: #C4A882
     Burgundy Accent: #5C2E3A
     Slate Gray: #4A4A52
     Aged Cream: #E8DDD0
     Accent Green: #5A6B52
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #1A1410;
    color: #E8DDD0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* ---- Paper Texture Overlay ---- */
#paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: soft-light;
    opacity: 0.1;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(196, 168, 130, 0.03) 2px,
            rgba(196, 168, 130, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(196, 168, 130, 0.02) 3px,
            rgba(196, 168, 130, 0.02) 6px
        ),
        radial-gradient(ellipse at 20% 50%, rgba(196, 168, 130, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 30%, rgba(92, 46, 58, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(196, 168, 130, 0.05) 0%, transparent 50%);
    background-size: 4px 4px, 6px 6px, 100% 100%, 100% 100%, 100% 100%;
}

/* ---- Network Graph ---- */
#network-graph {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
}

#network-graph line {
    stroke: #5C2E3A;
    stroke-width: 0.5;
}

#network-graph circle {
    fill: #5C2E3A;
}

/* ---- Timeline Spine ---- */
#timeline-spine {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
}

.timeline-line {
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #C4A882 20%, #C4A882 80%, transparent);
    opacity: 0.4;
}

.timeline-node {
    position: relative;
    padding-left: 24px;
    cursor: pointer;
    transition: all 0.4s ease;
}

.timeline-node::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #C4A882;
    background: #1A1410;
    transition: all 0.4s ease;
}

.timeline-node.active::before {
    background: #C4A882;
    box-shadow: 0 0 8px rgba(196, 168, 130, 0.4);
}

.timeline-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: #C4A882;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
    transition: opacity 0.4s ease;
}

.timeline-node:hover .timeline-label {
    opacity: 1;
}

.timeline-citation {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: #4A4A52;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.6s ease, opacity 0.4s ease;
    opacity: 0;
}

.timeline-node:hover .timeline-citation {
    max-width: 250px;
    opacity: 1;
}

/* ---- Sections ---- */
.section {
    position: relative;
    min-height: 100vh;
    padding: 80px 100px 80px 80px;
    z-index: 10;
}

.diagonal-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ---- Diagonal Rules ---- */
.diagonal-rule {
    position: absolute;
    height: 1px;
    pointer-events: none;
    z-index: 5;
    transition: background-color 0.6s ease;
}

.diagonal-rule-1 {
    width: 70%;
    top: 30%;
    right: -5%;
    transform: rotate(-18deg);
    background: linear-gradient(to right, transparent, #C4A882 30%, #C4A882 70%, transparent);
    opacity: 0.3;
}

.diagonal-rule-2 {
    width: 50%;
    bottom: 20%;
    left: 10%;
    transform: rotate(15deg);
    background: linear-gradient(to right, transparent, #5C2E3A 40%, #5C2E3A 60%, transparent);
    opacity: 0.25;
}

.diagonal-rule-3 {
    width: 60%;
    bottom: 10%;
    right: 0;
    transform: rotate(-12deg);
    background: linear-gradient(to right, transparent, #C4A882 30%, transparent);
    opacity: 0.3;
}

.diagonal-rule-4 {
    width: 80%;
    top: 35%;
    left: -10%;
    transform: rotate(8deg);
    background: linear-gradient(to right, transparent, #5C2E3A 50%, transparent);
    opacity: 0.2;
}

.diagonal-rule-5 {
    width: 55%;
    bottom: 20%;
    right: 5%;
    transform: rotate(-20deg);
    background: linear-gradient(to right, transparent, #C4A882 30%, #C4A882 70%, transparent);
    opacity: 0.25;
}

.diagonal-rule-6 {
    width: 65%;
    top: 15%;
    left: 5%;
    transform: rotate(10deg);
    background: linear-gradient(to right, transparent, #5C2E3A 40%, transparent);
    opacity: 0.2;
}

.diagonal-rule:hover {
    background-color: #5A6B52;
    opacity: 0.5;
}

/* ---- Watermark Icons ---- */
.watermark-icon {
    position: absolute;
    pointer-events: none;
    color: #5C2E3A;
    opacity: 0;
    transition: opacity 1.2s ease;
    z-index: 2;
}

.watermark-icon.visible {
    opacity: 0.12;
}

.watermark-seal {
    width: 220px;
    height: 220px;
    top: 10%;
    right: 8%;
}

.watermark-badge {
    width: 140px;
    height: 180px;
    bottom: 15%;
    left: 15%;
}

.watermark-parliament {
    width: 300px;
    height: 200px;
    top: 5%;
    right: 10%;
}

/* ---- Hero Section ---- */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-left: 80px;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 20;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease 0.3s, transform 1.2s ease 0.3s;
}

.hero-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: #E8DDD0;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #C4A882;
    margin-bottom: 48px;
    opacity: 0.85;
}

.hero-thesis {
    border-left: 2px solid #5C2E3A;
    padding-left: 24px;
    margin-top: 40px;
}

.thesis-marker {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #C4A882;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-thesis p {
    font-family: 'Noto Serif', serif;
    font-weight: 500;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #E8DDD0;
    opacity: 0.9;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 1.5s ease 1.5s;
    z-index: 20;
}

.scroll-indicator.revealed {
    opacity: 0.6;
}

.scroll-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #4A4A52;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, #4A4A52, transparent);
    animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.3); }
}

/* ---- Landscape Section ---- */
#landscape {
    padding-top: 120px;
    padding-bottom: 120px;
}

.tilted-right {
    transform: rotate(2deg);
    transform-origin: center center;
}

.tilted-left {
    transform: rotate(-2deg);
    transform-origin: center center;
}

.landscape-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.landscape-image {
    position: relative;
    overflow: hidden;
}

.duotone-photo {
    position: relative;
    border: 1px solid rgba(196, 168, 130, 0.15);
}

.duotone-photo svg {
    display: block;
    width: 100%;
    height: auto;
}

.duotone-photo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(92, 46, 58, 0.4), rgba(232, 221, 208, 0.1));
    mix-blend-mode: overlay;
}

.landscape-text {
    position: relative;
    z-index: 10;
}

.section-heading {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: #E8DDD0;
    margin-bottom: 28px;
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #E8DDD0;
    opacity: 0.85;
    margin-bottom: 20px;
}

.data-callout {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 0;
    margin-top: 20px;
    border-top: 1px solid rgba(196, 168, 130, 0.2);
}

.callout-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: #C4A882;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.callout-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #4A4A52;
}

/* ---- Essays Section ---- */
#essays {
    padding-top: 80px;
    padding-bottom: 120px;
}

.essay-block {
    max-width: 680px;
    margin: 80px auto;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.essay-block.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--tilt, 0deg));
}

.essay-block-1 { --tilt: 2deg; margin-left: 12%; }
.essay-block-2 { --tilt: -3deg; margin-right: 8%; margin-left: auto; }
.essay-block-3 { --tilt: 4deg; margin-left: 18%; }
.essay-block-4 { --tilt: -2deg; margin-right: 12%; margin-left: auto; }

.essay-number {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: 3rem;
    color: #5C2E3A;
    opacity: 0.3;
    line-height: 1;
    margin-bottom: 12px;
}

.essay-title {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #E8DDD0;
    margin-bottom: 20px;
}

.pull-quote {
    margin: 32px 0;
    padding: 24px 0 24px 24px;
    border-left: 2px solid #5C2E3A;
}

.pull-quote p {
    font-family: 'Noto Serif', serif;
    font-weight: 500;
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.6;
    color: #C4A882;
}

/* ---- Exploration Section ---- */
#exploration {
    padding-top: 120px;
    padding-bottom: 120px;
}

.exploration-content {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.exploration-intro {
    max-width: 650px;
    margin-bottom: 60px;
}

.exploration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.exploration-card {
    padding: 32px;
    border: 1px solid rgba(196, 168, 130, 0.15);
    position: relative;
    transition: border-color 0.5s ease;
}

.exploration-card:hover {
    border-color: rgba(90, 107, 82, 0.5);
}

.card-marker {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #C4A882;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.card-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #E8DDD0;
    opacity: 0.75;
}

.duotone-small {
    max-width: 350px;
    margin: 60px auto 0;
}

/* ---- Footer ---- */
#footer-section {
    min-height: auto;
    padding: 80px 80px 60px;
    border-top: 1px solid rgba(196, 168, 130, 0.1);
}

.footer-content {
    max-width: 600px;
}

.footer-notation {
    margin-bottom: 40px;
}

.notation-marker {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: #C4A882;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.footer-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #4A4A52;
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A4A52;
    letter-spacing: 0.05em;
}

.meta-divider {
    color: #4A4A52;
    opacity: 0.4;
}

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

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

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .section {
        padding: 60px 40px 60px 60px;
    }

    #timeline-spine {
        display: none;
    }

    .landscape-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    .tilted-right,
    .tilted-left {
        transform: rotate(0deg);
    }

    .essay-block {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .essay-block.visible {
        transform: translateY(0) rotate(0deg);
    }

    #hero {
        padding-left: 40px;
    }
}

@media (max-width: 600px) {
    .section {
        padding: 40px 20px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }

    #hero {
        padding-left: 20px;
    }

    #footer-section {
        padding: 40px 20px;
    }
}
