/* ============================================================
   MORES.DEV - Complete CSS
   Minimalist aesthetic with candy-bright accents
   ============================================================ */

/* Reset and Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #FAFAF5 0%, #FAFAF5 98%, #F5F0E8 100%);
    background-attachment: fixed;
    color: #2C2A26;
    font-family: 'Lora', serif;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0.01em;
    min-height: 100vh;
    position: relative;
}

/* Subtle marble-vein texture background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(65deg, rgba(150, 140, 130, 0.02) 0%, transparent 50%),
        linear-gradient(-65deg, rgba(120, 110, 100, 0.01) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Typography */
h1 {
    font-family: 'Lora', serif;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.2;
    color: #2C2A26;
}

h2 {
    font-family: 'Lora', serif;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-weight: 600;
    color: #2C2A26;
}

p {
    color: #2C2A26;
}

/* Code typography */
code {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.88rem;
    background-color: #F0EAE0;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    color: #2C2A26;
}

/* Container and Layout */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 120px;
    padding-top: 4rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 40px;
        padding-top: 2rem;
    }
}

/* Hero Section */
.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 8vh;
}

.hero h1 {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-style: italic;
    font-size: clamp(0.95rem, 1.2vw, 1rem);
    color: #2C2A26;
    max-width: 500px;
    line-height: 1.6;
    opacity: 0.85;
}

/* Module Grid System */
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

/* Module base styling */
.module {
    background-color: #F5F0E8;
    border: 1px solid #E8D5C4;
    padding: 24px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    opacity: 0;
    transform: scale(1);
    border-radius: 2px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Module animation states */
.module[data-animate="true"] {
    animation: pulse-attention 0.4s ease-in-out forwards;
}

.module[data-animate="true"]:nth-child(1) { animation-delay: 0.05s; }
.module[data-animate="true"]:nth-child(2) { animation-delay: 0.1s; }
.module[data-animate="true"]:nth-child(3) { animation-delay: 0.15s; }
.module[data-animate="true"]:nth-child(4) { animation-delay: 0.2s; }
.module[data-animate="true"]:nth-child(5) { animation-delay: 0.25s; }
.module[data-animate="true"]:nth-child(6) { animation-delay: 0.3s; }
.module[data-animate="true"]:nth-child(7) { animation-delay: 0.35s; }
.module[data-animate="true"]:nth-child(8) { animation-delay: 0.4s; }
.module[data-animate="true"]:nth-child(9) { animation-delay: 0.45s; }
.module[data-animate="true"]:nth-child(10) { animation-delay: 0.5s; }
.module[data-animate="true"]:nth-child(11) { animation-delay: 0.55s; }
.module[data-animate="true"]:nth-child(12) { animation-delay: 0.6s; }
.module[data-animate="true"]:nth-child(13) { animation-delay: 0.65s; }
.module[data-animate="true"]:nth-child(14) { animation-delay: 0.7s; }
.module[data-animate="true"]:nth-child(15) { animation-delay: 0.75s; }
.module[data-animate="true"]:nth-child(16) { animation-delay: 0.8s; }
.module[data-animate="true"]:nth-child(17) { animation-delay: 0.85s; }
.module[data-animate="true"]:nth-child(18) { animation-delay: 0.9s; }
.module[data-animate="true"]:nth-child(19) { animation-delay: 0.95s; }

@keyframes pulse-attention {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Content modules */
.content-module {
    background-color: #F5F0E8;
    border: 1px solid #E8D5C4;
    padding: 24px;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
}

.content-module p {
    margin: 0;
}

.content-double {
    grid-column: span 2;
    background-color: #F5F0E8;
    border: 1px solid #E8D5C4;
}

/* Module labels */
.module-label {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: #2C2A26;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 12px;
    display: block;
}

/* Color block modules */
.color-block {
    background-color: #E84B8A;
    border: none;
    padding: 0;
    min-height: 240px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 1px 3px rgba(0, 0, 0, 0.02);
    border-radius: 2px;
}

.color-block.color-pink {
    background-color: #E84B8A;
}

.color-block.color-blue {
    background-color: #4BA8E8;
}

.color-block.color-gold {
    background-color: #E8B84B;
}

/* Generative art modules */
.generative-module {
    background-color: #F5F0E8;
    border: 1px solid #E8D5C4;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Flow field color - mint green accent from palette */
.flow-field-color {
    color: #7ACAA0;
}

.generative-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Offset modules (woven textile pattern) */
.offset {
    grid-column: 2 / -1;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #E8B84B;
    border-radius: 50%;
    z-index: 100;
    opacity: 0.8;
    transition: transform 0.2s ease-out;
    pointer-events: none;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .offset {
        grid-column: 1 / -1;
    }

    .content-double {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .offset {
        grid-column: 1 / -1;
    }

    .content-double {
        grid-column: 1 / -1;
    }

    .module {
        min-height: 200px;
        padding: 16px;
    }

    .hero {
        padding-top: 4vh;
        min-height: 40vh;
    }
}

/* Interactive States */
.module:hover {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease-out;
}

/* Link Styling */
a {
    color: #2C2A26;
    text-decoration: underline;
    opacity: 0.8;
    transition: all 0.2s ease-out;
}

a:hover {
    color: #E84B8A;
    opacity: 1;
}

a:active {
    color: #4BA8E8;
}

/* Text Selection */
::selection {
    background-color: #E84B8A;
    color: #FAFAF5;
}

::-moz-selection {
    background-color: #E84B8A;
    color: #FAFAF5;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #FAFAF5;
}

::-webkit-scrollbar-thumb {
    background: #E8B84B;
    border-radius: 4px;
    opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
    background: #E84B8A;
    opacity: 0.8;
}

/* Smooth transitions for all interactive elements */
button, a, input, select, textarea {
    transition: all 0.2s ease-out;
}

/* Print styles */
@media print {
    .scroll-progress {
        display: none;
    }

    body::before {
        display: none;
    }

    .module {
        page-break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .module {
        border-color: #2C2A26;
    }

    .module-label {
        opacity: 1;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode detection */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2C2A26 0%, #2C2A26 98%, #3A3834 100%);
        color: #F5F0E8;
    }

    body::before {
        background-image:
            linear-gradient(65deg, rgba(245, 240, 232, 0.05) 0%, transparent 50%),
            linear-gradient(-65deg, rgba(245, 240, 232, 0.03) 0%, transparent 50%);
    }

    .module,
    .content-module,
    .generative-module {
        background-color: #3A3834;
        border-color: #4A4840;
        color: #F5F0E8;
    }

    .module-label {
        color: #F5F0E8;
    }

    p {
        color: #F5F0E8;
    }

    code {
        background-color: #2C2A26;
        color: #F5F0E8;
    }

    a {
        color: #F5F0E8;
    }

    .hero-subtitle {
        color: #F5F0E8;
    }

    h1, h2 {
        color: #F5F0E8;
    }

    ::-webkit-scrollbar-track {
        background: #2C2A26;
    }

    ::-webkit-scrollbar-thumb {
        background: #E8B84B;
    }
}
