/* ========================================
   PORTFOLIO WEBSITE STYLESHEET - CLEANED
   ======================================== */

/* CSS Variables for consistency */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-gray: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #a0a0a0;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --purple: #6366f1;
    --border: #e2e8f0;
    --border-dark: #334155;
    --shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-dark: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* Dynamic sizing */
    --base-padding: 2rem;
    --base-font: clamp(3rem, 8vw, 6rem);
    --grid-min: repeat(auto-fit, minmax(320px, 1fr));
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ========================================
   NAVIGATION & THEME SWITCH
   ======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 20px 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem var(--base-padding);
    display: flex;
    justify-content: space-between;

}

.logo {
    height: 40px;
    margin-left: 20px;
    border-radius: 50%;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    margin-left: 1rem;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: 0.4s;
    border-radius: 15px;
}

.slider:before {
    position: absolute;
    content: "☀️";
    font-size: 16px;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    transition: 0.4s;
    opacity: 1;
    color: #fbbf24;
}

.slider:after {
    position: absolute;
    content: "🌗";
    font-size: 16px;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    transition: 0.4s;
    opacity: 0;
    color: #f8fafc;
}

input:checked+.slider {
    background-color: #1e293b;
}

input:checked+.slider:before {
    opacity: 0;
}

input:checked+.slider:after {
    opacity: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links a {
    color: rgba(55, 65, 81, 0.95);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.nav-links a:not(:last-child):after {
    content: ' | ';
    margin: 0 1rem;
    color: inherit;
    font-weight: 300;
}

/* ========================================
   HERO SECTION & SOCIAL TRIANGLE
   ======================================== */
.hero {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 8rem 2rem 4rem;
    position: relative;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.social-triangle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100vh;
    width: 50vw;
    z-index: -1;
}

.social-triangle svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.15));
}

.social-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 1rem;
}

.social-content a {
    color: white;
    border: 2px solid white;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-content a:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   SECTIONS & GRIDS
   ======================================== */
.section {
    padding: 6rem 0;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
}



.dark {
    background: #ffffff;
    color: #000;
}

.gradient {
    background: linear-gradient(135deg, var(--bg-gray), white);
}

.skills-grid,
.projects-grid,
.grid {
    display: grid;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}


/* ========================================
   SKILLS & PROGRESS BARS
   ======================================== */
.skills-grid {
    grid-template-columns: var(--grid-min);
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.skill-item {
    position: relative;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    background: var(--text-primary);
    color: var(--bg-card);
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    position: absolute;
    z-index: 10;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 200px;
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    white-space: nowrap;
    transition: opacity 0.3s, visibility 0.3s;
}

.skill-item:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.skill-item:hover {
    transform: translateY(-5px);
}

.skill-logo {
    font-size: 2rem;
    flex-shrink: 0;
}

.skill-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--accent));
    width: 0;
    transition: width 1.5s ease;
    border-radius: 4px;
}

.skill-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.skill-name {
    flex: 1;
    font-weight: 600;
}

.skill-percent {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--purple);
    min-width: 4rem;
    text-align: right;
}

/* ========================================
   PROJECT CARDS
   ======================================== */
.grid,
.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (max-width: 1024px) {

    .grid,
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {

    .grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-dark);
}

.img-wrap {
    overflow: hidden;
}

.img-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .img-wrap img {
    transform: scale(1.05);
}

