/* ============================================
   martiallaw.quest - Botanical Martial Law
   Candy-bright palette, layered-depth layout
   ============================================ */

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

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

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.75;
    color: #2A2020;
    background: #FFF8F0;
    overflow-x: hidden;
}

/* --- Typography --- */
.logotype {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(32px, 5vw, 72px);
    color: #FFFFFF;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.8s ease;
    letter-spacing: -0.02em;
}

.logotype.visible {
    opacity: 1;
}

.section-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: clamp(24px, 3.5vw, 48px);
    margin-bottom: 1em;
    color: #2A2020;
    line-height: 1.2;
}

.leather-heading {
    color: #FFF8F0;
}

.legal-ref {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 13px;
    color: #4A3020;
    letter-spacing: 0.02em;
}

.subtitle-tagline {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.5vw, 20px);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.75em;
    opacity: 0;
    transition: opacity 1s ease 0.4s;
}

.subtitle-tagline.visible {
    opacity: 1;
}

/* --- Perspective / 3D Depth System --- */
.perspective-container {
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;
    overflow: hidden;
}

.bg-layer {
    position: absolute;
    inset: 0;
    transform: translateZ(-100px) scale(1.1);
    opacity: 0.15;
    filter: blur(2px);
    pointer-events: none;
    z-index: 0;
}

.content-layer {
    position: relative;
    transform: translateZ(0);
    z-index: 1;
}

.fg-layer {
    position: relative;
    transform: translateZ(50px);
    z-index: 2;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF6B6B 0%, #FFB0B0 30%, #4DC8B0 70%, #2A8A50 100%);
    position: relative;
}

#hero .content-layer {
    text-align: center;
    padding: 2rem;
}

#hero .bg-layer {
    opacity: 0.12;
    filter: blur(1.5px);
}

/* Hero leaf backgrounds */
.leaf-bg {
    position: absolute;
}

.leaf-monstera-bg {
    width: 500px;
    height: 625px;
    top: -10%;
    left: -5%;
    opacity: 0.3;
    transform: rotate(-15deg);
}

.leaf-palm-bg {
    width: 350px;
    height: 700px;
    top: 5%;
    right: -3%;
    opacity: 0.2;
    transform: rotate(10deg);
}

.leaf-fern-bg {
    width: 300px;
    height: 500px;
    bottom: -5%;
    left: 30%;
    opacity: 0.25;
    transform: rotate(5deg);
}

/* Leather Banner */
.leather-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #4A3020;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.leather-banner.visible {
    transform: translateY(0);
}

.banner-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(12px, 1.2vw, 16px);
    color: #F0E8D8;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    letter-spacing: 0.05em;
}

.banner-text .legal-ref {
    color: #FFB0B0;
    font-size: clamp(13px, 1.3vw, 17px);
}

