@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   RESET & SYSTEM VARIABLE SETUP (MOBILE FIRST)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette - Dark Mode (Default) */
    --bg-primary: #021210;
    --bg-secondary: #051f1c;
    --bg-ambient-1: rgba(11, 93, 86, 0.45);
    --bg-ambient-2: rgba(20, 184, 166, 0.25);
    
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-bg: rgba(255, 255, 255, 0.09);
    --card-hover-border: rgba(20, 184, 166, 0.4);
    --card-shadow: rgba(0, 0, 0, 0.4);
    
    --text-primary: #f2fbf9;
    --text-secondary: #a3e2d9;
    --text-muted: #62948e;
    
    --accent: #14b8a6;
    --accent-hover: #2dd4bf;
    --accent-rgb: 20, 184, 166;
    
    --glow-color: rgba(20, 184, 166, 0.3);
    --overlay-bg: rgba(2, 18, 16, 0.85);

    /* Fonts & Typography Scales (clamp) */
    --font-family: 'Plus Jakarta Sans', sans-serif;
    
    --fs-h1: clamp(1.35rem, 5.5vw, 1.75rem);
    --fs-h2: clamp(1.05rem, 4.5vw, 1.25rem);
    --fs-body-lg: clamp(0.95rem, 4vw, 1.05rem);
    --fs-body: clamp(0.85rem, 3.5vw, 0.95rem);
    --fs-sm: clamp(0.75rem, 3vw, 0.825rem);

    /* Spacings (clamp) */
    --space-outer: clamp(1rem, 4vw, 1.5rem);
    --space-inner: clamp(0.85rem, 3.5vw, 1.25rem);
    --gap-section: clamp(1.25rem, 5vw, 2rem);
    --gap-element: clamp(0.75rem, 3vw, 1rem);
    --border-radius: 18px;
    --border-radius-sm: 12px;
    
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    /* Color Palette - Light Mode */
    --bg-primary: #f0fdfa;
    --bg-secondary: #e6f7f4;
    --bg-ambient-1: rgba(11, 93, 86, 0.12);
    --bg-ambient-2: rgba(20, 184, 166, 0.1);
    
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(11, 93, 86, 0.1);
    --card-hover-bg: rgba(255, 255, 255, 0.95);
    --card-hover-border: rgba(11, 93, 86, 0.35);
    --card-shadow: rgba(11, 93, 86, 0.06);
    
    --text-primary: #0b2d28;
    --text-secondary: #0b5d56;
    --text-muted: #4e7772;
    
    --accent: #0b5d56;
    --accent-hover: #073e39;
    --accent-rgb: 11, 93, 86;
    
    --glow-color: rgba(11, 93, 86, 0.12);
    --overlay-bg: rgba(240, 253, 250, 0.9);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
    transition: background-color 0.5s var(--transition-smooth);
}

/* ==========================================================================
   AMBIENT GLOW SYSTEM
   ========================================================================== */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    mix-blend-mode: screen;
    transition: all 0.8s var(--transition-smooth);
}

[data-theme="light"] .glow-orb {
    mix-blend-mode: multiply;
    opacity: 0.45;
}

.glow-orb-1 {
    top: -10%;
    left: -10%;
    width: 80vw;
    height: 80vw;
    background: var(--bg-ambient-1);
    animation: orb-float-1 25s infinite alternate ease-in-out;
}

.glow-orb-2 {
    bottom: -10%;
    right: -10%;
    width: 70vw;
    height: 70vw;
    background: var(--bg-ambient-2);
    animation: orb-float-2 20s infinite alternate ease-in-out;
}

@keyframes orb-float-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(15%, 15%) scale(1.1); }
}

@keyframes orb-float-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-10%, -15%) scale(1.05); }
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: var(--space-outer) 0;
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 0 var(--space-outer);
    display: flex;
    flex-direction: column;
    gap: var(--gap-section);
}

/* ==========================================================================
   UTILITY BAR (THEME SELECTOR & SHARE)
   ========================================================================== */
.utility-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    outline: none;
    position: relative;
    overflow: hidden;
}

.icon-btn:hover, .icon-btn:focus-visible {
    border-color: var(--card-hover-border);
    box-shadow: 0 0 12px var(--glow-color);
    transform: translateY(-2px);
}

.icon-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.5s var(--transition-smooth);
}

.icon-btn:hover svg {
    transform: rotate(15deg);
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--gap-element);
}

.logo-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    padding: 10px;
    background: radial-gradient(circle, var(--card-bg) 0%, rgba(255,255,255,0.01) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: transform 0.5s var(--transition-smooth);
}

.logo-container:hover {
    transform: scale(1.05);
}

/* Outer rotating ring */
.logo-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent) 0%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: rotate-border 8s linear infinite;
}

@keyframes rotate-border {
    100% { transform: rotate(360deg); }
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 4px 10px var(--glow-color));
    transition: transform 0.5s var(--transition-smooth);
}

.logo-container:hover .logo-img {
    transform: scale(1.03) rotate(-5deg);
}

.profile-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-title {
    font-size: var(--fs-h1);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.verified-badge {
    display: flex;
    align-items: center;
    color: var(--accent);
}

.verified-badge svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    animation: pulse 2s infinite var(--transition-smooth);
}

.profile-tagline {
    font-size: var(--fs-body-lg);
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-desc {
    font-size: var(--fs-body);
    color: var(--text-muted);
    max-width: 90%;
    margin: 0 auto;
}

/* ==========================================================================
   STATISTICS CARD
   ========================================================================== */
.stats-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    padding: var(--space-inner);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 8px;
    box-shadow: 0 8px 32px var(--card-shadow);
    transition: transform 0.4s var(--transition-smooth), border-color 0.4s var(--transition-smooth);
}

