/* ==========================================================================
   1. Settings
   ========================================================================== */
:root {
    --color-violet-950: #2f0d68;
    --color-white: #ffffff;
    --color-pink-100: #ffe4e6;
    --color-pink-500: #ff637e;

    --font-kumbh-sans: 'Kumbh Sans', sans-serif;

    --spacing-4: 16px;
    --radius-2xl: 16px;
    --radius-3xl: 32px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-kumbh-sans);
    background-color: var(--color-pink-100);
    /* Fallback for the gradient background */
    background-image: linear-gradient(to right, #ffe4e6, #ffe4e6);
    min-height: 100vh;
    position: relative;
}

/* Background Pattern */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    background-image: radial-gradient(circle at 50% 75%, rgba(255, 99, 126, 0.25) 0%, rgba(255, 99, 126, 0) 60%);
    background-size: cover;
    z-index: -1;
}

/* ==========================================================================
   3. Layout
   ========================================================================== */
/* Header */
.site-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-4);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease-in-out;
    border-bottom: 1px solid rgba(255, 99, 126, 0);
}

.site-header.logo-visible {
    border-bottom: 1px solid rgba(255, 99, 126, 0.15);
    background-color: rgba(255, 228, 230, 0.7);
    /* Pink-100 with opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
}

.header-left,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-center {
    display: flex;
    justify-content: center;
}

.header-right {
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 768px) {
    .header-center {
        display: none;
    }
}

/* ==========================================================================
   4. Components
   ========================================================================== */

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 32px var(--spacing-4) 80px;
    color: var(--color-violet-950);
}

.hero-logo {
    max-width: 100%;
    width: 320px;
    height: auto;
    margin-bottom: var(--spacing-4);
    display: inline-block;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: var(--spacing-4);
    line-height: 1.1;
}

.hero p {
    font-size: 1.65rem;
    line-height: 1.5;
    font-weight: 300;
    opacity: 0.8;
}

/* --- Newsletter Form --- */
.newsletter-form {
    display: flex;
    gap: var(--spacing-4);
    justify-content: center;
    margin-top: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 99, 126, 0.2);
    border-radius: var(--radius-2xl);
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-violet-950);
    outline: none;
    transition: all 0.2s ease;
}

.newsletter-form input:focus {
    border-color: var(--color-pink-500);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 99, 126, 0.2);
}

.newsletter-form button {
    height: auto;
    /* Allow button to match input height if needed, though flex usually handles it */
    padding-left: 24px;
    padding-right: 24px;
}

/* --- Content Grid --- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 36px;
    padding: 0 var(--spacing-4) 80px;
    max-width: 1280px;
    margin: 0 auto;
}

/* --- Card --- */
.card {
    background-color: rgba(255, 255, 255, 1);
    /* border: 1px solid var(--color-violet-950); */
    /* outline: 1px solid #560f1b55; */
    /* outline-offset: -1px; */
    border-radius: var(--radius-3xl);
    aspect-ratio: 4 / 5;
    width: 100%;
    transition: transform 0.2s ease;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.10);
    corner-shape: squircle;
    padding-top: 64px;
}

.card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: 1.5px solid #560f1b33;
    outline-offset: -1.5px;
    border-radius: var(--radius-3xl);
    corner-shape: squircle;
}

.card-content {
    padding: 24px 24px 128px 24px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    color: var(--color-white);
    background: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%);
}

.dark-text .card-content {
    color: #000;
}

.card-content h2 {
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.2;
}


.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card:hover {
    transform: scale(1.01);
}

/* --- Tags --- */
.card-tags {
    display: flex;
    gap: 6px;
    margin: 0 0 8px 0;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    padding: 1px 3px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.15);
    letter-spacing: 0.075em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-text .tag {
    color: #000;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

@media (max-width: 640px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 3rem;
    }

    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }

    .newsletter-form button {
        width: 100%;
    }
}

/* --- Logo --- */
.logo {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.site-header.logo-visible .logo {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.logo img {
    height: 48px;
    /* Adjust based on actual aspect ratio */
    width: auto;
    display: block;
}

/* --- Icon Grid (Burger Icon) --- */
.icon-grid {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 14px;
    height: 12px;
}

.icon-grid .line {
    width: 100%;
    height: 2px;
    background-color: var(--color-violet-950);
    border-radius: 1px;
}

/* --- Buttons --- */

/* Base Button Class */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.2s ease-in-out;
    outline: 1.5px solid transparent;
    outline-offset: 0px;
    background-color: var(--color-white);
    border-radius: var(--radius-2xl);
    color: var(--color-violet-950);
    height: 32px;
}

.btn:hover,
.btn:active,
.btn:focus-visible {
    outline-color: currentColor;
    outline-offset: 2px;
}

/* Icon Button Modifier */
.btn-icon {
    width: 32px;
}

/* Primary Button Modifier */
.btn-primary {
    min-width: 72px;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    padding: 0 16px;
    text-decoration: none;
}

/* --- Popup Modal --- */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    /* Above site-main (0), below site-header (100) */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 96px 24px 36px 24px;
}

.popup-container.active {
    display: flex;
    overflow: auto;
    align-items: flex-start;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffe4e6aa;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    animation: fadeIn 0.3s ease-in-out;
}

.popup-container.closing .popup-overlay {
    animation: fadeOut 0.3s ease-in-out forwards;
}

.popup-modal {
    position: relative;
    background-color: var(--color-white);
    border-radius: var(--radius-3xl);
    max-width: 800px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
    animation: popupSlideIn 0.3s ease-out;
    z-index: 1;
}

.popup-container.closing .popup-modal {
    animation: popupSlideOut 0.3s ease-in forwards;
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.popup-close:hover {
    background-color: var(--color-white);
    transform: scale(1.1);
}

.popup-close svg {
    color: var(--color-violet-950);
}

.popup-content {
    display: flex;
    flex-direction: column;
}

.popup-image-wrapper {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
    background-color: var(--color-pink-100);
}

.popup-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-body {
    padding: 40px;
    color: var(--color-violet-950);
}

.popup-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.popup-tags .tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 8px;
    background-color: var(--color-pink-100);
    color: var(--color-violet-950);
    letter-spacing: 0.075em;
    border: 1px solid rgba(47, 13, 104, 0.1);
}

.popup-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.2;
    color: var(--color-violet-950);
}

.popup-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-violet-950);
    opacity: 0.85;
}

.popup-text p {
    margin-bottom: 16px;
}

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

/* Prevent body scroll when popup is active */
body.popup-active {
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes popupSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .popup-modal {
        max-height: 95vh;
        border-radius: var(--radius-2xl);
    }

    .popup-image-wrapper {
        height: 250px;
        border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    }

    .popup-body {
        padding: 24px;
    }

    .popup-title {
        font-size: 1.75rem;
    }

    .popup-text {
        font-size: 1rem;
    }
}