:root {
    --bg-start: #D6C1B0;
    --bg-end: #CDB8A7;
    --card-bg: rgba(255, 255, 255, 0.92);
    --panel-bg: rgba(10, 15, 30, 0.9);
    --accent: #7b68ee;
    --accent-dark: #5d4bc7;
    --text: #1f1f1f;
    --muted: #5c5c5c;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(to bottom, var(--bg-start), var(--bg-end));
    font-family: 'Pretendard', sans-serif;
    color: var(--text);
    overflow-x: hidden;
}

#particle-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    bottom: -24px;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-110vh) translateX(40px);
        opacity: 0;
    }
}

.bg-image {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    min-height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.35;
    pointer-events: none;
}

.wrapper {
    width: min(94%, 1080px);
    margin: 0 auto;
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

.contact-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 1.3rem;
    color: var(--muted);
}

.header-box {
    background: rgba(10, 15, 30, 0.9);
    color: white;
    padding: 40px;
    border-radius: 20px;
    display: flex;
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-start;
    gap: 40px; 
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 40px;
}

.profile-img-placeholder {
    flex: 0 0 40%; 
    max-width: 350px; 
    height: 300px; 
    background: var(--accent);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    overflow: hidden; 
    padding: 0; 
}

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

.text-area {
    width: 100%; 
}

.text-area h1 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.text-area p {
    margin: 0;
    max-width: 720px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.92);
}

.divider {
    width: 100%;
    height: 3px;
    margin: 40px 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
}

.section-title {
    margin: 0 0 24px;
    font-size: clamp(2rem, 3vw, 3rem);
    color: rgb(0, 0, 0);
    text-align: center;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    width: 100%;
    margin-bottom: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 220px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14);
}

.card h3 {
    margin: 0;
    font-size: 1.2rem;
}

.card p {
    margin: 0;
    line-height: 1.7;
    color: var(--muted);
}

.btn-image-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    position: relative;
}

.hover-btn {
    color: black;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.25s ease, transform 0.25s ease;
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.92);
    font-weight: normal;
}

.hover-btn:hover {
    transform: translateY(-1px);
}

.hover-btn:active {
    transform: translateY(0);
}

.image-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 8px;
    width: 300px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    margin-bottom: 8px;
    z-index: 100;
}

.btn-image-wrapper:hover .image-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.image-popup img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* --- 모달 영역 --- */
.modal-toggle { display: none; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; justify-content: center; align-items: center; }
.modal-toggle:checked + label + .modal { display: flex; }
.modal-body { position: relative; max-width: 80%; }
.modal-body img { width: 100%; border-radius: 10px; }
.overlay { position: fixed; top:0; left:0; width:100%; height:100%; }



.experience-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    gap: 32px;
    margin-bottom: 80px;
}

.experience-box .section-title {
    width: 100%; 
    margin-bottom: 10px;
}

.experience-item.flip-container {
    flex: 1 1 380px; 
    max-width: 500px;
    perspective: 1000px; 
    background: transparent;
    min-height: 380px; 
}

.flip-inner {
    display: grid; 
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d; 
    height: 100%; 
}

.flip-container:hover .flip-inner {
    transform: rotateY(180deg);
}

.flip-front, .flip-back {
    grid-area: 1 / 1; 
    backface-visibility: hidden; 
    background: var(--card-bg); 
    border-radius: 16px;
    padding: 30px 24px; 
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.flip-front {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px; 
}

.flip-front h3, .flip-back h3 {
    margin: 0;
    color: rgb(0, 0, 0);
    font-size: 25px;
}

.flip-back {
    transform: rotateY(180deg);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    justify-content: center; 
    gap: 15px;
}

.flip-back p {
    margin: 0;
    color: rgba(0, 0, 0, 0.9);
    line-height: 1.8;
}

.experience-item h3 { margin: 0; }
.sub-text { margin: 0; color: var(--muted); font-size: 0.95rem; }
.experience-box p { margin: 0; line-height: 1.75; color: #333; }

/* --- Interest & 룰렛 영역 --- */
.interest-box {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
}

.tags { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(123, 104, 238, 0.14);
    color: #4f369d;
    font-size: 0.95rem;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    cursor: default;
}

.tag:hover {
    background: rgba(123, 104, 238, 0.24);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 54, 157, 0.12);
}

.roulette-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0;
    position: relative;
}

.pointer {
    position: absolute;
    top: 50%;
    left: 50%; 
    right: auto; 
    transform: translate(260px, -50%); 
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: none;
    border-right: 30px solid #ff4757;
    z-index: 10;
}

.wheel {
    width: 500px;
    height: 500px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: conic-gradient(
        from 45deg,
        #D6C1B0 0deg 90deg,   
        #CDB8A7 90deg 180deg, 
        #E8DCC4 180deg 270deg,
        #B5A397 270deg 360deg 
    );
    border: 5px solid rgb(0, 0, 0);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 4s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.wheel::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 24px; height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.text-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 40px;
    margin-top: -20px;
    transform-origin: left center;
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    padding-right: 25px; 
    box-sizing: border-box;
    color: #333;
    font-weight: bold;
    font-size: 1.55rem;
}

.text-item span { display: block; }
.t1 { transform: rotate(0deg); }   
.t1 span { transform: rotate(90deg); } 
.t2 { transform: rotate(90deg); }  
.t2 span { transform: rotate(90deg); } 
.t3 { transform: rotate(180deg); } 
.t3 span { transform: rotate(90deg); } 
.t4 { transform: rotate(270deg); } 
.t4 span { transform: rotate(90deg); }

.spin-btn {
    margin-top: 30px;
    font-size: 1.1rem;
    padding: 12px 24px;
}

/* =========================================
   미디어 쿼리 (반응형 설정)
========================================= */
@media (min-width: 768px) {
    .header-box { text-align: start; }
    .profile-img-placeholder {
        flex: auto;
        width: 100%;
        max-width: 100%;
        height: 250px;
    }
}

@media (max-width: 920px) {
    .header-box {
        flex-direction: column;
        text-align: center;
        padding: 32px;
    }
    .profile-img-placeholder { width: 160px; height: 160px; }
}

@media (max-width: 680px) {
    .wrapper { padding: 24px 0; }
    .contact-bar {
        justify-content: center;
        gap: 12px;
        font-size: 0.88rem;
    }
    .experience-box, .card { padding: 28px; }
}

@media (max-width: 520px) {
    .section-title { font-size: 2.2rem; }
}

/* 👇 모바일 화면 통합 정리 (플립카드 + 룰렛) */
@media (max-width: 768px) {
    /* 1. 룰렛 반응형 */
    .wheel {
        width: 220px;
        height: 220px;
    }
    .text-item {
        font-size: 0.85rem;
        padding-right: 15px; 
    }
    .pointer {
        transform: translate(115px, -50%); 
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-right: 20px solid #ff4757;
    }

    /* 2. 플립 카드 (Work Experience) 반응형 */
    .experience-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0 10px;
    }
    .experience-item.flip-container {
        width: 100%;
        max-width: 340px; /* 폰 화면에 꽉 차게 예쁘게 정렬 */
        margin: 0 auto;
    }
}