.stats-card:hover {
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item:not(:last-child) {
    border-right: 1px solid var(--card-border);
}

.stat-value {
    font-size: var(--fs-body-lg);
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   LINKS SECTION
   ========================================================================== */
.links-section {
    display: flex;
    flex-direction: column;
    gap: var(--gap-section);
}

.links-group {
    display: flex;
    flex-direction: column;
    gap: var(--gap-element);
}

.group-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
    padding-left: 4px;
}

/* The Link Tree Button */
.link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 64px;
    padding: 12px 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    outline: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--transition-smooth);
    box-shadow: 0 4px 12px var(--card-shadow);
}

/* Ripple Layer */
.link-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(var(--accent-rgb), 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out;
}

.link-card:active::after {
    width: 300%;
    height: 300%;
}

.link-card:hover, .link-card:focus-visible {
    border-color: var(--card-hover-border);
    background-color: var(--card-hover-bg);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px var(--card-shadow), 0 0 15px var(--glow-color);
}

.link-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.link-content {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.link-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background-color: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.4s var(--transition-smooth), transform 0.4s var(--transition-smooth);
}

.link-card:hover .link-icon-wrapper {
    background-color: var(--accent);
    color: var(--bg-primary);
    transform: scale(1.08) rotate(5deg);
}

.link-icon-wrapper svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.link-text-container {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.link-title {
    font-size: var(--fs-body-lg);
    font-weight: 700;
    transition: color 0.3s ease;
}

.link-desc {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.link-arrow {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    z-index: 2;
    transition: transform 0.4s var(--transition-smooth), color 0.4s var(--transition-smooth);
}

.link-card:hover .link-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

.link-arrow svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Featured / Animated Ribbon Link Card */
.link-card-featured {
    border: 1px solid var(--accent);
}

.link-card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--accent-rgb), 0.15),
        transparent
    );
    transition: none;
    z-index: 1;
    animation: shine 3.5s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    40%, 100% { left: 100%; }
}

.badge-tag {
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 8px;
    font-weight: 800;
    background-color: var(--accent);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 2;
    box-shadow: 0 2px 5px var(--glow-color);
}

/* ==========================================================================
   SOCIAL MEDIA ICONS
   ========================================================================== */
.social-footer {
    display: flex;
    justify-content: center;
    gap: var(--gap-element);
    margin-top: 0.5rem;
}

.social-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s var(--transition-smooth);
    outline: none;
}

.social-icon:hover, .social-icon:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    background-color: var(--card-hover-bg);
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 20px var(--card-shadow), 0 0 10px var(--glow-color);
}

.social-icon:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ==========================================================================
   MODAL PANEL STYLING
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-outer);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: var(--space-outer);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s var(--transition-smooth);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--card-border) transparent;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: var(--space-inner);
    right: var(--space-inner);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: var(--card-hover-bg);
    border-color: var(--accent);
    color: var(--accent);
}

.modal-close svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-element);
    text-align: center;
    margin-bottom: var(--gap-section);
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background-color: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.modal-title {
    font-size: var(--fs-h2);
    font-weight: 800;
}

.modal-desc {
    font-size: var(--fs-body);
    color: var(--text-muted);
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: var(--gap-section);
}

.feature-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.feature-check {
    color: var(--accent);
    display: flex;
    margin-top: 2px;
}

.feature-check svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.feature-text {
    font-size: var(--fs-body);
    font-weight: 500;
}

.modal-btn {
    width: 100%;
    min-height: 56px;
    border-radius: 18px;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    font-family: var(--font-family);
    font-size: var(--fs-body-lg);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s var(--transition-smooth);
    outline: none;
}

.modal-btn:hover, .modal-btn:focus-visible {
    background-color: var(--accent-hover);
    box-shadow: 0 8px 20px var(--glow-color);
}

.modal-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================================================
   TOAST POPUP (ALERT)
   ========================================================================== */
.toast {
    position: fixed;
    bottom: var(--space-outer);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: var(--border-radius-sm);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 101;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.5s var(--transition-smooth), opacity 0.5s var(--transition-smooth);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--accent);
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.footer-text {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    line-height: 1.6;
}

/* ==========================================================================
   STAGGER ANIMATION ENTRANCE
   ========================================================================== */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--transition-smooth) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.18s; }
.stagger-3 { animation-delay: 0.26s; }
.stagger-4 { animation-delay: 0.34s; }
.stagger-5 { animation-delay: 0.42s; }
.stagger-6 { animation-delay: 0.5s; }
.stagger-7 { animation-delay: 0.58s; }
.stagger-8 { animation-delay: 0.66s; }

/* Micro-animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ==========================================================================
   MEDIA QUERY: TABLET (768px+) & DESKTOP (1024px+)
   ========================================================================== */
@media (min-width: 768px) {
    .main-wrapper {
        padding: 4rem 0;
    }
    
    /* Background enhancement on tablet/desktop */
    .ambient-background::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at center, transparent 40%, var(--bg-primary) 90%);
        pointer-events: none;
    }

    .glow-orb-1 {
        width: 500px;
        height: 500px;
        filter: blur(120px);
    }

    .glow-orb-2 {
        width: 450px;
        height: 450px;
        filter: blur(120px);
    }
}

@media (min-width: 1440px) {
    /* Subtle hover glowing aura around the central phone-width layout for immersive large-screen aesthetics */
    .container {
        position: relative;
    }
    .container::after {
        content: '';
        position: absolute;
        inset: -20px;
        border-radius: 32px;
        background: radial-gradient(circle, rgba(var(--accent-rgb), 0.03) 0%, transparent 70%);
        pointer-events: none;
        z-index: -1;
    }
}
