/* Unique Bento Grid Portfolio */

/* ==================== */
/* CSS VARIABLES        */
/* ==================== */

:root {
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-elevated: #f5f5f5;
    --text: #0a0a0a;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --accent: #6366f1;
    --accent-secondary: #ec4899;
    --border: rgba(0, 0, 0, 0.08);
    --glow: rgba(99, 102, 241, 0.15);
    --gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f59e0b 100%);
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-card: #171717;
    --bg-elevated: #262626;
    --text: #fafafa;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    --border: rgba(255, 255, 255, 0.08);
    --glow: rgba(99, 102, 241, 0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.3s ease;
}

/* ==================== */
/* ANIMATED BACKGROUND  */
/* ==================== */

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(236, 72, 153, 0.1), transparent);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* Floating Shapes */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: 20%;
    left: -50px;
    animation-delay: -7s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #f59e0b;
    bottom: -50px;
    right: 20%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* ==================== */
/* NAVIGATION           */
/* ==================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(var(--bg), 0.8);
    border-bottom: 1px solid var(--border);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.logo-glitch {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    position: relative;
    letter-spacing: -0.02em;
}

.logo-glitch::before,
.logo-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.logo-glitch::before {
    color: #ff006e;
    z-index: -1;
}

.logo-glitch::after {
    color: #00f5ff;
    z-index: -1;
}

.nav-logo:hover .logo-glitch::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    opacity: 0.8;
}

.nav-logo:hover .logo-glitch::after {
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite reverse;
    opacity: 0.8;
}

.logo-cursor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes glitch-1 {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 2px); }
    40% { transform: translate(-3px, -2px); }
    60% { transform: translate(3px, 2px); }
    80% { transform: translate(3px, -2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-2 {
    0% { transform: translate(0); }
    20% { transform: translate(3px, -2px); }
    40% { transform: translate(3px, 2px); }
    60% { transform: translate(-3px, -2px); }
    80% { transform: translate(-3px, 2px); }
    100% { transform: translate(0); }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--text);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--bg-elevated);
}

.toggle-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient);
    position: relative;
    transition: all 0.3s;
}

[data-theme="dark"] .toggle-icon {
    background: var(--text);
    box-shadow: inset -6px -6px 0 var(--bg-card);
}

/* ==================== */
/* BENTO GRID           */
/* ==================== */

.bento-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
}

.bento-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 24px;
    z-index: -1;
}

.bento-card:hover::before {
    opacity: 0.03;
}

.bento-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 40px -20px var(--glow);
}

.card-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== */
/* HERO CARD            */
/* ==================== */

