@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+KR:wght@400;700&family=Noto+Sans+JP:wght@400;700&display=swap');

:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --hover-glow: 0 0 20px rgba(168, 85, 247, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Lang specific font overrides */
html[lang="ja"] body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    margin-bottom: 4rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}


.lang-switch {
    display: flex;
    align-items: center;
}

.lang-switch a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-switch a::before {
    content: '';
    display: block;
    width: 20px;
    height: 15px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}

.lang-switch a:first-child::before {
    background-image: url('../assets/flags/kr.svg');
}

.lang-switch a:nth-child(2)::before {
    background-image: url('../assets/flags/us.svg');
}

.lang-switch a:nth-child(3)::before {
    background-image: url('../assets/flags/jp.svg');
}

/* Override with href-based selectors for reliability */
.lang-switch a[href*="/ko/"]::before,
.lang-switch a[href*="ko/"]::before {
    background-image: url('../assets/flags/kr.svg');
}

.lang-switch a[href*="/en/"]::before,
.lang-switch a[href*="en/"]::before {
    background-image: url('../assets/flags/us.svg');
}

.lang-switch a[href*="/ja/"]::before,
.lang-switch a[href*="ja/"]::before {
    background-image: url('../assets/flags/jp.svg');
}

.lang-switch a.active,
.lang-switch a:hover {
    color: #fff;
}

.hero {
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
    padding: 4rem 2rem;
}

/* Background spotlight effect */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center,
            rgba(99, 102, 241, 0.15) 0%,
            rgba(168, 85, 247, 0.08) 30%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    background: linear-gradient(135deg, #e0e7ff 0%, #a78bfa 40%, #7c3aed 70%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

.hero p {
    font-size: 1.15rem;
    color: #94a3b8;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out 0.3s forwards;
    opacity: 0;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: 4rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    height: 300px;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-10px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: var(--hover-glow);
}

.card-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent);
    z-index: 0;
    transition: transform 0.4s;
}

.card:hover .card-img-placeholder {
    transform: scale(1.1);
}

.card h2 {
    font-size: 1.8rem;
    z-index: 1;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.card span {
    z-index: 1;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-desc {
    z-index: 1;
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Category Specific Background Images */
.card[data-cat="science"] .card-img-placeholder {
    background-image: url('../assets/images/science.jpg');
    background-size: cover;
    background-position: center;
}

.card[data-cat="math"] .card-img-placeholder {
    background-image: url('../assets/images/math.jpg');
    background-size: cover;
    background-position: center;
}

.card[data-cat="philosophy"] .card-img-placeholder {
    background-image: url('../assets/images/philosophy.jpg');
    background-size: cover;
    background-position: center;
}

.card[data-cat="psychology"] .card-img-placeholder {
    background-image: url('../assets/images/psychology.jpg');
    background-size: cover;
    background-position: center;
}

.card[data-cat="history"] .card-img-placeholder {
    background-image: url('../assets/images/history.jpg');
    background-size: cover;
    background-position: center;
}

.card[data-cat="religion"] .card-img-placeholder {
    background-image: url('../assets/images/religion.jpg');
    background-size: cover;
    background-position: center;
}

/* Overlay gradient for text readability */
.card-img-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(15, 23, 42, 0.8) 100%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Footer Styles */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copyright {
    color: #64748b;
    font-size: 0.8rem;
}

/* Legal Page Styles */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.legal-container h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.legal-container h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: #e2e8f0;
}

.legal-container p,
.legal-container li {
    color: #94a3b8;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-container ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-container a {
    color: #a855f7;
    text-decoration: none;
}

.legal-container a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: #fff;
}