/* ============================================
   MMIDDL.com - Neubrutalist Blog Styles
   ============================================ */

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

html {
    scroll-behavior: auto;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #FFF8E1;
    color: #212121;
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    padding-top: 56px;
}

a {
    color: #1565C0;
    text-decoration: none;
}

a:hover {
    color: #212121;
}

/* --- Masthead Bar --- */
#masthead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 56px;
    background-color: #FF5722;
    border-bottom: 4px solid #212121;
    transition: background-color 300ms ease;
}

#masthead.scrolled {
    background-color: #E64A19;
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.masthead-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 28px;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    transform: rotate(-1.5deg);
    display: inline-block;
    text-decoration: none;
}

.masthead-title:hover {
    color: #FFFFFF;
}

.masthead-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    text-transform: uppercase;
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 3px solid #212121;
    transition: border-color 120ms ease-out;
}

.nav-link:hover {
    color: #FFFFFF;
    border-bottom-color: #FFEB3B;
}

/* --- Headline Slab (Featured Post) --- */
#headline-slab {
    position: relative;
    background-color: #FFF8E1;
    padding: 60px 24px 48px 24px;
    overflow: hidden;
    border-bottom: 4px solid #212121;
}

.headline-content {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.headline-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 56px;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    transform: rotate(-2deg);
    margin-left: -10px;
    margin-right: -40px;
    color: #212121;
}

.headline-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.date-stamp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #212121;
}

.headline-excerpt {
    font-family: 'Work Sans', sans-serif;
    font-size: 17px;
    line-height: 1.65;
    margin-top: 20px;
    max-width: 720px;
    color: #212121;
}

/* Rubber Stamp */
.rubber-stamp {
    position: absolute;
    top: 40px;
    right: 48px;
    width: 100px;
    height: 100px;
    border: 2px dashed #D32F2F;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Archivo Black', sans-serif;
    font-size: 14px;
    color: #D32F2F;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transform: rotate(12deg);
    opacity: 0.4;
}

.stamp-small {
    position: relative;
    top: auto;
    right: auto;
    width: 80px;
    height: 80px;
    font-size: 11px;
    margin-top: 24px;
    display: inline-flex;
    transform: rotate(-5deg);
}

/* --- Tag Chips --- */
.tag-chip {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border: 3px solid #212121;
    border-radius: 2px;
    box-shadow: 1px 1px 0 #212121;
    text-transform: uppercase;
    line-height: 1;
}

.tag-orange {
    background-color: #FF5722;
    color: #FFFFFF;
}

.tag-blue {
    background-color: #1565C0;
    color: #FFFFFF;
}

.tag-yellow {
    background-color: #FFEB3B;
    color: #212121;
}

.tag-green {
    background-color: #E8F5E9;
    color: #212121;
}

.tag-red {
    background-color: #D32F2F;
    color: #FFFFFF;
}

.tag-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Blog River --- */
#blog-river {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* --- Post Cards --- */
.post-card {
    position: relative;
    border: 3px solid #212121;
    box-shadow: 8px 8px 0 #212121;
    padding: 32px;
    margin-bottom: 40px;
    transition: transform 120ms ease-out, box-shadow 120ms ease-out;
    cursor: default;
    /* Animation initial state */
    opacity: 0;
    transform: translateY(20px);
}

.post-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: transform 200ms ease-out, box-shadow 120ms ease-out, opacity 200ms ease-out;
}

.post-card:hover {
    transform: translate(4px, 4px);
    box-shadow: 4px 4px 0 #212121;
}

.post-card.visible:hover {
    transform: translate(4px, 4px);
    box-shadow: 4px 4px 0 #212121;
}

.card-odd {
    background-color: #FFFFFF;
    width: 92%;
}

.card-even {
    background-color: #E8F5E9;
    width: 78%;
    margin-left: auto;
}

.post-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: #212121;
    margin-bottom: 12px;
}

.post-excerpt {
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #212121;
    margin-bottom: 16px;
    paragraph-spacing: 1.2em;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1565C0;
    text-decoration: none;
    padding: 6px 14px;
    border: 3px solid #212121;
    box-shadow: 4px 4px 0 #212121;
    background-color: #FFFFFF;
    transition: transform 120ms ease-out, box-shadow 120ms ease-out;
    border-radius: 0;
}

.read-more:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #212121;
    color: #1565C0;
}

.doodle-arrow {
    display: inline-block;
    vertical-align: middle;
}

/* --- Tape Strips --- */
.tape-strip {
    position: absolute;
    top: -8px;
    left: -16px;
    right: -16px;
    height: 40px;
    z-index: 1;
    opacity: 0.85;
    transform-origin: left center;
}