.card-hero {
    grid-column: span 3;
    grid-row: span 2;
    display: flex;
    gap: 2rem;
    padding: 2.5rem;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-elevated);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    width: fit-content;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-line {
    display: block;
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.hero-name {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1rem;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 400px;
}

/* Code Window */
.hero-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-window {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.code-header {
    background: #2d2d2d;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca3f; }

.code-title {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #808080;
}

.code-content {
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
    color: #d4d4d4;
    margin: 0;
}

.code-keyword { color: #c586c0; }
.code-var { color: #9cdcfe; }
.code-prop { color: #9cdcfe; }
.code-string { color: #ce9178; }
.code-number { color: #b5cea8; }

/* ==================== */
/* PROFILE CARD         */
/* ==================== */

.card-profile {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--border);
    transition: all 0.3s;
}

.card-profile:hover .profile-img {
    border-color: var(--accent);
    transform: scale(1.05);
}

.profile-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-timezone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timezone-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
}

.profile-languages {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ==================== */
/* EXPERIENCE CARD      */
/* ==================== */

.card-experience {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--gradient);
    color: white;
}

.card-experience .exp-number {
    display: flex;
    align-items: baseline;
}

.exp-count {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.exp-plus {
    font-size: 2rem;
    font-weight: 700;
}

.exp-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.exp-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.exp-progress {
    height: 100%;
    width: 80%;
    background: white;
    border-radius: 2px;
    animation: progressGrow 2s ease-out;
}

@keyframes progressGrow {
    from { width: 0; }
}

/* ==================== */
/* TECH STACK CARD      */
/* ==================== */

.card-stack {
    grid-column: span 4;
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 1rem;
}

.stack-item {
    aspect-ratio: 1;
    background: var(--bg-elevated);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.stack-item .stack-icon {
    width: 32px;
    height: 32px;
}

.stack-item::after {
    content: attr(data-name);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.stack-item:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--bg-card);
    box-shadow: 0 10px 30px -10px var(--glow);
}

.stack-item:hover::after {
    opacity: 1;
}

/* ==================== */
/* WORK CARDS           */
/* ==================== */

.card-work-header {
    grid-column: span 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
}

.card-work-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.card-work-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card-work {
    grid-column: span 2;
    display: flex;
    gap: 1.5rem;
}

.work-content {
    flex: 1;
}

.work-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.work-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.work-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.work-tags span {
    background: var(--bg-elevated);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.work-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-icon {
    font-size: 3rem;
    opacity: 0.8;
}

/* ==================== */
/* SKILLS CARD          */
/* ==================== */

.card-skills {
    grid-column: span 2;
}

.skills-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: 12px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.skill-item:hover {
    background: var(--bg-card);
    transform: translateX(5px);
}

.skill-icon {
    font-size: 1.25rem;
}

/* ==================== */
/* LANGUAGES CARD       */
/* ==================== */

.card-languages {
    grid-column: span 1;
}

.lang-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.lang-item:hover {
    background: var(--bg-elevated);
}

.lang-flag {
    font-size: 1.25rem;
}

.lang-name {
    flex: 1;
    font-size: 0.9rem;
}

.lang-level {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== */
/* CONTACT CARD         */
/* ==================== */

.card-contact {
    grid-column: span 2;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
}

.contact-content h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.contact-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--text);
    color: var(--bg);
    padding: 1rem 1.5rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.contact-btn:hover {
    gap: 1rem;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.btn-arrow {
    transition: transform 0.3s;
}

.contact-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Contact card highlight animation */
.card-contact.highlight {
    animation: highlightPulse 2.5s ease-out;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.8);
    }
    25% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
    50% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
    }
    75% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* ==================== */
/* SOCIAL CARD          */
/* ==================== */

.card-social {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--bg-elevated);
}

.social-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
}

.social-link:hover .social-icon {
    background: var(--accent);
    color: white;
}

.social-name {
    flex: 1;
    font-size: 0.9rem;
}

.social-arrow {
    color: var(--text-muted);
    transition: transform 0.3s;
}

.social-link:hover .social-arrow {
    transform: translate(3px, -3px);
    color: var(--accent);
}

/* ==================== */
/* QUOTE CARD           */
/* ==================== */

.card-quote {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-elevated);
}

.card-quote blockquote {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
}

.quote-mark {
    font-size: 3rem;
    line-height: 0;
    color: var(--accent);
    opacity: 0.3;
}

.card-quote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: normal;
}

/* ==================== */
/* FOOTER               */
/* ==================== */

.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.heart {
    color: #ef4444;
    animation: heartbeat 1s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ==================== */
/* RESPONSIVE           */
/* ==================== */

@media (max-width: 1024px) {
    .bento-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-hero {
        grid-column: span 2;
        flex-direction: column;
    }

    .hero-name {
        font-size: 3rem;
    }

    .card-stack {
        grid-column: span 2;
    }

    .stack-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card-work-header,
    .card-work,
    .card-skills,
    .card-contact {
        grid-column: span 2;
    }

    .card-profile,
    .card-experience,
    .card-languages,
    .card-social,
    .card-quote {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .bento-container {
        grid-template-columns: 1fr;
        padding-top: 120px;
    }

    .bento-card {
        grid-column: span 1 !important;
    }

    .card-hero {
        padding: 1.5rem;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-visual {
        display: none;
    }

    .navbar {
        padding: 1rem;
    }

    .nav-link {
        display: none;
    }

    .stack-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .skills-list {
        grid-template-columns: 1fr;
    }

    .card-work {
        flex-direction: column;
    }

    .work-visual {
        display: none;
    }
}

/* ==================== */
/* PRINT STYLES         */
/* ==================== */

@media print {
    .bg-gradient,
    .bg-grid,
    .floating-shapes,
    .navbar,
    .theme-toggle {
        display: none;
    }

    .bento-card {
        break-inside: avoid;
        opacity: 1;
        transform: none;
    }
}
