/* ============================================
   maljosim.com — Swiss Poster Archive
   Colors: #C2704E #2B2422 #F5EDE3 #8B4A2F #D4A96A #B8847A #2A5B5E #E8D5C0
   Fonts: Bebas Neue, Karla, DM Mono
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #F5EDE3;
    color: #2B2422;
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ---- Halftone SVG pattern ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
}

/* ---- Navigation ---- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

#main-nav .nav-line {
    height: 4px;
    width: 100%;
    background-color: #C2704E;
}

#main-nav .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px clamp(16px, 3vw, 48px);
}

#main-nav.scrolled {
    background-color: #F5EDE3cc;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.nav-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #2B2422;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    font-family: 'Karla', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #2B2422;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #2A5B5E;
}

/* ---- Hero Section ---- */
#hero {
    width: 100%;
    height: 100vh;
    background-color: #C2704E;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#hero.visible {
    opacity: 1;
}

.halftone-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease 0.8s;
    background-image: radial-gradient(circle, #B8847A 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
    z-index: 1;
}

#hero.visible .halftone-overlay {
    opacity: 0.15;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 40vh;
}

#hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #F5EDE3;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 0.92;
}

#hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#hero-title .letter.animate-in {
    opacity: 1;
    transform: scale(1);
}

.hero-subtitle {
    font-family: 'Karla', sans-serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: #F5EDE3;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

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

/* ---- Floating Letterforms ---- */
.floating-letter {
    position: absolute;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(6rem, 15vw, 12rem);
    color: #F5EDE333;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

.floating-m {
    top: 15%;
    left: -5%;
    animation: floatA 65s ease-in-out infinite alternate;
}

.floating-j {
    top: 60%;
    right: -3%;
    animation: floatB 78s ease-in-out infinite alternate;
}

.floating-s {
    bottom: 10%;
    left: 20%;
    animation: floatC 52s ease-in-out infinite alternate;
}

@keyframes floatA {
    0% { transform: translate(0, 0) rotate(-2deg); }
    100% { transform: translate(40px, -30px) rotate(3deg); }
}

@keyframes floatB {
    0% { transform: translate(0, 0) rotate(1deg); }
    100% { transform: translate(-35px, 25px) rotate(-2deg); }
}

@keyframes floatC {
    0% { transform: translate(0, 0) rotate(2deg); }
    100% { transform: translate(25px, -45px) rotate(-1deg); }
}

/* ---- Floating Years ---- */
.floating-year {
    position: fixed;
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.75rem, 0.9vw, 0.875rem);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #D4A96A44;
    pointer-events: none;
    z-index: 50;
    will-change: transform;
}

.fy-1 {
    top: 30%;
    right: 3%;
    animation: floatYear1 90s ease-in-out infinite alternate;
}

.fy-2 {
    top: 55%;
    left: 2%;
    animation: floatYear2 72s ease-in-out infinite alternate;
}

.fy-3 {
    top: 80%;
    right: 8%;
    animation: floatYear3 60s ease-in-out infinite alternate;
}

@keyframes floatYear1 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-40px); }
}

@keyframes floatYear2 {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-25px) translateX(15px); }
}

@keyframes floatYear3 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50px); }
}

/* ---- Content Grid ---- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(8px, 1.2vw, 16px);
    padding: clamp(8px, 1.2vw, 16px);
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- Modules ---- */
.module {
    position: relative;
    padding: clamp(24px, 3vw, 48px);
    transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 350ms ease;
    opacity: 0;
    transform: scale(0.95);
}

.module.animate-visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.module:hover {
    transform: scale(1.03);
}

.module-5 { grid-column: span 5; }
.module-7 { grid-column: span 7; }
.module-4 { grid-column: span 4; }
.module-3 { grid-column: span 3; }
.module-6 { grid-column: span 6; }
.module-8 { grid-column: span 8; }
.module-12 { grid-column: span 12; }

/* Module color variants */
.mod-terracotta {
    background-color: #C2704E;
    color: #F5EDE3;
    box-shadow: 3px 3px 0 #2B2422;
}

.mod-terracotta:hover {
    box-shadow: 6px 6px 0 #2B2422;
}

.mod-cream {
    background-color: #F5EDE3;
    color: #2B2422;
    box-shadow: 3px 3px 0 #C2704E;
}

.mod-cream:hover {
    box-shadow: 6px 6px 0 #C2704E;
}

.mod-charcoal {
    background-color: #2B2422;
    color: #F5EDE3;
    box-shadow: 3px 3px 0 #C2704E;
}

.mod-charcoal:hover {
    box-shadow: 6px 6px 0 #C2704E;
}

.mod-sand {
    background-color: #E8D5C0;
    color: #2B2422;
    box-shadow: 3px 3px 0 #8B4A2F;
}

.mod-sand:hover {
    box-shadow: 6px 6px 0 #8B4A2F;
}

.mod-deep-charcoal {
    background-color: #2B2422;
    color: #F5EDE3;
    box-shadow: 3px 3px 0 #2A5B5E;
}