.tape-strip::before,
.tape-strip::after {
    content: '';
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: #FFFFFF;
}

.tape-strip::before {
    left: 0;
}

.tape-strip::after {
    right: 0;
}

.tape-yellow {
    background-color: #FFEB3B;
    transform: rotate(0.8deg);
}

.tape-orange {
    background-color: #FF5722;
    transform: rotate(-0.5deg);
}

.tape-green {
    background-color: #E8F5E9;
    transform: rotate(1.2deg);
}

/* Tape entrance animation */
.tape-strip {
    width: 0;
    transition: width 400ms ease-out;
}

.tape-strip.tape-visible {
    width: calc(100% + 32px);
}

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    margin-bottom: 40px;
    border: 3px solid #212121;
    box-shadow: 8px 8px 0 #212121;
    /* Animation initial state */
    opacity: 0;
    transform: translateY(20px);
}

.bento-grid.visible {
    opacity: 1;
    transform: translateY(0);
    transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.bento-cell {
    padding: 24px;
    border: 3px solid #212121;
    transition: transform 200ms ease;
    transform-style: preserve-3d;
}

.bento-cell:hover {
    transform: rotateY(2deg) rotateX(-2deg);
}

.bento-quote {
    background-color: #FFEB3B;
    position: relative;
}

.bento-avatar {
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bento-tags {
    background-color: #E8F5E9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bento-doodle {
    background-color: #FFF8E1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.bento-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #212121;
    text-transform: uppercase;
}

/* --- Sticky Note --- */
.sticky-note {
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    font-style: italic;
    line-height: 1.4;
    color: #212121;
    transform: rotate(-2deg);
    position: relative;
}

.sticky-note-alt {
    transform: rotate(1.5deg);
}

.sticky-note p::before {
    content: none;
}

.sticky-fold {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 20px 20px;
    border-color: transparent transparent #FFF8E1 transparent;
}

/* --- Avatar Circle --- */
.avatar-circle {
    width: 64px;
    height: 64px;
    border: 3px solid #212121;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Archivo Black', sans-serif;
    font-size: 28px;
    color: #212121;
    background-color: #FFEB3B;
}

.avatar-alt {
    background-color: #FF5722;
    color: #FFFFFF;
}

.avatar-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #212121;
}

/* --- About Section --- */
.about-section {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px;
    border-top: 4px solid #212121;
    overflow: hidden;
}

.section-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 48px;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: #212121;
    margin-bottom: 20px;
    transform: rotate(-1deg);
}

.about-text {
    font-family: 'Work Sans', sans-serif;
    font-size: 17px;
    line-height: 1.65;
    max-width: 700px;
    color: #212121;
}

/* --- Tags Section --- */
.tags-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px 60px 24px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.tag-cloud .tag-chip {
    font-size: 14px;
    padding: 6px 14px;
    transition: transform 120ms ease-out, box-shadow 120ms ease-out;
    cursor: pointer;
}

.tag-cloud .tag-chip:hover {
    transform: translate(1px, 1px);
    box-shadow: 0 0 0 #212121;
}

/* --- Footer --- */
#footer {
    background-color: #212121;
    height: 80px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.marquee-track {
    width: 100%;
    overflow: hidden;
    height: 80px;
    display: flex;
    align-items: center;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee-scroll 60s linear infinite;
}

.marquee-content span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #FFFFFF;
    letter-spacing: 0.02em;
    padding-right: 0;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.footer-accent-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #FF5722;
}

/* --- Doodle SVGs --- */
.doodle-star,
.doodle-zigzag,
.doodle-wavy {
    display: block;
}

/* --- SVG Zigzag Divider --- */
.zigzag-divider {
    width: 100%;
    height: 16px;
    margin: 24px 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .headline-title {
        font-size: 36px;
    }

    .masthead-nav {
        gap: 16px;
    }

    .nav-link {
        font-size: 12px;
    }

    .card-odd,
    .card-even {
        width: 100%;
    }

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

    .post-title {
        font-size: 22px;
    }

    .section-title {
        font-size: 36px;
    }

    .rubber-stamp {
        display: none;
    }

    .post-card {
        padding: 24px;
    }

    .headline-title {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .masthead-title {
        font-size: 22px;
    }

    .masthead-nav {
        gap: 12px;
    }

    .nav-link {
        font-size: 11px;
    }

    .headline-title {
        font-size: 28px;
    }

    .post-card {
        padding: 16px;
        box-shadow: 6px 6px 0 #212121;
    }

    .post-card:hover {
        transform: translate(3px, 3px);
        box-shadow: 3px 3px 0 #212121;
    }

    .bento-grid {
        box-shadow: 6px 6px 0 #212121;
    }
}
