:root {
    --bg-color: #f3f3f5;
    /* Soft light gray */
    --text-main: #3a3a3c;
    --text-muted: #8e8e93;
    --border-color: #c6c6c8;
    --list-bg: #fff;
    --shadow-light: #ffffff;
    --shadow-dark: #d1d1d6;
    --inner-shadow-light: rgba(255, 255, 255, 0.8);
    --inner-shadow-dark: rgba(0, 0, 0, 0.1);
    --ring-border: rgba(255, 255, 255, 1);
    --line-gradient: linear-gradient(90deg, rgba(0, 0, 0, 0.0) 0%, rgba(255, 255, 255, 1) 50%, rgba(0, 0, 0, 0.0) 100%);
    --radial-shadow: drop-shadow(0 25px 45px rgba(0, 0, 0, 0.15)) drop-shadow(0 10px 15px rgba(0, 0, 0, 0.08));
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    overflow: hidden;
    height: 100%;
}

body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    transition: background-color 0.3s ease;
}

body::-webkit-scrollbar {
    display: none;
}

.app-container {
    width: 100%;
    max-width: 400px;
    /* Dimensions of large smartphone */
    background: transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Sidebar and Main Content Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Radial Section */
.radial-section {
    position: relative;
    /* Responsive height to shrink on smaller phones */
    height: clamp(340px, 110vw, 480px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Increased subtle depth */
    border-radius: 50%;
    /* Stronger, more spread out, and layered drop shadow, supporting dark mode vars */
    filter: var(--radial-shadow);
    user-select: none;
    touch-action: none;
    /* Prevent scrolling the page while interacting with the wheel */
}

/* Views management */
.view {
    display: none;
    flex: 1;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
    height: 100%;
    justify-content: center;
    /* Vertically center content */
    padding-bottom: 8vh;
    /* Shift center point upwards a bit */
    margin-top: 3rem;
}

.view.active {
    display: flex;
}

/* Mobile: equal spacing — screen top ↔ tag ↔ ring ↔ dock */
@media (max-width: 768px) {
    .view {
        margin-top: 0;
        padding-bottom: 0;
    }

    #home-view {
        justify-content: space-evenly;
        /* 3 equal gaps */
        padding-bottom: 80px;
        /* reserves space for the fixed bottom dock */
    }

    #home-view .identity-text {
        margin-bottom: 0;
        /* gap handled by space-evenly, not margin */
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Sidebar / Dock (Floating Island) */
.floating-island {
    position: fixed;
    background: var(--node-bg);
    border-radius: 50px;
    /* box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light); */
    display: flex;
    gap: 1.5rem;
    padding: 0.3rem;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
}

/* Desktop: Right Sidebar */
@media (min-width: 769px) {
    .floating-island {
        right: 1.5rem;
        top: 54.3%;
        /* Aligned with radial ring's visual center */
        transform: translateY(-50%);
        flex-direction: column;
    }
}

/* Nav Separator */
.nav-separator {
    width: 30px;
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .nav-separator {
        width: 1px;
        height: 30px;
        margin: 0 0.5rem;
    }
}

/* Sidebar Trigger Logic Removed */

/* Mobile: Bottom Dock */
@media (max-width: 768px) {
    .floating-island {
        bottom: 1.5rem;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        width: auto;
        min-width: 280px;
        justify-content: center;
        /* Drastically lower white glow on small devices */
        box-shadow: 4px 4px 10px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
    }
}

.nav-item {
    background: transparent;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-item:hover {
    color: var(--text-main);
    background: var(--inner-shadow-light);
}

.nav-item.active {
    color: var(--text-main);
    box-shadow: inset 3px 3px 6px var(--inner-shadow-dark), inset -3px -3px 6px var(--inner-shadow-light);
    background: var(--bg-color);
}

/* Hover Tooltip */
.nav-tooltip {
    position: absolute;
    background: var(--node-bg);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 4px 4px 10px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
    border: 1px solid var(--border-color);
}

/* Desktop Tooltip Position (Left of icon) */
@media (min-width: 769px) {
    .nav-tooltip {
        right: 60px;
        top: 50%;
        transform: translateY(-50%) translateX(10px);
    }

    .nav-item:hover .nav-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }
}

/* Mobile Tooltip Position (Above icon) */
@media (max-width: 768px) {
    .nav-tooltip {
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }

    .nav-item:hover .nav-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Placeholder Views Styling */
.view-header {
    text-align: center;
    margin: 2rem 0;
}

.view-header h2 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Embedded Iframe Container Logic Removed */

.placeholder-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.placeholder-island {
    background: var(--node-bg);
    padding: 3rem;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
}

.large-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.placeholder-island p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.view-cta-btn {
    display: inline-block;
    background: var(--text-main);
    color: var(--bg-color);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.view-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Builds List Static adjustment */
.project-list.static {
    padding: 1rem;
    overflow-x: visible;
    flex-wrap: wrap;
    justify-content: center;
}

.project-list.static li {
    flex: 0 0 260px;
}

.profile-container {
    /* Responsive width and height for profile */
    width: clamp(120px, 40vw, 170px);
    height: clamp(120px, 40vw, 170px);
    border-radius: 50%;
    background: var(--bg-color);
    /* Matches page background to stay invisible */
    padding: 0;
    /* Removing padding to allow image to fill edge to edge */
    /* Soft Neumorphic Shadow */
    box-shadow:
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    /* Clips the floating image inside the frame */
}

@keyframes float {

    0%,
    100% {
        transform: translate3d(0, -1.5%, 0);
    }

    50% {
        transform: translate3d(0, 1.5%, 0);
    }
}

/* Inner shadow ring for the profile pic */
.profile-container::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border-radius: 50%;
    /* Using dark mode friendly CSS vars explicitly */
    box-shadow: inset 2px 2px 6px var(--inner-shadow-dark), inset -2px -2px 6px var(--inner-shadow-light);
    pointer-events: none;
    z-index: 11;
}

.profile-image {
    width: 103%;
    /* Very subtle zoom to prevent edges showing */
    height: 103%;
    border-radius: 50%;
    object-fit: cover;
    animation: float 6s ease-in-out infinite;
    /* Slightly slower for extra smoothness */
    position: relative;
    will-change: transform;
    /* Hint to browser to use GPU */
}

/* Connecting lines container */
.lines-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 1;
}

/* Connecting lines */
.line {
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    /* JS driven */
    height: 2px;
    /* Responsive gradient variables that fade naturally in dark mode */
    background: var(--line-gradient);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transform-origin: 0% 50%;
}

/* Rings */
.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 290px;
    height: 290px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--ring-border);
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.02), 1px 1px 2px rgba(0, 0, 0, 0.02);
    border-radius: 50%;
    z-index: 0;
}

