/* ============================================
   simidiots.net - Avant-Garde Diagonal Sections
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #1a1410;
    color: #f0e6d0;
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================
   ENTRANCE SLASH
   ============================================ */
.entrance-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #0d0a07;
}

.diagonal-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.diagonal-line line {
    transition: none;
}

.entrance-upper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1410;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 0);
    opacity: 0;
    z-index: 1;
}

.entrance-lower {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #c45e2a;
    clip-path: polygon(0 0, 100% 70%, 100% 100%, 0 100%);
    opacity: 0;
    z-index: 1;
}

.entrance-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    z-index: 4;
    text-align: center;
    white-space: nowrap;
}

.domain-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3.2rem, 9vw, 8rem);
    letter-spacing: -0.02em;
    color: #f0e6d0;
    font-feature-settings: 'liga' 1, 'kern' 1;
    opacity: 0;
}

.domain-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(6px);
}

.domain-subtitle {
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8884a;
    margin-top: 0.8em;
    opacity: 0;
}

/* ============================================
   INTERSTITIAL GAPS
   ============================================ */
.interstitial-gap {
    position: relative;
    height: 30px;
    margin: -10px 0;
    z-index: 5;
    overflow: hidden;
}

.interstitial-gap::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    background: #c45e2a;
    transform: rotate(12deg);
    clip-path: polygon(0 30%, 100% 0%, 100% 70%, 0 100%);
    opacity: 0.6;
}

.interstitial-gap--2::before {
    background: #a8884a;
    transform: rotate(-12deg);
    clip-path: polygon(0 0%, 100% 30%, 100% 100%, 0 70%);
}

.interstitial-gap--3::before {
    background: #e8872e;
    transform: rotate(10deg);
    opacity: 0.4;
}

.interstitial-gap--4::before {
    background: #c45e2a;
    transform: rotate(-8deg);
    opacity: 0.5;
}

.interstitial-gap--5::before {
    background: #a8884a;
    transform: rotate(14deg);
    opacity: 0.35;
}

.interstitial-gap--6::before {
    background: #d4a44a;
    transform: rotate(-10deg);
    opacity: 0.3;
}

/* ============================================
   TILTED NARRATIVE PANELS
   ============================================ */
.tilted-panel {
    position: relative;
    width: 110vw;
    margin-left: -5vw;
    min-height: 80vh;
    padding: 10vh 8vw;
    overflow: hidden;
    opacity: 0;
    transition: none;
}

.panel--left {
    transform: rotate(-4deg);
    transform-origin: top right;
    margin-top: -8vw;
    margin-bottom: -8vw;
    background-color: #2e2418;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(168, 136, 74, 0.04) 4px,
            rgba(168, 136, 74, 0.04) 5px
        );
}

.panel--right {
    transform: rotate(5deg);
    transform-origin: top left;
    margin-top: -10vw;
    margin-bottom: -10vw;
    background-color: #1a1410;
    background-image:
        repeating-linear-gradient(
            50deg,
            transparent,
            transparent 4px,
            rgba(168, 136, 74, 0.04) 4px,
            rgba(168, 136, 74, 0.04) 5px
        );
}

.tilted-panel:nth-child(odd) .panel--left,
.panel--left:nth-of-type(2n) {
    background-color: #1e1812;
}

/* Panel vignette overlay */
.panel-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(13, 10, 7, 0.35) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Noise overlay on panels */
.tilted-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   PANEL CONTENT
   ============================================ */
.panel-content {
    position: relative;
    z-index: 3;
    max-width: 58ch;
}

.panel-content--right {
    margin-left: 28vw;
}

.panel-content--left {
    margin-left: 12vw;
}

.panel-meta {
    display: block;
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8884a;
    margin-bottom: 1.5em;
}

.panel-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    letter-spacing: -0.02em;
    color: #f0e6d0;
    line-height: 1.15;
    margin-bottom: 0.8em;
    font-feature-settings: 'liga' 1, 'kern' 1;
}

.panel-content p {
    color: #d4c4a8;
    margin-bottom: 1.2em;
}

.panel-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   CORNER BRACKETS (Vintage decorative)
   ============================================ */
.panel-corner-bracket {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.panel-corner-bracket::before,
.panel-corner-bracket::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: rgba(168, 136, 74, 0.3);
    border-style: solid;
}

.panel-corner-bracket::before {
    top: 24px;
    left: 24px;
    border-width: 2px 0 0 2px;
}

.panel-corner-bracket::after {
    bottom: 24px;
    right: 24px;
    border-width: 0 2px 2px 0;
}

/* ============================================
   MOTH SVGs
   ============================================ */
.moth-svg {
    position: absolute;
    width: 120px;
    height: 80px;
    z-index: 2;
    fill: #a8884a;
    opacity: 0.08;
    will-change: transform;
}

.moth-svg--right {
    top: 30px;
    right: 60px;
}

.moth-svg--left {
    top: 30px;
    left: 60px;
}

.moth-wing {
    transform-origin: 60px 40px;
    animation: mothFlutter 2.8s ease-in-out infinite alternate;
}

.moth-wing--right {
    animation-delay: 0.15s;
}

@keyframes mothFlutter {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0.92); }
}

.tilted-panel:hover .moth-svg,
.tilted-panel.in-view .moth-svg {
    transition: transform 0.6s ease-out;
}

