@import url('https://fonts.cdnfonts.com/css/cascadia-code');

:root {
    color-scheme: dark;
    --bg-start: #1c0b2b;
    --bg-mid: #341338;
    --bg-end: #4a1527;
    --glow-amber: rgba(255, 190, 120, 0.35);
    --glow-rose: rgba(255, 125, 144, 0.38);
    --glow-violet: rgba(193, 128, 255, 0.24);
    --card-bg: rgba(70, 40, 63, 0.62);
    --card-border: rgba(255, 210, 170, 0.34);
    --accent: #ffb86b;
    --accent-hover: #ffd194;
    --text-base: #fff4e6;
    --text-muted: rgba(255, 225, 201, 0.78);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cascadia Mono', 'Cascadia Code', 'Consolas', monospace;
    position: relative;
    background:
        radial-gradient(circle at 25% -10%, rgba(255, 149, 128, 0.32) 0%, transparent 55%),
        radial-gradient(circle at 85% 0%, rgba(246, 78, 120, 0.25) 0%, transparent 50%),
        linear-gradient(160deg, var(--bg-start) 10%, var(--bg-mid) 55%, var(--bg-end) 100%);
    color: var(--text-base);
    overflow: hidden;
}

#particle-canvas,
body::before,
body::after {
    pointer-events: none;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: 0;
}

body::before {
    background:
        radial-gradient(circle at 20% 40%, var(--glow-rose) 0%, transparent 55%),
        radial-gradient(circle at 65% 20%, var(--glow-amber) 0%, transparent 60%);
    filter: blur(120px);
    opacity: 0.85;
}

body::after {
    background:
        radial-gradient(circle at 50% 75%, var(--glow-violet) 0%, transparent 60%),
        radial-gradient(circle at 85% 80%, rgba(255, 180, 110, 0.18) 0%, transparent 65%);
    filter: blur(140px);
    opacity: 0.75;
}

#particle-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

.card-shell {
    position: relative;
    z-index: 2;
    width: min(1040px, calc(100vw - 1.5rem));
    display: flex;
    justify-content: center;
}

.card-stage {
    position: relative;
    width: min(980px, 100%);
    min-height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
    --card-shift: 120px;
    --avatar-shift: 120px;
}

.card-stage.is-compact {
    flex-direction: column;
    width: min(600px, 100%);
    min-height: auto;
    gap: 0;
}

.card-stage .card {
    transform: translateX(0);
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card-stage.is-flipped .card {
    transform: translateX(var(--card-shift));
}

.card-stage.is-compact .card {
    transform: translateX(0) !important;
}

.card-stage.is-compact .card-inner {
    min-height: clamp(380px, 78vh, 520px);
}

.card {
    position: relative;
    width: clamp(320px, 70vw, 520px);
    perspective: 1400px;
    cursor: pointer;
    border-radius: 22px;
    pointer-events: auto;
    z-index: 2;
}

.card-inner {
    position: relative;
    width: 100%;
    min-height: 360px;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

.card-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    border-radius: 22px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 204, 158, 0.26);
    box-shadow: 0 25px 60px rgba(20, 9, 36, 0.5);
    backdrop-filter: blur(24px);
    backface-visibility: hidden;
    isolation: isolate;
    transition: opacity 0.32s ease;
    opacity: 1;
    pointer-events: auto;
}

.card-face::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(82, 44, 71, 0.42), rgba(40, 18, 33, 0.46));
    box-shadow: inset 0 0 0 1px rgba(255, 220, 190, 0.04);
    backdrop-filter: blur(26px);
    z-index: -1;
    pointer-events: none;
}

.card:not(.is-flipped) .card-back {
    opacity: 0;
    pointer-events: none;
}

.card.is-flipped .card-front {
    opacity: 0;
    pointer-events: none;
}

.card-front {
    text-align: center;
    gap: 1.5rem;
}

.card-front h1 {
    margin: 0 0 1rem;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 2.4rem);
}

.card-front p {
    margin: 0 0 2rem;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 240, 225, 0.9);
}

.card-back {
    transform: rotateY(180deg);
    align-items: center;
    text-align: left;
}

.site-header {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 4;
    display: flex;
    align-items: center;
}

