/* 전역 변수 설정 (다크 테마 색상표) */
:root {
    --bg-color: #0a0a0a;
    --text-main: #ededed;
    --text-muted: #a1a1aa;
    --card-bg: #171717;
    --card-border: #262626;
    --accent-start: #60a5fa;
    --accent-end: #a78bfa;
}

/* 전체 기본 설정 */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* 상단 투명 네비게이션 바 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    /* 뒤가 살짝 비치는 효과 */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
}

.nav-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

/* 메인 컨테이너 크기 제한 및 중앙 정렬 */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 10rem 2rem 4rem;
    /* 상단 여백을 많이 주어 모던한 느낌 연출 */
}

/* 첫 화면 타이틀 영역 (애니메이션 포함) */
/* 첫 화면 타이틀 영역 (애니메이션 포함) */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 8rem;
    animation: fadeIn 1.2s ease-out forwards;
    opacity: 0;
}

.hero-text {
    flex: 1;
    min-width: 300px;
}

.hero-image {
    flex-shrink: 0;
}

.hero-image img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--card-border);
    box-shadow: 0 0 30px rgba(96, 165, 250, 0.15);
    /* 은은한 조명 효과 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(167, 139, 250, 0.25);
    border-color: var(--accent-start);
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .hero-image img {
        width: 200px;
        height: 200px;
    }

    .hero-subtitle {
        margin: 0 auto;
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* 그라데이션 강조 텍스트 */
.highlight {
    background: linear-gradient(to right, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    font-weight: 400;
}

/* 섹션 공통 스타일 */
.section {
    margin-bottom: 6rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* 그리드 레이아웃 (카드 정렬) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* 카드 디자인 */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    /* 마우스 올렸을 때 살짝 떠오르는 효과 */
    border-color: #404040;
}

.card-content {
    padding: 2rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* 카드 내 정보 리스트 스타일 */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.info-list li:last-child {
    margin-bottom: 0;
}

.label {
    display: inline-block;
    min-width: 80px;
    font-weight: 600;
    color: var(--text-main);
}

.date {
    display: inline-block;
    min-width: 140px;
    color: var(--accent-start);
    font-weight: 500;
}

.sub-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.2rem 0 0 0;
}

/* 기술 스택 뱃지 디자인 */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Skills Visualization */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.skill-name {
    color: var(--text-main);
}

.skill-score {
    color: var(--accent-start);
    font-family: monospace;
    font-size: 0.85rem;
}

.skill-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background-color: var(--bg-color);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.skill-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    /* 그라데이션 대신 단색에 가까운 강조색 사용 시 깔끔함 */
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    border-radius: 6px;
    transition: width 1s ease-out;
}

/* 10칸 시각화를 위한 그리드 오버레이 */
.skill-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    pointer-events: none;
}

.skill-grid div {
    border-right: 1px solid var(--card-bg);
}

.skill-grid div:last-child {
    border-right: none;
}

/* 프로젝트 상세 페이지 스타일 */
.project-detail-container {
    padding-top: 8rem;
    max-width: 800px;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-start);
}

.detail-header {
    margin-bottom: 3rem;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.detail-hero-image {
    width: 100%;
    margin-bottom: 4rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.detail-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-body-image {
    width: 100%;
    margin: 3rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.detail-body-image img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-body-video {
    width: 100%;
    margin: 3rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: #000;
}

.detail-body-video video {
    width: 100%;
    max-height: 70vh;
    height: auto;
    display: block;
    object-fit: contain;
}

.detail-content h3 {
    font-size: 1.5rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.detail-content p,
.detail-content ul {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.05rem;
}

.detail-content ul {
    padding-left: 1.5rem;
}

.detail-content li {
    margin-bottom: 0.5rem;
}

/* 뱃지 색상 미세 조정 */
.badge {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    /* 알약 모양 */
    font-size: 0.8rem;
    border: 1px solid var(--card-border);
    font-weight: 500;
}

/* 내 소개 카드 안의 텍스트 설정 */
.about-card p {
    color: var(--text-muted);
    line-height: 1.8;
    margin: 0;
}

/* 하단 푸터 */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    font-size: 0.9rem;
}

/* 등장 애니메이션 키프레임 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 웹 에디터(CKEditor) 본문 내 이미지 반응형 처리 */
.content-text figure.image {
    margin: 3rem 0;
    max-width: 100%;
    text-align: center;
}

.content-text figure.image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

/* 캡션 글씨 스타일 */
.content-text figure.image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =======================================================
   CKEditor 5 본문 정렬(Alignment) 및 스타일 대응 CSS
======================================================= */

/* 1. 텍스트 정렬 (!important를 추가하여 확실하게 적용되도록 함) */
.content-text .text-align-left {
    text-align: left !important;
}

.content-text .text-align-center {
    text-align: center !important;
}

.content-text .text-align-right {
    text-align: right !important;
}

.content-text .text-align-justify {
    text-align: justify !important;
}

/* 2. 이미지 중앙 정렬 (기본값) */
.content-text figure.image {
    margin: 3rem auto;
    display: table;
    text-align: center;
}

.content-text figure.image.image-style-align-center,
.content-text figure.image.image-style-block-align-center {
    margin: 3rem auto;
    display: table;
}

/* 3. 이미지 좌측 정렬 */
.content-text figure.image.image-style-align-left,
.content-text figure.image.image-style-block-align-left {
    float: left;
    margin: 1rem 2rem 1rem 0;
    max-width: 50%;
}

/* 4. 이미지 우측 정렬 (side 스타일 포함) - 이 부분이 수정되었습니다! */
.content-text figure.image.image-style-align-right,
.content-text figure.image.image-style-block-align-right,
.content-text figure.image.image-style-side {
    float: right;
    margin: 1rem 0 1rem 2rem;
    max-width: 50%;
}

/* 5. Float(좌우 정렬) 요소가 부모 영역을 벗어나지 않도록 해제(Clear) */
.content-text::after {
    content: "";
    display: table;
    clear: both;
}