/* --- Content Sections --- */
.content-section {
    padding: 6rem 2rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.content-section .bg-layer {
    pointer-events: auto;
}

/* Gradient Teal section */
.gradient-teal {
    background: linear-gradient(180deg, #FFF8F0 0%, rgba(77, 200, 176, 0.08) 50%, #FFF8F0 100%);
}

/* Gradient Coral section */
.gradient-coral {
    background: linear-gradient(180deg, #FFF8F0 0%, rgba(255, 107, 107, 0.08) 50%, #FFF8F0 100%);
}

/* --- Content Panels --- */
.content-panel {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.cream-panel {
    background: #FFF8F0;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cream-panel p {
    margin-bottom: 1em;
    color: #2A2020;
}

.cream-panel .legal-ref {
    display: block;
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid rgba(74, 48, 32, 0.15);
    color: #4A3020;
    opacity: 0.7;
}

/* --- Leather Panels --- */
.leather-panel {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    background: #4A3020;
    border-radius: 12px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(42, 32, 32, 0.2);
}

.leather-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    border-radius: 12px;
}

.leather-text {
    color: #F0E8D8;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 1em;
}

.leather-ref {
    color: #FFB0B0;
    opacity: 0.8;
}

/* --- Leaf Decorations --- */
.leaf-decor {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1;
}

.leaf-decor:hover {
    transform: scale(1.05);
}

.leaf-monstera {
    width: 280px;
    height: 350px;
    top: -40px;
    left: -60px;
}

.leaf-palm {
    width: 220px;
    height: 440px;
    top: -20px;
    right: -40px;
}

.leaf-fern {
    width: 200px;
    height: 340px;
    top: 10%;
    left: -30px;
}

.leaf-monstera-large {
    width: 350px;
    height: 440px;
    top: -50px;
    right: -80px;
}

.leaf-palm-right {
    width: 240px;
    height: 480px;
    bottom: -40px;
    right: -50px;
}

/* --- Fade In Animation --- */
.fade-in-panel {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- Timeline --- */
.timeline {
    margin-top: 2rem;
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #4DC8B0, #2A8A50);
    border-radius: 2px;
}

.timeline-event {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 4px;
    width: 12px;
    height: 12px;
    background: #4DC8B0;
    border-radius: 50%;
    border: 2px solid #FFF8F0;
}

.timeline-event .legal-ref {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #FF6B6B;
    margin-bottom: 0.25em;
}

.timeline-event p {
    margin-bottom: 0;
}

/* --- Mechanism Grid --- */
.mechanism-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.mechanism-item {
    background: rgba(255, 248, 240, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 176, 176, 0.15);
}

.mechanism-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 1.1em;
    color: #FFB0B0;
    margin-bottom: 0.5em;
}

.mechanism-item .leather-text {
    font-size: 0.95em;
    line-height: 1.65;
}

.mechanism-item .leather-ref {
    display: block;
    margin-top: 0.75em;
    font-size: 11px;
}

/* --- Resilience Stories --- */
.resilience-stories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.story-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #4DC8B0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.story-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.story-icon svg {
    width: 100%;
    height: 100%;
}

.story-card h3 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 1.15em;
    color: #2A2020;
    margin-bottom: 0.5em;
}

.story-card p {
    font-size: 0.95em;
    line-height: 1.65;
    color: #4A3020;
}

/* --- Forward Points --- */
.forward-points {
    margin-top: 2rem;
}

.forward-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(74, 48, 32, 0.1);
}

.forward-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.forward-number {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 2.5em;
    color: #FF6B6B;
    opacity: 0.3;
    line-height: 1;
    min-width: 60px;
}

.forward-item h3 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 1.1em;
    color: #2A2020;
    margin-bottom: 0.35em;
}

.forward-item p {
    font-size: 0.95em;
    line-height: 1.65;
    color: #4A3020;
}

/* --- Footer --- */
.footer-section {
    border-radius: 0;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-domain {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 3vw, 40px);
    color: #FFF8F0;
    margin-bottom: 0.5em;
}

.footer-tagline {
    font-size: clamp(14px, 1.2vw, 18px);
    margin-bottom: 1.5em;
}

.footer-botanical {
    position: absolute;
    bottom: 0;
    right: 2rem;
    opacity: 0.2;
    z-index: 0;
}

.footer-leaf {
    width: 200px;
    height: 200px;
}

/* --- Ripple Effect --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    border: 2px solid #4DC8B0;
    pointer-events: none;
    animation: rippleExpand 0.8s ease-out forwards;
    z-index: 10;
}

@keyframes rippleExpand {
    from {
        width: 0;
        height: 0;
        opacity: 0.6;
    }
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
        margin: -100px;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-section {
        padding: 4rem 1.25rem;
    }

    .cream-panel,
    .leather-panel {
        padding: 2rem 1.5rem;
    }

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

    .resilience-stories {
        grid-template-columns: 1fr;
    }

    .leaf-decor {
        display: none;
    }

    .leaf-bg {
        display: none;
    }

    .forward-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .forward-number {
        font-size: 1.5em;
    }

    .timeline {
        padding-left: 1.5rem;
    }
}

@media (max-width: 480px) {
    .cream-panel,
    .leather-panel {
        padding: 1.5rem 1rem;
        border-radius: 8px;
    }

    .banner-text {
        font-size: 11px;
        padding: 0 1rem;
        text-align: center;
    }
}
