/* ============================================
   matchoomnews.com - Glitch Magazine Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0B1A24;
    color: #E0F5F5;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.05vw, 1rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Section 1: Dateline Hero --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #0B1A24;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.hero-korean {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #E0F5F5;
    line-height: 1;
    opacity: 0;
    transform: translateX(-60px);
}

.hero-english {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #FF6B7A;
    line-height: 1;
    margin-top: -1rem;
    opacity: 0;
    transform: translateX(60px);
}

.hero-korean.animate-in {
    animation: slideFromLeft 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-english.animate-in {
    animation: slideFromRight 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Morph Shape */
.morph-shape {
    position: absolute;
    width: 200px;
    height: 40px;
    background-color: #FF6B7A;
    opacity: 0.3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    animation: morphCycle 4s ease-in-out infinite;
}

@keyframes morphCycle {
    0%, 100% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
    16.67% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
    25% {
        clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    }
    41.67% {
        clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    }
    50% {
        clip-path: polygon(0% 0%, 90% 0%, 100% 100%, 10% 100%);
    }
    66.67% {
        clip-path: polygon(0% 0%, 90% 0%, 100% 100%, 10% 100%);
    }
    75% {
        clip-path: polygon(5% 0%, 95% 0%, 85% 100%, 15% 100%);
    }
    91.67% {
        clip-path: polygon(5% 0%, 95% 0%, 85% 100%, 15% 100%);
    }
}

/* Glitch Rectangles */
.glitch-rectangles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.glitch-rect {
    position: absolute;
    opacity: 0;
    transform: scale(0);
}

.glitch-rect.pop-in {
    animation: popIn 100ms ease-out forwards;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Section 2: News Grid --- */
.news-grid {
    background-color: #0B1A24;
    padding: 4rem 2rem;
}

.news-grid-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
}

.news-card {
    background-color: #0F2233;
    border-top: 3px solid #FF6B7A;
    padding: 1.5rem;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card.animate-in {
    animation: cardSlideUp 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card.animate-in:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 200, 255, 0.1);
}

/* Glitch Card Treatment (every 4th card) */
.news-card.glitch-card {
    clip-path: inset(0 5% 10% 0);
    overflow: visible;
}

.news-card.glitch-card .glitch-duplicate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #00C8FF;
    background: transparent;
    pointer-events: none;
    opacity: 0.6;
    z-index: -1;
    transform: translate(4px, 3px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.news-card.glitch-card:hover .glitch-duplicate {
    transform: translate(6px, 5px);
    opacity: 0.85;
}

/* Glitch card entry animation for duplicate */
.news-card.glitch-card.animate-in .glitch-duplicate {
    animation: glitchDuplicateSettle 200ms ease-out forwards;
}

@keyframes glitchDuplicateSettle {
    from {
        transform: translate(12px, 10px);
        opacity: 0.3;
    }
    to {
        transform: translate(4px, 3px);
        opacity: 0.6;
    }
}

.card-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #4A7A8A;
    display: block;
    margin-bottom: 0.75rem;
}

.card-headline {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: #E0F5F5;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.card-preview {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.05vw, 1rem);
    color: #4A7A8A;
    line-height: 1.75;
}

/* --- Section 3: Morph Zone --- */
.morph-zone {
    position: relative;
    width: 100%;
    height: 80vh;
    background-color: #0B1A24;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 1px solid #1A3344;
    border-bottom: 1px solid #1A3344;
}

.morph-zone-label {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.label-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #4A7A8A;
    text-transform: uppercase;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(6, 80px);
    grid-template-rows: repeat(4, 60px);
    gap: 8px;
}

.tile {
    width: 80px;
    height: 60px;
    background-color: #0F2233;
    opacity: 0;
    transition: all 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tile.visible {
    opacity: 1;
}

.tile.alt {
    background-color: #1A3344;
}

.tile.featured {
    background-color: #FF6B7A;
}

/* --- Section 4: Deep Current Footer --- */
.deep-footer {
    background-color: #061118;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-shapes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    animation: driftRight 30s linear infinite;
}

@keyframes driftRight {
    0% {
        transform: translateX(-20px);
    }
    50% {
        transform: translateX(20px);
    }
    100% {
        transform: translateX(-20px);
    }
}

.footer-shape {
    opacity: 0.3;
}

.footer-shape.circle circle,
.footer-shape.triangle polygon {
    fill: #FF6B7A;
}

.footer-shape.square rect {
    fill: #00C8FF;
}

.footer-domain {
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    color: #4A7A8A;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .news-grid-inner {
        grid-template-columns: 1fr 1fr;
    }

    .tile-grid {
        grid-template-columns: repeat(4, 80px);
        grid-template-rows: repeat(6, 60px);
    }
}

@media (max-width: 600px) {
    .news-grid-inner {
        grid-template-columns: 1fr;
    }

    .tile-grid {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(8, 60px);
    }

    .hero-korean {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .hero-english {
        font-size: clamp(2rem, 10vw, 4rem);
    }
}
