/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1e293b;
    overflow: hidden;
    background: #f0f4ff;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-main {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f4ff 25%, #faf5ff 50%, #f0f9ff 75%, #eef2ff 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ===== DECORATIVE BLOBS ===== */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 179, 237, 0.4) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    animation: blobFloat1 20s ease-in-out infinite;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, transparent 70%);
    bottom: -200px;
    left: -150px;
    animation: blobFloat2 25s ease-in-out infinite;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blobFloat3 18s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes blobFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-40px, 30px) scale(1.1);
    }

    66% {
        transform: translate(20px, -20px) scale(0.95);
    }
}

@keyframes blobFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -40px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes blobFloat3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ===== DOT PATTERN OVERLAY ===== */
.dot-pattern {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(rgba(100, 116, 139, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ===== MAIN CONTENT ===== */
.page-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: 20px 24px 8px;
    flex-shrink: 0;
}

.header-icon {
    font-size: 2.2rem;
    display: inline-block;
    animation: bookBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.25));
}

@keyframes bookBounce {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-8px) rotate(-3deg);
    }

    75% {
        transform: translateY(-4px) rotate(3deg);
    }
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #db2777 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 6px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header .tagline {
    font-size: 0.85rem;
    font-weight: 400;
    color: #64748b;
    margin-top: 6px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.header-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
    border-radius: 3px;
    margin: 10px auto 0;
    opacity: 0.8;
}

/* ===== CARD GRID ===== */
.card-grid-wrapper {
    flex: 1;
    padding: 16px 24px 12px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    flex: 1;
    min-height: 0;
    grid-template-rows: 1fr 1fr;
}

/* ===== CARD ===== */
.card {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.45s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    transform: translateY(40px);
    animation: cardFadeIn 0.7s ease forwards;
    min-height: 0;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.card:nth-child(5) {
    animation-delay: 0.5s;
}

.card:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0), rgba(168, 85, 247, 0), rgba(236, 72, 153, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.45s ease;
    z-index: 3;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow:
        0 20px 50px rgba(99, 102, 241, 0.15),
        0 8px 20px rgba(168, 85, 247, 0.08),
        0 0 0 1px rgba(99, 102, 241, 0.12);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(99, 102, 241, 0.2);
}

.card:hover::before {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(168, 85, 247, 0.4), rgba(236, 72, 153, 0.4));
}

/* ===== CARD IMAGE ===== */
.card-image-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.card:hover .card-image-wrapper img {
    transform: scale(1.08);
}

.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ===== CARD CONTENT ===== */
.card-content {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.card-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.card-emoji {
    font-size: 1.1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.card:hover .card-emoji {
    animation: emojiPulse 0.6s ease-in-out;
}

@keyframes emojiPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.4;
}

.card-arrow {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    padding-top: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(99, 102, 241, 0.6);
    transition: all 0.35s ease;
}

.card-arrow svg {
    width: 14px;
    height: 14px;
    transition: transform 0.35s ease;
}

.card:hover .card-arrow {
    color: #6366f1;
}

.card:hover .card-arrow svg {
    transform: translateX(4px);
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 10px 24px 14px;
    border-top: 1px solid rgba(99, 102, 241, 0.08);
    flex-shrink: 0;
}

.footer p {
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.5;
}

.footer p span {
    background: linear-gradient(90deg, #6366f1, #a855f7);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

/* ===== FLOATING PARTICLES ===== */
.particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(99, 102, 241, 0.25);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-duration: 22s;
    animation-delay: 0s;
    width: 2px;
    height: 2px;
}

.particle:nth-child(2) {
    left: 25%;
    animation-duration: 28s;
    animation-delay: -5s;
    width: 3px;
    height: 3px;
    background: rgba(168, 85, 247, 0.2);
}

.particle:nth-child(3) {
    left: 40%;
    animation-duration: 20s;
    animation-delay: -3s;
    width: 2px;
    height: 2px;
}

.particle:nth-child(4) {
    left: 55%;
    animation-duration: 26s;
    animation-delay: -8s;
    width: 4px;
    height: 4px;
    background: rgba(236, 72, 153, 0.15);
}

.particle:nth-child(5) {
    left: 70%;
    animation-duration: 24s;
    animation-delay: -2s;
    width: 2px;
    height: 2px;
}

.particle:nth-child(6) {
    left: 85%;
    animation-duration: 30s;
    animation-delay: -6s;
    width: 3px;
    height: 3px;
    background: rgba(99, 102, 241, 0.18);
}

.particle:nth-child(7) {
    left: 15%;
    animation-duration: 27s;
    animation-delay: -10s;
    width: 2px;
    height: 2px;
    background: rgba(168, 85, 247, 0.15);
}

.particle:nth-child(8) {
    left: 60%;
    animation-duration: 23s;
    animation-delay: -4s;
    width: 3px;
    height: 3px;
}

.particle:nth-child(9) {
    left: 95%;
    animation-duration: 25s;
    animation-delay: -7s;
    width: 2px;
    height: 2px;
    background: rgba(236, 72, 153, 0.18);
}

.particle:nth-child(10) {
    left: 5%;
    animation-duration: 29s;
    animation-delay: -12s;
    width: 3px;
    height: 3px;
    background: rgba(99, 102, 241, 0.12);
}

@keyframes particleFloat {
    0% {
        transform: translateY(110vh) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-10vh) translateX(40px);
        opacity: 0;
    }
}

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 12px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header .tagline {
        font-size: 0.8rem;
    }

    .card-grid-wrapper {
        padding: 10px 16px 8px;
    }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 640px) {
    body {
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 10px;
    }

    .header {
        padding: 14px 16px 6px;
    }

    .header-icon {
        font-size: 1.6rem;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .header .tagline {
        font-size: 0.72rem;
        margin-top: 4px;
    }

    .header-divider {
        margin: 6px auto 0;
    }

    .card-grid-wrapper {
        padding: 8px 10px 6px;
    }

    .card {
        border-radius: 10px;
    }

    .card::before {
        border-radius: 10px;
    }

    .card-content {
        padding: 6px 10px 8px;
        gap: 2px;
    }

    .card-emoji {
        font-size: 0.9rem;
    }

    .card-title {
        font-size: 0.72rem;
    }

    .card-desc {
        display: none;
    }

    .card-arrow {
        font-size: 0.62rem;
        padding-top: 2px;
    }

    .card-arrow svg {
        width: 10px;
        height: 10px;
    }

    .footer {
        padding: 6px 16px 10px;
    }

    .footer p {
        font-size: 0.62rem;
    }

    .blob-1 {
        width: 200px;
        height: 200px;
    }

    .blob-2 {
        width: 250px;
        height: 250px;
    }

    .blob-3 {
        width: 150px;
        height: 150px;
    }
}

/* ===== ACCESSIBILITY ===== */
.card:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}