.social-icons-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through empty spaces */
}

.social-node {
    position: absolute;
    /* Responsive icon nodes */
    width: clamp(45px, 14vw, 60px);
    height: clamp(45px, 14vw, 60px);
    border-radius: 50%;
    background: var(--node-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%);
    /* Stronger baseline shadow setting */
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.1),
        5px 5px 12px var(--shadow-dark),
        -5px -5px 12px var(--shadow-light);
    /* Responsive Font Size */
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.3s ease;
    pointer-events: auto;
}

.social-node:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.15),
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light),
        0 0 20px rgba(129, 140, 248, 0.2);
    z-index: 20;
}

.social-node:active {
    transform: translate(-50%, -50%) scale(0.95);
    /* Active inner shadow needs to respond to dark mode deeply */
    box-shadow: inset 4px 4px 8px var(--inner-shadow-dark), inset -4px -4px 8px var(--inner-shadow-light);
}

.custom-icon {
    width: 55%;
    height: 55%;
    object-fit: contain;
    transition: transform 0.1s linear;
}

/* Specific icon gradients/colors matching modern brands */
.social-node.instagram {
    background: #fff;
    color: #E1306C;
}

.social-node.linkedin {
    background: #0077b5;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.social-node.devto {
    background: #0a0a0a;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.social-node.substack {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Image driven */
.social-node.producthunt {
    background: #da552f;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.social-node.plus {
    background: #6a7280;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.social-node.wallet {
    background: #2f3438;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.social-node.github {
    background: #181717;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.social-node.twitter {
    background: #1DA1F2;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.social-node.facebook {
    background: #1877F2;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.social-node.tiktok {
    background: #000000;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-node.tiktok i {
    filter: drop-shadow(2px 0 0 #ff0050) drop-shadow(-2px 0 0 #00f2ea);
}

/* Identity Text */
.identity-text {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-color);
    width: 95%;
    max-width: 800px;
    /* Wider for horizontal layout */
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 600px) {
    .modal-content {
        flex-direction: row;
        align-items: flex-start;
    }

    .modal-header {
        flex: 1;
        text-align: left;
        padding-right: 2rem;
        border-right: 1px solid var(--border-color);
        margin-bottom: 0;
    }

    .modal-body {
        padding-left: 1rem;
        flex: 2;
        display: flex;
        flex-direction: column;
        min-width: 0;
        /* Crucial for flex child overflow */
    }

    .profile-image-modal {
        margin-left: 0;
    }
}

.modal-body {
    width: 100%;
    min-width: 0;
    /* Crucial for flex child overflow */
    overflow: hidden;
}

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

.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-image-modal {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--bg-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-body h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.bio p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.project-list {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1.5rem 0.2rem;
    /* Extra padding for shadows to not get clipped */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    scroll-snap-type: x mandatory;
    scroll-padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.project-list::-webkit-scrollbar {
    height: 6px;
}

.project-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.project-list li {
    margin-bottom: 0;
    flex: 0 0 calc(50% - 0.75rem);
    min-width: 200px;
    scroll-snap-align: start;
}

/* Specific styles for the "projects-only" builds-modal */
.modal-content.projects-only .project-list {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    justify-content: center;
    /* Center items on desktop */
    padding-left: 0;
    padding-right: 1rem;
    margin-left: 0;
    margin-right: 0;
    overflow-x: visible;
    /* Remove scrollbars on large screens */
}

.modal-content.projects-only .project-list li {
    flex: 1;
    max-width: 260px;
    min-width: 200px;
}

.project-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 0;
    padding-bottom: 1.2rem;
    overflow: hidden;
    background: var(--node-bg);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 6px 6px 15px var(--shadow-dark), -6px -6px 15px var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
    height: 100%;
}

.project-thumb {
    width: 100%;
    aspect-ratio: 16/10;
    height: auto;
    border-radius: 0;
    object-fit: cover;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

.project-list a span {
    display: block;
    line-height: 1.4;
    padding: 0 1.2rem;
}

.project-list a:hover {
    transform: translateY(-8px);
    box-shadow: 10px 10px 25px var(--shadow-dark), -10px -10px 25px var(--shadow-light);
    border-color: var(--border-color);
}

/* Modal Responsive Enhancements (Light-Only) */
@media (max-width: 600px) {
    .modal-content.projects-only .project-list {
        justify-content: flex-start;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
        overflow-x: auto;
    }

    .modal-content.projects-only {
        padding: 2rem 1.5rem;
        width: 92%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .project-list {
        gap: 1.2rem;
        padding-bottom: 1.5rem;
    }

    .project-list li {
        flex: 0 0 88%;
        min-width: 240px;
    }
}

@media (max-width: 400px) {
    .project-list li {
        flex: 0 0 90%;
        min-width: 200px;
    }
}

.centered-title {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.project-list a:hover {
    transform: translateY(-8px);
    box-shadow: 10px 10px 25px var(--shadow-dark), -10px -10px 25px var(--shadow-light);
    border-color: var(--border-color);
}

/* Support Modal Options */
.support-options {
    flex-direction: column !important;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

.support-option-btn {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    max-width: 350px;
    padding: 1.2rem;
    background: var(--bg-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 6px 6px 15px var(--shadow-dark), -6px -6px 15px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.support-option-btn:hover {
    transform: translateY(-5px);
    box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
}

.support-option-btn i {
    font-size: 2rem;
    color: var(--text-muted);
}

.support-option-btn span {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.support-option-btn small {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
}

.intl-btn i {
    color: #4CAF50;
}

.local-btn i {
    color: #FF9800;
}

@media (min-width: 600px) {
    #support-modal .modal-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #support-modal .modal-header {
        border-right: none;
        padding-right: 0;
        text-align: center;
        flex: none;
        margin-bottom: 2rem;
    }

    #support-modal .modal-body {
        padding-left: 0;
        flex: none;
        width: 100%;
    }

    .support-options {
        flex-direction: row !important;
        gap: 2.5rem;
        padding: 0 1rem;
    }

    .support-option-btn {
        flex-direction: column;
        text-align: center;
        padding: 3rem 2rem;
        max-width: none;
        flex: 1;
        min-height: 380px;
        justify-content: center;
    }

    .support-card-content {
        text-align: center;
        margin-top: 1rem;
        gap: 0.4rem;
    }

    .support-option-btn i {
        font-size: 4.5rem;
        margin-bottom: 0.5rem;
    }

    .card-detail {
        margin-top: 0.8rem;
    }
}