.card-body {
    padding: 2rem;
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.project-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ========================================
   GAME/PHONE SECTION - REALISTIC iPHONE 14 PRO
   ======================================== */

/* iPhone-specific CSS vars */
:root {
    --iphone-graphite: #252525;
    --iphone-metal: linear-gradient(145deg, #2d2d2d 0%, #1f1f1f 50%, #252525 100%);
    --iphone-glass: rgba(255, 255, 255, 0.1);
    --iphone-bezel: #0f0f0f;
    --iphone-notch: #000;
    --screen-glass-glow: rgba(255, 255, 255, 0.05);
}

.game-box {
    background: transparent;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
    perspective: 1000px;
}

.phone-frame {
    max-width: 340px;
    margin: 0 auto;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 52px;
    padding: 20px 18px 24px;
    box-shadow:
        0 35px 60px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid var(--iphone-bezel);
    position: relative;
    transform: rotateX(0deg) rotateY(0deg);
    transition: all 0.3s ease;
}

.phone-frame:hover {
    transform: translateY(-5px);
    box-shadow:
        0 45px 80px rgba(0, 0, 0, 0.5),
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.iphone-body {
    background: var(--iphone-metal);
    border-radius: 44px;
    height: 100%;
    position: relative;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.5),
        0 8px 20px rgba(0, 0, 0, 0.3);
}

.iphone-body::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, #1a1a1a 40%, #000 70%);
    border-radius: 50%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.iphone-body::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 6px;
    height: 28px;
    background: repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 1px,
            #111 1px,
            #111 2px);
    border-radius: 3px;
    z-index: 5;
}

.screen {
    background: #000;
    border-radius: 32px;
    height: clamp(380px, 68vw, 480px);
    margin: 0 auto 12px;
    position: relative;
    overflow: visible;
    aspect-ratio: 19.5 / 41;
    max-height: 520px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
    touch-action: manipulation;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.screen:active {
    transform: scale(0.98);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Glass screen effect */
.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--screen-glass-glow);
    backdrop-filter: blur(1px) saturate(1.2);
    border-radius: 32px;
    z-index: 2;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* Touch ripple effect pseudo-element */
.screen::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.6s ease;
    z-index: 3;
    pointer-events: none;
}

.screen:active::after {
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%) scale(1);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Dynamic Island / Notch */
.iphone-notch {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 12px;
    background: var(--iphone-notch);
    border-radius: 0 0 20px 20px;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.iphone-home-indicator {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    z-index: 3;
}

/* Rear camera module (back side illusion) */
.iphone-body .rear-camera {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 4px;
    z-index: 4;
}

.iphone-body .camera-lens {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #333 30%, #111 70%);
    border-radius: 50%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.5);
}

.iphone-body .camera-lens.big {
    width: 20px;
    height: 20px;
}

/* Side buttons */
.volume-btn {
    position: absolute;
    left: 8px;
    width: 3px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    top: 80px;
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.3);
}

.power-btn {
    position: absolute;
    right: 8px;
    top: 200px;
    width: 3.5px;
    height: 32px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    border-radius: 2px;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.4);
}

/* Keypad - inset home keypad style */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 260px;
    margin: 0 auto 8px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 24px;
    backdrop-filter: blur(20px);
}

.key,
.enter-btn {
    aspect-ratio: 1;
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

.key:active,
.enter-btn:active {
    transform: translateY(2px) scale(0.96);
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.key::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.key:hover::before {
    left: 100%;
}

.key:hover,
.enter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.enter-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    font-size: 1.4rem;
    grid-column: 2 / 4;
    margin-top: 6px;
}

.restart-btn {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin: 12px auto 0;
    display: block;
}

.restart-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Shake animation for wrong PIN */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.screen {
    animation: shake 0.5s ease-in-out;
}

/* ========================================
   DARK MODE
   ======================================== */
body.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-gray: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: var(--border-dark);
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-mode .nav {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-links a {
    color: rgba(241, 245, 249, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode .card,
body.dark-mode .skill-item {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.dark-mode .skill-bar {
    background: var(--bg-gray);
}

body.dark-mode .phone-frame {
    background: linear-gradient(145deg, #151515, #0a0a0a);
}

body.dark-mode .iphone-body {
    --iphone-metal: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 50%, #151515 100%);
}

body.dark-mode .key,
body.dark-mode .enter-btn {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .keypad {
    background: rgba(0, 0, 0, 0.25);
}

body.dark-mode .restart-btn {
    background: rgba(30, 64, 175, 0.3);
    color: #93c5fd;
    border-color: rgba(30, 64, 175, 0.5);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: var(--bg-card);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: #374151;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE (Mobile First)
   ======================================== */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .hero {
        padding: 6rem 1rem 2rem;
        text-align: center;
        align-items: center;
    }

    .social-triangle {
        display: none;
    }

    .social-content {
        position: static;
        transform: none;
        margin-top: 2rem;
        justify-content: center;
    }

    .section {
        padding: 4rem 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .phone-frame {
        padding: 16px 14px 20px;
        max-width: 300px;
        transform: rotateX(0deg) rotateY(0deg);
    }

    .screen {
        height: 340px;
    }

    .keypad {
        max-width: 230px;
    }
}


@media (max-width: 480px) {
    .key {
        font-size: 1.25rem;
    }
}

/* Smooth scroll & focus styles */
html {
    scroll-behavior: smooth;
}

a:focus,
button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}