.mod-deep-charcoal:hover {
    box-shadow: 6px 6px 0 #2A5B5E;
}

/* ---- Typography ---- */
h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 0.92;
    margin-bottom: 1.5rem;
}

h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 0.92;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

.body-light {
    color: #F5EDE3;
}

.text-cream {
    color: #F5EDE3;
}

.text-teal {
    color: #2A5B5E;
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.875rem, 1vw, 1rem);
    letter-spacing: 0.08em;
}

blockquote {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.1;
    color: #F5EDE3;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid #D4A96A;
}

.module-date {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.18em;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.module-caption {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.75rem, 0.9vw, 0.875rem);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #B8847A;
    margin-top: 1rem;
}

.mod-charcoal .module-caption,
.mod-deep-charcoal .module-caption {
    color: #B8847A;
}

/* ---- Registration Marks ---- */
.registration-mark {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    transition: transform 350ms ease;
}

.registration-mark::before,
.registration-mark::after {
    content: '';
    position: absolute;
    background-color: #B8847A;
}

.registration-mark::before {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.registration-mark::after {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.rm-tl { top: 8px; left: 8px; }
.rm-tr { top: 8px; right: 8px; }
.rm-bl { bottom: 8px; left: 8px; }
.rm-br { bottom: 8px; right: 8px; }

.rm-teal::before,
.rm-teal::after {
    background-color: #2A5B5E;
}

.module:hover .registration-mark {
    transform: rotate(45deg);
}

/* ---- Torn Paper Fragments ---- */
.torn-paper {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.tp-1 {
    width: 70%;
    height: 60%;
    top: 15%;
    left: 10%;
    background: linear-gradient(135deg, #F5EDE3, #E8D5C0);
    clip-path: polygon(5% 0%, 95% 3%, 100% 15%, 97% 85%, 92% 100%, 8% 97%, 0% 82%, 3% 12%);
    transform: rotate(-2deg);
    opacity: 0.6;
}

.tp-2 {
    width: 50%;
    height: 40%;
    bottom: 10%;
    right: 5%;
    background: linear-gradient(45deg, #2B2422, #8B4A2F);
    clip-path: polygon(2% 5%, 90% 0%, 98% 20%, 95% 90%, 88% 100%, 5% 95%, 0% 75%);
    transform: rotate(3deg);
    opacity: 0.4;
}

.tp-3 {
    width: 80%;
    height: 50%;
    top: 30%;
    left: 5%;
    background: linear-gradient(120deg, #C2704E, #D4A96A);
    clip-path: polygon(0% 8%, 92% 0%, 100% 25%, 96% 92%, 85% 100%, 3% 95%, 0% 70%);
    transform: rotate(1.5deg);
    opacity: 0.5;
}

.tp-4 {
    width: 75%;
    height: 55%;
    top: 10%;
    left: 10%;
    background: linear-gradient(135deg, #E8D5C0, #D4A96A);
    clip-path: polygon(3% 2%, 88% 0%, 100% 18%, 95% 88%, 90% 100%, 6% 96%, 0% 78%, 2% 10%);
    transform: rotate(-1deg);
    opacity: 0.5;
}

.tp-5 {
    width: 55%;
    height: 40%;
    bottom: 15%;
    right: 8%;
    background: linear-gradient(200deg, #C2704E, #8B4A2F);
    clip-path: polygon(5% 3%, 93% 0%, 100% 22%, 97% 85%, 90% 100%, 4% 97%, 0% 72%);
    transform: rotate(2.5deg);
    opacity: 0.35;
}

/* ---- Accent blocks ---- */
.accent-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 200px;
}

/* ---- Dividers ---- */
.divider {
    width: 100%;
    padding: 60px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.divider-charcoal {
    background-color: #2B2422;
}

.divider-sand {
    background-color: #E8D5C0;
}

.divider-line {
    height: 2px;
    width: 0%;
    background-color: #D4A96A;
    transition: width 1.2s ease;
}

.divider.animate-visible .divider-line {
    width: 100%;
}

/* ---- Deep section ---- */
.section-deep {
    background-color: #2B2422;
    padding-top: clamp(24px, 4vw, 64px);
    padding-bottom: clamp(48px, 6vw, 96px);
    max-width: 100%;
}

.section-deep .mod-deep-charcoal {
    box-shadow: 3px 3px 0 #2A5B5E;
    border: 1px solid #2A5B5E22;
}

.section-deep .mod-deep-charcoal:hover {
    box-shadow: 6px 6px 0 #2A5B5E;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .module-5, .module-7, .module-8,
    .module-6, .module-4, .module-3 {
        grid-column: span 12;
    }

    .nav-links {
        gap: 16px;
    }

    .floating-letter {
        display: none;
    }

    .floating-year {
        display: none;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .module-3 { grid-column: span 4; }
    .module-5 { grid-column: span 6; }
    .module-7 { grid-column: span 6; }
}
