/* =================================================================
   Layer2.wiki - Archival Glassmorphism Design
   Colors: #C4A270, #FFF8EB, #3D3425, #D4C4A0, #E8C87A, #2A2318, #5A4E3A, #F5ECD7
   Fonts: EB Garamond, Inter, IBM Plex Mono
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #FFF8EB;
    color: #3D3425;
    line-height: 1.72;
    position: relative;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
}

/* Paper-aged background texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F5ECD7;
    background-image:
        radial-gradient(ellipse 800px 300px at 85% 10%, rgba(212, 196, 160, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 600px 350px at 15% 50%, rgba(212, 196, 160, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 700px 400px at 50% 85%, rgba(212, 196, 160, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -2;
}

.page-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* =================================================================
   Diagonal Section Layout
   ================================================================= */

.diagonal-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: skewY(-4deg);
    transform-origin: top center;
}

.diagonal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    z-index: -1;
}

.section-content {
    position: relative;
    max-width: 900px;
    z-index: 1;
    transform: skewY(4deg);
}

/* Alternating section backgrounds with glassmorphism */
.diagonal-section:nth-child(odd) {
    background: linear-gradient(135deg, rgba(255, 248, 235, 0.55) 0%, rgba(245, 236, 215, 0.55) 100%);
    backdrop-filter: blur(18px) saturate(1.1);
    border: 1px solid rgba(196, 162, 112, 0.25);
}

.diagonal-section:nth-child(even) {
    background: linear-gradient(135deg, rgba(245, 236, 215, 0.55) 0%, rgba(212, 196, 160, 0.45) 100%);
    backdrop-filter: blur(18px) saturate(1.1);
    border: 1px solid rgba(196, 162, 112, 0.25);
}

/* =================================================================
   Typography
   ================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: 'EB Garamond', serif;
    color: #3D3425;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 700;
    color: #C4A270;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, #C4A270 0%, rgba(196, 162, 112, 0) 100%);
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    font-weight: 600;
    color: #C4A270;
}

h3 {
    font-size: 1.3rem;
    font-weight: 500;
    font-style: italic;
    color: #5A4E3A;
}

p {
    font-size: 1em;
    line-height: 1.72;
    color: #3D3425;
    margin-bottom: 1.5rem;
}

.section-subtitle {
    font-family: 'EB Garamond', serif;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 500;
    font-style: italic;
    color: #5A4E3A;
    margin-bottom: 2rem;
}

.section-description {
    font-size: 1em;
    line-height: 1.72;
    color: #3D3425;
    margin-bottom: 2rem;
    max-width: 800px;
}

/* UI labels and metadata */
.scroll-indicator,
.archive-seal {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8B7D5E;
}

/* Code and technical terms */
code {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9em;
    background: rgba(196, 162, 112, 0.12);
    border-radius: 3px;
    padding: 0.1em 0.35em;
    color: #5A4E3A;
}

/* =================================================================
   Information Panels and Callouts
   ================================================================= */

/* Callout style using aged indigo accent */
a {
    position: relative;
    transition: color 0.3s ease-out;
}

