:root {
    /* --- DEFAULT DARK THEME VARIABLES --- */
    --primary: #209a80;
    --card-bg: rgba(10, 10, 18, 0.85);
    --card-border: rgba(32, 154, 128, 0.5);
    --bg-gradient: linear-gradient(to bottom, #1a0b2e 0%, #000000 100%);

    --btn-bg: #ffffff;
    --btn-text: #1a1a1a;
    --btn-sub: #a0a0a0;

    --text-main: #ffffff;
    --text-desc: #a0a0a0;

    --settings-bg: rgba(20, 20, 30, 0.95);
    --settings-text: #fff;
    --settings-opt: #888;
    --settings-btn-bg: #333;
}

/* --- LIGHT THEME OVERRIDES --- */
body.light-mode {
    --primary: #157a65;
    /* Slightly darker teal for contrast on white */
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(32, 154, 128, 0.3);
    --bg-gradient: linear-gradient(to bottom, #e0f7fa 0%, #ffffff 100%);

    --btn-bg: #f3f4f6;
    --btn-text: #1a1a1a;
    --btn-sub: #666666;

    --text-main: #1a1a1a;
    --text-desc: #555555;

    --settings-bg: rgba(255, 255, 255, 0.95);
    --settings-text: #1a1a1a;
    --settings-opt: #666;
    --settings-btn-bg: #e0e0e0;
}

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

body {
    background-color: #050505;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    perspective: 1200px;
    transition: color 0.3s ease;
}

.kh-font {
    font-family: 'Kantumruy Pro', sans-serif;
}

/* --- BACKGROUND CANVAS --- */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-gradient);
    transition: background 0.5s ease;
}

/* --- MAIN CARD --- */
.card {
    background-color: var(--card-bg);
    /* Grid Pattern - Dynamic based on theme opacity */
    background-image:
        linear-gradient(rgba(128, 128, 128, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 128, 128, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    box-shadow: 0 0 25px rgba(32, 154, 128, 0.2), inset 0 0 20px rgba(32, 154, 128, 0.05);
    width: 90%;
    max-width: 440px;
    padding: 3.5rem 2rem;
    border-radius: 40px;
    text-align: center;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(0);
    opacity: 0;
    animation: floatUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, gridScroll 20s linear infinite;
    margin-bottom: 2rem;
    transition: background-color 0.3s, border-color 0.3s;
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gridScroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 30px 30px;
    }
}

/* --- SETTINGS BUTTON --- */
.settings-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 35px;
    height: 35px;
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: 0.3s;
    backdrop-filter: blur(5px);
    color: var(--text-main);
    transform: translateZ(40px);
}

.settings-btn:hover {
    background: rgba(128, 128, 128, 0.25);
    transform: translateZ(40px) rotate(90deg);
}

.settings-menu {
    position: absolute;
    top: 70px;
    right: 25px;
    background: var(--settings-bg);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 15px;
    padding: 15px;
    width: 170px;
    display: none;
    z-index: 60;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateZ(50px);
    color: var(--settings-text);
}

.settings-menu.active {
    display: block;
    animation: fadeDown 0.3s ease;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateZ(50px) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateZ(50px) translateY(0);
    }
}

.opt-label {
    font-size: 0.75rem;
    color: var(--settings-opt);
    margin-bottom: 8px;
    text-transform: uppercase;
    margin-top: 10px;
}

.opt-label:first-child {
    margin-top: 0;
}

.opt-row {
    display: flex;
    gap: 5px;
}

.opt-btn {
    flex: 1;
    padding: 6px;
    font-size: 0.85rem;
    text-align: center;
    background: var(--settings-btn-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--settings-text);
}

.opt-btn:hover {
    opacity: 0.8;
}

.opt-btn.active {
    background: var(--primary);
    color: white;
}

/* --- PROFILE --- */
.profile-box {
    width: 110px;
    height: 110px;
    margin: 0 auto 1.5rem;
    position: relative;
    transform: translateZ(30px);
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    padding: 4px;
    background: transparent;
}

/* --- TEXT --- */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    transform: translateZ(20px);
    color: var(--text-main);
}

.subtitle {
    color: var(--primary);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 600;
    transform: translateZ(20px);
}

.desc {
    color: var(--text-desc);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 0 10px;
    transform: translateZ(20px);
}

/* --- CONTACT PILL --- */
.contact-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(32, 154, 128, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    transform: translateZ(25px);
    cursor: pointer;
}

.contact-pill:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px rgba(32, 154, 128, 0.5);
    transform: translateZ(35px) scale(1.05);
}

/* --- LINKS --- */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateZ(40px);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.btn-left {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

/* Button Text Layout */
.btn-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.btn-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.btn-sub {
    font-size: 0.75rem;
    color: var(--btn-sub);
    font-weight: 400;
}

.btn-icon {
    width: 24px;
    font-size: 1.5rem;
    text-align: center;
    display: flex;
    justify-content: center;
}

.btn-arrow {
    color: #ccc;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn:hover .btn-arrow {
    color: var(--btn-text);
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .card {
        max-width: 420px;
    }
}

@media (max-width: 480px) {
    body {
        perspective: none;
        padding: 1rem 0;
    }

    .card {
        transform: none !important;
        width: 95%;
        max-width: none;
        border-radius: 35px;
        padding: 2.5rem 1.5rem;
        margin-top: 0.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .desc {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .contact-pill {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 12px 18px;
    }
}