@media (max-width: 600px) {
    .site-header {
        top: 1rem;
        left: 1rem;
    }
}

.card-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.05rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 198, 141, 0.45);
    background: rgba(255, 244, 230, 0.12);
    color: rgba(255, 238, 220, 0.9);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(20, 9, 36, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin: 0;
}

.profile-avatar {
    display: block;
    width: var(--avatar-size, 200px);
    height: var(--avatar-size, 200px);
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 15px 40px rgba(20, 9, 36, 0.55);
    border: 1px solid rgba(255, 220, 200, 0.4);
}

.profile-avatar-floating {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition:
        transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
        opacity 0.35s ease;
    transition-delay: 0s, 0.24s;
    pointer-events: none;
    z-index: 1;
}
.card-stage.is-flipped .profile-avatar-floating {
    opacity: 1;
    transform: translate(calc(-50% - var(--avatar-shift)), -50%) scale(1);
    transition-delay: 0s, 0s;
}

.card-stage.is-compact .profile-avatar-floating {
    display: none !important;
}


.profile-readme {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    max-width: 100%;
}

.readme-content {
    flex: 1;
    max-height: min(48vh, 360px);
    padding-right: 0.75rem;
    overflow: auto;
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 240, 225, 0.9);
}

.readme-content h1,
.readme-content h2,
.readme-content h3 {
    font-weight: 600;
    color: rgba(255, 244, 230, 0.95);
    line-height: 1.2;
    margin: 0 0 1rem;
}

.readme-content h1 {
    font-size: clamp(2rem, 5vw, 2.4rem);
}

.readme-content h2 {
    font-size: clamp(1.6rem, 3.8vw, 2rem);
}

.readme-content h3 {
    font-size: clamp(1.3rem, 3.2vw, 1.65rem);
}

.readme-content p,
.readme-content li {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 0.9rem;
}

.readme-content ul,
.readme-content ol {
    padding-left: 1.2rem;
    margin: 0 0 1.1rem;
}

.readme-content a {
    color: #ffe3a4;
}

.readme-content::-webkit-scrollbar {
    width: 0.45rem;
}

.readme-content::-webkit-scrollbar-thumb {
    background: rgba(255, 206, 148, 0.45);
    border-radius: 999px;
}

.readme-content pre,
.readme-content code {
    font-family: 'Cascadia Mono', 'Cascadia Code', 'Consolas', monospace;
}

@media (max-width: 720px) {
    .card-inner {
        min-height: 440px;
    }

    .card-face {
        padding: 2.5rem 2.25rem;
    }

    .readme-content {
        width: 100%;
        max-height: 320px;
        padding-right: 0;
        text-align: left;
    }
}


.skills {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #160609;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(20, 9, 36, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
}

.skill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.skill-icon i {
    font-size: 1.2rem;
}

.skill-label {
    line-height: 1;
    white-space: nowrap;
}

.skill-ts {
    color: #f4f7ff;
    background: linear-gradient(135deg, rgba(49, 120, 198, 0.92), rgba(109, 162, 235, 0.88));
    border-color: rgba(88, 146, 215, 0.7);
}

.skill-python {
    color: #302314;
    background: linear-gradient(135deg, rgba(255, 212, 59, 0.9), rgba(75, 139, 190, 0.9));
    border-color: rgba(238, 195, 73, 0.65);
}

.skill-sql {
    color: #331209;
    background: linear-gradient(135deg, rgba(242, 145, 17, 0.92), rgba(255, 181, 101, 0.85));
    border-color: rgba(245, 168, 74, 0.6);
}


.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem 1.9rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    color: #3a1a08;
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(255, 220, 200, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-icon i {
    font-size: 1.1rem;
}

.cta-label {
    line-height: 1;
}

.cta:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 45px rgba(255, 220, 200, 0.5);
}

.cta:focus-visible {
    outline: 2px solid rgba(255, 220, 180, 0.8);
    outline-offset: 3px;
}


.card:focus-visible {
    outline: 2px solid rgba(255, 220, 200, 0.7);
    outline-offset: 6px;
}

.card.is-flipped .card-hint {
    opacity: 0;
}