.tilted-panel:hover .moth-svg--right,
.tilted-panel.in-view .moth-svg--right {
    transform: translateX(-8px);
}

.tilted-panel:hover .moth-svg--left,
.tilted-panel.in-view .moth-svg--left {
    transform: translateX(8px);
}

.tilted-panel:hover .moth-wing,
.tilted-panel.in-view .moth-wing {
    animation-duration: 1.2s;
}

/* ============================================
   FERN SVGs
   ============================================ */
.fern-svg {
    position: absolute;
    width: 60px;
    height: 200px;
    z-index: 2;
    opacity: 0.12;
    overflow: visible;
}

.fern-svg--left {
    bottom: -40px;
    left: 40px;
}

.fern-svg--right {
    bottom: -40px;
    right: 40px;
}

.fern-svg path {
    stroke: #5a6a3e;
}

/* ============================================
   COLLISION ZONES & SEED PODS
   ============================================ */
.collision-zone {
    position: absolute;
    width: 120px;
    height: 120px;
    z-index: 2;
    will-change: transform;
}

.collision-zone--top-left {
    top: 20px;
    left: 40px;
}

.collision-zone--top-right {
    top: 20px;
    right: 40px;
}

.collision-zone--bottom-right {
    bottom: 30px;
    right: 60px;
}

.seed-pod {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #c45e2a 0%, transparent 70%);
    opacity: 0.25;
}

.seed-pod--1 { width: 12px; height: 12px; top: 10px; left: 20px; }
.seed-pod--2 { width: 8px; height: 8px; top: 40px; left: 50px; }
.seed-pod--3 { width: 15px; height: 15px; top: 60px; left: 15px; }
.seed-pod--4 { width: 10px; height: 10px; top: 20px; left: 30px; }
.seed-pod--5 { width: 13px; height: 13px; top: 50px; left: 60px; }
.seed-pod--6 { width: 9px; height: 9px; top: 15px; left: 10px; }
.seed-pod--7 { width: 14px; height: 14px; top: 45px; left: 40px; }
.seed-pod--8 { width: 8px; height: 8px; top: 70px; left: 75px; }

/* ============================================
   RIPPLE EFFECT
   ============================================ */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 94, 42, 0.2) 0%, transparent 70%);
    transform: scale(0);
    pointer-events: none;
    z-index: 10;
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
}

.ripple-effect.active {
    animation: rippleExpand 700ms ease-out forwards;
}

@keyframes rippleExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   FINAL PANEL
   ============================================ */
.final-panel {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1410;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(168, 136, 74, 0.03) 4px,
            rgba(168, 136, 74, 0.03) 5px
        );
    overflow: hidden;
    transform: rotate(0deg);
}

.final-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.final-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.4rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    color: #f0e6d0;
    font-feature-settings: 'liga' 1, 'kern' 1;
    animation: finalPulse 3s ease-in-out infinite;
}

@keyframes finalPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============================================
   PANEL REVEAL ANIMATION STATES
   ============================================ */
.tilted-panel.revealed {
    opacity: 1;
}

.panel--left.pre-reveal {
    transform: rotate(-7deg) translateX(-40px);
}

.panel--right.pre-reveal {
    transform: rotate(8deg) translateX(40px);
}

.panel--left.revealed {
    transform: rotate(-4deg) translateX(0);
    transition: opacity 500ms ease, transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel--right.revealed {
    transform: rotate(5deg) translateX(0);
    transition: opacity 500ms ease, transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Per-panel rotation overrides from data-rotation */
.tilted-panel[data-rotation="-3"].revealed {
    transform: rotate(-3deg) translateX(0);
}

.tilted-panel[data-rotation="-3"].pre-reveal {
    transform: rotate(-6deg) translateX(-40px);
}

.tilted-panel[data-rotation="-5"].revealed {
    transform: rotate(-5deg) translateX(0);
}

.tilted-panel[data-rotation="-5"].pre-reveal {
    transform: rotate(-8deg) translateX(-40px);
}

.tilted-panel[data-rotation="4"].revealed {
    transform: rotate(4deg) translateX(0);
}

.tilted-panel[data-rotation="4"].pre-reveal {
    transform: rotate(7deg) translateX(40px);
}

/* ============================================
   ORNAMENTAL DIAMOND RULES
   ============================================ */
.interstitial-gap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 4px;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        rgba(168, 136, 74, 0.2) 8px,
        rgba(168, 136, 74, 0.2) 12px
    );
    transform: rotate(2deg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .panel-content--right,
    .panel-content--left {
        margin-left: 8vw;
        margin-right: 4vw;
    }

    .tilted-panel {
        padding: 8vh 6vw;
    }

    .moth-svg {
        width: 80px;
        height: 53px;
    }

    .panel-corner-bracket::before {
        top: 12px;
        left: 12px;
    }

    .panel-corner-bracket::after {
        bottom: 12px;
        right: 12px;
    }

    .entrance-text {
        transform: translate(-50%, -50%) rotate(-20deg);
    }

    .collision-zone {
        display: none;
    }
}

@media (max-width: 480px) {
    .domain-title {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .panel-heading {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
    }

    .moth-svg {
        width: 60px;
        height: 40px;
    }

    .fern-svg {
        width: 40px;
        height: 130px;
    }
}
