/* PPADDL.com - Botanical Field Journal */
/* Palette */
/* #faf5f0 - Warm Parchment (primary bg) */
/* #f5ede4 - Bone White (module bg) */
/* #3d0c1c - Deep Wine (primary text, borders) */
/* #4a1a2a - Dark Rose (body text) */
/* #6b1d3a - Living Burgundy (accent) */
/* #8a3a52 - Muted Rose (annotations) */
/* #7a8b6e - Dried Sage (leaf elements) */
/* #c41e3a - Vein Red (shake flash) */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #faf5f0;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    color: #4a1a2a;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* Fixed logotype module - top right */
#logotype {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border: 2px solid #3d0c1c;
    background-color: #f5ede4;
    z-index: 100;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#logotype-canvas {
    width: 40px;
    height: 40px;
    display: block;
}

/* Opening sequence */
#opening {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #faf5f0;
}

#specimen-canvas {
    width: 100%;
    max-width: 920px;
    height: 60vh;
    display: block;
    cursor: pointer;
}

#domain-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 48px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: #3d0c1c;
    margin-top: 24px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#domain-name.visible {
    opacity: 1;
}

/* Chapter spacing */
.chapter {
    margin-top: 120px;
}

.chapter-rule {
    width: 40%;
    height: 1px;
    background-color: #6b1d3a;
    margin-bottom: 40px;
    margin-left: 0;
}

/* Module grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Module base */
.module {
    background-color: #f5ede4;
    border: 2px solid #3d0c1c;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    transition: border-color 0.2s ease;
}

.module.span-1 { grid-column: span 1; }
.module.span-2 { grid-column: span 2; }
.module.span-3 { grid-column: span 3; }
.module.span-4 { grid-column: span 4; }

.module-content {
    padding: 32px;
    position: relative;
    z-index: 1;
}

/* Dark module (decay canvas) */
.module-dark {
    background-color: #3d0c1c;
}

.module-dark .module-content {
    padding: 0;
}

/* Module title */
.module-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: #3d0c1c;
    line-height: 1.15;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* Leaf icon (bullet) */
.leaf-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-color: #8a3a52;
    clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 25% 80%, 10% 50%, 25% 15%);
}

/* Vein divider */
.vein-divider {
    width: 100%;
    height: 20px;
    margin: 12px 0;
    position: relative;
}

/* Body text */
.body-text {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #4a1a2a;
    max-width: 62ch;
    margin-bottom: 16px;
    position: relative;
}

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

/* Line highlight on hover */
.body-text .line-highlight {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #6b1d3a;
    transition: width 0.3s ease;
}

/* Annotation text */
.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a3a52;
    line-height: 2;
    transition: transform 0.12s ease-in-out;
}

.annotation:hover {
    animation: annotation-shake 0.12s ease-in-out;
}

/* Corner specimen watermark */
.corner-specimen {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    opacity: 0.08;
    pointer-events: none;
}

/* Color swatch */
.color-swatch {
    width: 100%;
    height: 80px;
    margin-bottom: 12px;
    border: 1px solid #3d0c1c;
}

/* Canvas elements */
#network-canvas {
    width: 100%;
    height: 400px;
    display: block;
}

#decay-canvas {
    width: 100%;
    height: 400px;
    display: block;
}

/* Shake animation */
@keyframes module-shake {
    0% { transform: translateX(0); border-color: #c41e3a; }
    25% { transform: translateX(3px); }
    50% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
    100% { transform: translateX(0); border-color: #3d0c1c; }
}

@keyframes annotation-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(1px); }
    50% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

@keyframes logotype-shake {
    0% { transform: translateX(0); border-color: #c41e3a; }
    25% { transform: translateX(3px); }
    50% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
    100% { transform: translateX(0); border-color: #3d0c1c; }
}

.shake-active {
    animation: module-shake 0.12s ease-in-out;
}

#logotype.shake-active {
    animation: logotype-shake 0.12s ease-in-out;
}

/* Opening fade-in for page content below hero */
.chapter {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.chapter.visible {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: 1fr;
    }
    .module.span-1,
    .module.span-2,
    .module.span-3,
    .module.span-4 {
        grid-column: span 1;
    }
    #domain-name {
        font-size: 36px;
    }
    .module-title {
        font-size: 20px;
    }
    .chapter-rule {
        margin-left: 24px;
    }
}

@media (min-width: 769px) {
    .chapter-rule {
        max-width: 920px;
        margin-left: calc((100% - 920px) / 2);
        margin-right: auto;
    }
}
