:root {
    --bg-color: #0d0d0f;
    /* Deep Onyx */
    --card-bg: rgba(30, 30, 35, 0.78);
    /* Lighter and more opaque card bg */
    --card-border: rgba(255, 255, 255, 0.15);
    /* Brighter border for clear edges */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-1: #6366f1;
    /* Indigo-ish accent for a premium feel */
    --accent-2: #a855f7;
    --btn-primary: #ffffff;
    --btn-secondary: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Simple dark background */
.background-elements {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-color);
}

.blob {
    display: none;
}

@keyframes float {
    /* Kept for potential future use or removed if not needed */
}

/* Flip Card Container */
.flip-card {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 420px;
    height: 600px;
    perspective: 1500px;
    margin: auto;
    /* Entrance Animation Initial State */
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    /* Start lower */
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
}

.entrance-ready .flip-card {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    /* Slide up to final position */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* Flip Trigger Button */
.flip-trigger {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease, opacity 0.2s ease;
}

.flip-trigger:hover {
    color: white;
    transform: rotate(180deg);
}

.flip-trigger.is-skipping:hover {
    transform: none !important;
}

/* Hide button during flip and stop rotation */
.is-flipping .flip-trigger {
    opacity: 0;
    pointer-events: none;
    transform: none !important;
}

/* Profile Card - Glassmorphism Restructure */
.profile-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 8px 15px -5px rgba(0, 0, 0, 0.5);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.profile-front {
    transform: rotateY(0deg);
}

.profile-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    /* Fixed at the top */
    padding: 4rem 2.5rem;
    /* Increased top padding */
}

/* Avatar */
.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--card-bg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-container:hover .avatar {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Typography */
.name {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.title {
    font-size: 0.95rem;
    color: var(--accent-1);
    font-weight: 600;
    /* Made slightly bolder for better matching */
    margin-bottom: 1.25rem;
    letter-spacing: 0.5px;
}

.bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.highlight {
    display: inline;
    font-weight: 600;
    /* Using a singleIndigo-based color for uniformity */
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0.3) 100%);
    background-repeat: no-repeat;
    background-size: 0% 100%;
    background-position: 0 88%;
    transition: background-size 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    color: var(--text-primary);
    border-radius: 4px;
}

.highlight.active {
    background-size: 100% 100%;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--btn-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-1);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn {
    position: relative;
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    overflow: hidden;
    outline: none;
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #ffffff;
    color: #0d0d0f;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: #f1f5f9;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--btn-secondary);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Ripple Effect */
.ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Back Content Styles */
.back-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    height: 100%;
    width: 100%;
    position: relative;
    padding: 2rem 0.5rem 1rem;
    /* Reduced top, added small bottom padding */
    /* Pushed to the absolute left */
}

/* Eat, Play, Code Text */
.back-text-group {
    margin-top: 0.5rem;
    font-size: 4.8rem;
    /* Slightly larger */
    font-weight: 900;
    line-height: 1.05;
    text-align: left;
    color: #fff;
    font-family: 'Noto Sans KR', sans-serif;
    width: 100%;
}

.back-line {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    min-height: 5.2rem;
}

.back-line.show {
    opacity: 1;
    transform: translateY(0);
}

.back-line.color-code {
    color: var(--accent-1);
}

/* Greeting Text Area */
.greeting-container {
    margin-top: auto;
    margin-bottom: 0.5rem;
    align-self: flex-end;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-family: 'Noto Sans KR', sans-serif;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.greeting-container.show {
    opacity: 1;
}

/* Moved & Scaled Signature */
.signature-container {
    width: 45%;
    max-width: 150px;
    margin-top: 0;
    /* removed auto since greeting handles the push */
    margin-bottom: 0.5rem;
    /* Moved slightly further down */
    align-self: flex-end;
    /* Align to bottom right */
    opacity: 0;
    transition: opacity 0.8s ease-in;
    z-index: 5;
}

.signature-container.show {
    opacity: 1;
}

.cls-1 {
    fill: none;
    stroke: #ffffff;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5px;
    visibility: hidden;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Responsive */
.footer {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

@media (min-width: 480px) {
    .action-buttons {
        flex-direction: row;
    }

    .btn {
        flex: initial;
        min-width: 200px;
        margin: 0 auto;
    }
}

@media (max-width: 350px) {
    .profile-card {
        padding: 2rem 1.5rem;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-link {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}