a:visited {
    color: #4A5568;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #4A5568;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

a:visited::after {
    opacity: 0.3;
}

.info-panel {
    background: rgba(255, 255, 255, 0.5);
    border-left: 3px solid #C4A270;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 12px;
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(42, 35, 24, 0.12), 0 2px 8px rgba(42, 35, 24, 0.06), inset 0 0 1px rgba(74, 85, 104, 0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(196, 162, 112, 0), rgba(196, 162, 112, 0.5), rgba(196, 162, 112, 0));
}

.info-panel:hover {
    transform: scale(1.015);
    backdrop-filter: blur(22px);
    border-left-color: #C4A270;
    box-shadow: 0 12px 40px rgba(42, 35, 24, 0.18), 0 4px 12px rgba(42, 35, 24, 0.1);
}

.info-panel h3 {
    color: #C4A270;
    margin-top: 0;
    font-style: normal;
    font-weight: 600;
}

.info-panel p {
    color: #3D3425;
    margin-bottom: 1rem;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    color: #3D3425;
    font-size: 1em;
    line-height: 1.6;
}

.info-list li::before {
    content: '▪';
    position: absolute;
    left: 0.5rem;
    color: #C4A270;
    font-size: 1.2rem;
}

/* =================================================================
   Scroll Indicator
   ================================================================= */

.scroll-indicator {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.8rem;
    color: #5A4E3A;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: pulse-scroll 2s ease-in-out infinite;
}

@keyframes pulse-scroll {
    0%, 100% {
        opacity: 0.6;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(8px);
    }
}

/* =================================================================
   Hero Section
   ================================================================= */

.hero-section {
    background: linear-gradient(135deg, rgba(42, 35, 24, 0.95) 0%, rgba(61, 52, 37, 0.85) 100%);
    color: #F5ECD7;
    text-align: center;
    min-height: 110vh;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(18px);
    border: none;
}

.hero-section .section-title,
.hero-section .section-subtitle,
.hero-section .section-description,
.hero-section .scroll-indicator {
    color: #F5ECD7;
}

.hero-section .section-title {
    color: #E8C87A;
}

.hero-section .section-title::after {
    background: linear-gradient(90deg, #D4C4A0 0%, rgba(212, 196, 160, 0) 100%);
}

.hero-section p {
    color: #FFF8EB;
}

/* =================================================================
   Section-specific styling
   ================================================================= */

.base-layer {
    background: linear-gradient(135deg, rgba(255, 248, 235, 0.55) 0%, rgba(245, 236, 215, 0.55) 100%);
}

.scaling-problem {
    background: linear-gradient(135deg, rgba(245, 236, 215, 0.55) 0%, rgba(212, 196, 160, 0.45) 100%);
}

.layer2-solution {
    background: linear-gradient(135deg, rgba(255, 248, 235, 0.55) 0%, rgba(245, 236, 215, 0.55) 100%);
}

.rollups-explained {
    background: linear-gradient(135deg, rgba(245, 236, 215, 0.55) 0%, rgba(212, 196, 160, 0.45) 100%);
}

.future-layers {
    background: linear-gradient(135deg, rgba(255, 248, 235, 0.55) 0%, rgba(245, 236, 215, 0.55) 100%);
}

.conclusion-section {
    background: linear-gradient(135deg, rgba(42, 35, 24, 0.95) 0%, rgba(61, 52, 37, 0.85) 100%);
    color: #F5ECD7;
    text-align: center;
    min-height: 80vh;
}

.conclusion-section .section-title {
    color: #E8C87A;
}

.conclusion-section .section-subtitle,
.conclusion-section .section-description {
    color: #FFF8EB;
}

.conclusion-section .section-title::after {
    background: linear-gradient(90deg, #D4C4A0 0%, rgba(212, 196, 160, 0) 100%);
}

.archive-seal {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    color: #E8C87A;
    margin-top: 3rem;
    font-weight: 400;
    text-transform: none;
}

/* =================================================================
   Responsive Design
   ================================================================= */

@media (max-width: 768px) {
    .diagonal-section {
        min-height: 70vh;
        padding: 4rem 1.5rem;
        transform: skewY(-2deg);
    }

    .section-content {
        transform: skewY(2deg);
    }

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

    .section-title::after {
        width: 50%;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .info-panel {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }

    .section-description {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .diagonal-section {
        min-height: auto;
        padding: 3rem 1rem;
        min-height: 60vh;
        transform: skewY(-0.5deg);
    }

    .section-content {
        transform: skewY(0.5deg);
    }

    .section-title {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1rem;
    }

    .info-panel {
        padding: 1rem;
    }

    .section-description {
        font-size: 1em;
    }

    .info-list li {
        font-size: 0.95em;
        padding-left: 1.8rem;
    }
}

/* =================================================================
   Transitions and Animations
   ================================================================= */

.diagonal-section {
    transition: transform 0.3s ease-out;
}

.info-panel {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Subtle entrance animation */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.diagonal-section {
    animation: fade-in-up 0.6s ease-out;
}

/* =================================================================
   Print Styles
   ================================================================= */

@media print {
    .scroll-indicator {
        display: none;
    }

    .diagonal-section {
        page-break-inside: avoid;
        transform: none;
    }

    .section-content {
        transform: none;
    }
}
