/*  PATCH: 나스 연동 프로젝트 공통 스타일 */

:root {
    --jarvis-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", sans-serif;
    --color-bg: #050816;
    --color-card: #ffffff;
    --color-text-main: #111827;
    --color-text-sub: #6b7280;
    --radius-xl: 24px;
    --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.25);
}

/* 공통 레이아웃 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--jarvis-font);
    background: #020617;
    color: #f9fafb;
}

/* 페이지 래퍼 */
.jarvis-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 55%),
                radial-gradient(circle at bottom, rgba(94, 234, 212, 0.16), transparent 55%),
                #020617;
}

/* 각 테마별 배경 그라디언트 */
.theme-1 {
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.22), transparent 55%),
                radial-gradient(circle at bottom, rgba(56, 189, 248, 0.18), transparent 55%),
                #020617;
}
.theme-2 {
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.8), transparent 55%),
                radial-gradient(circle at bottom, rgba(248, 250, 252, 0.06), transparent 55%),
                #020617;
}
.theme-3 {
    background: radial-gradient(circle at top, rgba(248, 250, 252, 0.8), transparent 60%),
                radial-gradient(circle at bottom, rgba(148, 163, 184, 0.4), transparent 55%),
                #e5e7eb;
    color: #111827;
}
.theme-4 {
    background: radial-gradient(circle at top, rgba(96, 165, 250, 0.3), transparent 60%),
                radial-gradient(circle at bottom, rgba(15, 23, 42, 0.9), transparent 55%),
                #020617;
}
.theme-5 {
    background: radial-gradient(circle at top, rgba(244, 114, 182, 0.35), transparent 60%),
                radial-gradient(circle at bottom, rgba(56, 189, 248, 0.25), transparent 55%),
                #020617;
}
.theme-6 {
    background: radial-gradient(circle at top, rgba(52, 211, 153, 0.32), transparent 60%),
                radial-gradient(circle at bottom, rgba(59, 130, 246, 0.24), transparent 55%),
                #020617;
}

/* 헤더 */
.jarvis-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.jarvis-header-inner {
    max-width: 960px;
    width: 100%;
}

.jarvis-title {
    font-size: clamp(26px, 4vw, 34px);
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.jarvis-subtitle {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.85;
}

/* 메인 콘텐츠 (백그라운드 영역) */
.jarvis-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px 32px 16px;
}

/* 푸터 */
.jarvis-footer {
    padding: 12px 16px 20px 16px;
    text-align: center;
    font-size: 12px;
    opacity: 0.8;
}

/* 도메인 네비게이션 */
.domain-nav {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.domain-chip {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.theme-3 .domain-chip {
    background: rgba(255, 255, 255, 0.8);
    color: #111827;
}

.domain-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
}

.domain-chip.is-active {
    background: linear-gradient(135deg, #6366f1, #22c55e);
    border-color: transparent;
    color: #ffffff;
}

/* 모달 공통 */
.jarvis-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 40;
}

.jarvis-modal.is-active {
    pointer-events: auto;
    opacity: 1;
}

.jarvis-modal-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(129, 140, 248, 0.32), transparent 65%),
                rgba(15, 23, 42, 0.86);
    backdrop-filter: blur(10px);
}

.jarvis-modal-dialog {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 860px;
    background: var(--color-card);
    color: var(--color-text-main);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 20px 20px 22px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.25fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .jarvis-modal-dialog {
        grid-template-columns: 1fr;
        padding: 18px 18px 20px 18px;
        border-radius: 20px;
    }
}

/* 모달 좌측 – 이미지 영역 */
.modal-media {
    border-radius: 18px;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 65%),
                #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    position: relative;
    overflow: visible; /*  PATCH: 뱃지 잘림 방지 */
    z-index: 2;        /*  PATCH: 이미지보다 위 레이어 */
}

.modal-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    z-index: 10; /*  PATCH: 뱃지가 이미지보다 항상 최상단 */
}

.modal-image-frame {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.45);
    background: #020617;
}

.modal-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 모달 우측 – 텍스트 영역 */
.modal-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.modal-title {
    font-size: 22px;
    margin: 4px 0 8px 0;
    font-weight: 700;
}

.modal-domain-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
}

.modal-desc {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-sub);
}

/* 모달 CTA 영역 */
.modal-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.btn-primary,
.btn-ghost {
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #22c55e);
    color: #ffffff;
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.45);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(79, 70, 229, 0.55);
}

.btn-ghost {
    background: rgba(148, 163, 184, 0.12);
    color: #4b5563;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.2);
}

/* 닫기 버튼 */
.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.08);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
}

.modal-close:hover {
    background: rgba(15, 23, 42, 0.16);
    transform: translateY(-1px);
}

.modal-close span {
    display: block;
    font-size: 18px;
    line-height: 1;
}

/* 테마별 미세 튜닝 */
.theme-3 .jarvis-modal-dialog {
    background: #f9fafb;
}
.theme-3 .modal-media {
    background: radial-gradient(circle at top, rgba(148, 163, 184, 0.25), transparent 65%),
                #020617;
}
.theme-3 .modal-desc {
    color: #4b5563;
}
