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

:root {
    --bg: #fff;
    --text: #000;
    --text-secondary: #666;
    --accent: #000;
    --card-bg: rgba(0, 0, 0, 0.05);
    --input-bg: rgba(0, 0, 0, 0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #000;
    --text: #fff;
    --text-secondary: #888;
    --accent: #fff;
    --card-bg: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.12);
}

/* Nord Theme */
[data-theme="nord"] {
    --bg: #2E3440;
    --text: #ECEFF4;
    --text-secondary: #81A1C1;
    --accent: #88C0D0;
    --card-bg: rgba(59, 66, 82, 0.8);
    --input-bg: rgba(67, 76, 94, 0.8);
}

/* Dracula Theme */
[data-theme="dracula"] {
    --bg: #282A36;
    --text: #F8F8F2;
    --text-secondary: #9fa8c7;
    --accent: #BD93F9;
    --card-bg: rgba(68, 71, 90, 0.6);
    --input-bg: rgba(68, 71, 90, 0.8);
}

/* Cyber Theme */
[data-theme="cyber"] {
    --bg: #0f1219;
    --text: #fff;
    --text-secondary: #5FBDBA;
    --accent: #FFE135;
    --card-bg: rgba(30, 40, 55, 0.8);
    --input-bg: rgba(95, 189, 186, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Pages Layout */
.pages-wrapper {
    display: flex;
    justify-content: center;
    gap: 0;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pages-wrapper.show-project {
    overflow: hidden;
}

.page-home {
    flex-shrink: 0;
    width: 1000px;
    min-height: 100vh;
    height: fit-content;
    padding: 0 24px;
}

.pages-wrapper.show-project .page-home {
    height: 100vh;
    overflow-y: auto;
}

.page-project {
    flex-shrink: 0;
    width: 0;
    height: 100vh;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, padding 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-project.active {
    width: 1000px;
    padding: 0 24px;
    opacity: 1;
    overflow-y: auto;
}

.container {
    padding: 48px 0;
}

/* Header */
.header {
    margin-bottom: 16px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.info h1 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.info p {
    font-size: 20px;
    color: var(--text-secondary);
}

.info {
    flex: 1;
}

.linkedin-btn {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    align-self: flex-end;
    margin-bottom: 2px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.linkedin-btn:hover {
    transform: scale(1.15);
}

.linkedin-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0);
    transition: filter 0.2s ease;
}

.linkedin-btn:hover .linkedin-icon {
    filter: invert(37%) sepia(98%) saturate(1561%) hue-rotate(183deg) brightness(93%) contrast(96%);
}

[data-theme="dark"] .linkedin-icon,
[data-theme="nord"] .linkedin-icon,
[data-theme="dracula"] .linkedin-icon,
[data-theme="cyber"] .linkedin-icon {
    filter: brightness(0) invert(1);
}

/* Theme Switcher */
.theme-switcher {
    position: relative;
    display: flex;
    align-items: flex-end;
    align-self: flex-end;
    margin-bottom: 2px;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-btn:hover {
    transform: scale(1.15);
}

.theme-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0);
    transition: filter 0.2s ease;
}

[data-theme="dark"] .theme-icon,
[data-theme="nord"] .theme-icon,
[data-theme="dracula"] .theme-icon,
[data-theme="cyber"] .theme-icon {
    filter: brightness(0) invert(1);
}

.theme-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 24px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    min-width: 140px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 16px;
    color: #fff;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.15);
}

.theme-option.active {
    background: var(--text-secondary);
}

/* Light theme menu styles */
:root:not([data-theme]) .theme-option {
    color: rgba(0, 0, 0, 0.8);
}

:root:not([data-theme]) .theme-option:hover {
    background: rgba(0, 0, 0, 0.08);
}

:root:not([data-theme]) .theme-option.active {
    background: var(--text-secondary);
    color: #fff;
}

.theme-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Section Cards */
.section-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.description {
    font-size: 16px;
    color: var(--text);
    line-height: 1.6;
}

.description + .description {
    margin-top: 12px;
}

/* Inline Section Image */
.section-image-inline {
    width: 100%;
    height: auto;
    margin-top: 16px;
    border-radius: 18px;
}

.section-image-inline:first-child {
    margin-top: 0;
    margin-bottom: 16px;
}

/* Staggered Image Grid */
.image-grid-staggered {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 16px;
}

.image-grid-staggered img {
    flex: 1;
    width: 33.33%;
    height: auto;
    border-radius: 18px;
}

@media (max-width: 600px) {
    .image-grid-staggered {
        flex-direction: column;
    }

    .image-grid-staggered img {
        width: 100%;
    }

    .image-grid-staggered img:nth-child(1),
    .image-grid-staggered img:nth-child(3) {
        margin: 0;
    }
}

/* Split Section Card */
.section-card-split {
    display: flex;
    gap: 24px;
    align-items: center;
}

.section-card-split .section-content {
    flex: 1;
}

.section-card-split .section-image {
    width: 200px;
    height: auto;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .section-card-split {
        flex-direction: column;
    }

    .section-card-split .section-image {
        width: 100%;
    }
}

.project-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 0 -16px;
}

.project-list li {
    margin: 0;
}


.project-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.2s ease;
}

@media (max-width: 500px) {
    .project-list {
        grid-template-columns: 1fr;
    }
}

.project-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0);
    transition: filter 0.2s ease;
}

[data-theme="dark"] .project-logo,
[data-theme="nord"] .project-logo,
[data-theme="dracula"] .project-logo,
[data-theme="cyber"] .project-logo {
    filter: brightness(0) invert(1);
}

/* Project hover colors */
.project-list li a:hover,
.project-list li a.active {
    background: var(--accent);
    color: var(--bg);
    padding-left: 24px;
}

.project-list a:hover .project-logo,
.project-list a.active .project-logo {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .project-list a:hover .project-logo,
[data-theme="dark"] .project-list a.active .project-logo {
    filter: brightness(0);
}

[data-theme="nord"] .project-list a:hover .project-logo,
[data-theme="nord"] .project-list a.active .project-logo,
[data-theme="dracula"] .project-list a:hover .project-logo,
[data-theme="dracula"] .project-list a.active .project-logo,
[data-theme="cyber"] .project-list a:hover .project-logo,
[data-theme="cyber"] .project-list a.active .project-logo {
    filter: brightness(0);
}

/* Work Experience */
.experience-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 0 -16px;
}

.experience-list li {
    font-size: 16px;
    color: var(--text);
}

.experience-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    border-radius: 18px;
    transition: all 0.2s ease;
}

.experience-list li:nth-child(1),
.experience-list li:nth-child(2) {
    /* First row items don't span */
}

@media (max-width: 500px) {
    .experience-list {
        grid-template-columns: 1fr;
    }
}

.experience-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0);
}

[data-theme="dark"] .experience-logo,
[data-theme="nord"] .experience-logo,
[data-theme="dracula"] .experience-logo,
[data-theme="cyber"] .experience-logo {
    filter: brightness(0) invert(1);
}

.experience-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.experience-name {
    font-size: 16px;
    color: var(--text);
}

.experience-role {
    font-size: 14px;
    color: var(--text-secondary);
}

.experience-date {
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--input-bg);
    padding: 4px 10px;
    border-radius: 100px;
    transition: all 0.2s ease;
}

/* Experience hover colors */
.experience-link:hover {
    background: var(--accent);
    padding-left: 24px;
}

.experience-link:hover .experience-name,
.experience-link:hover .experience-role {
    color: var(--bg);
}

.experience-link:hover .experience-logo {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .experience-link:hover .experience-logo {
    filter: brightness(0);
}

[data-theme="nord"] .experience-link:hover .experience-logo,
[data-theme="dracula"] .experience-link:hover .experience-logo,
[data-theme="cyber"] .experience-link:hover .experience-logo {
    filter: brightness(0);
}

.experience-link:hover .experience-date {
    background: rgba(0, 0, 0, 0.1);
    color: var(--bg);
}

[data-theme="dark"] .experience-link:hover .experience-date {
    background: rgba(255, 255, 255, 0.2);
}

/* Contact */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-family: var(--font);
    background: var(--input-bg);
    border: none;
    border-radius: 24px;
    color: var(--text);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border-radius: 24px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}

.input-with-icon input {
    background: transparent;
    padding-left: 40px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-secondary);
}

.contact-form textarea {
    min-height: 100px;
    resize: vertical;
}

.contact-form button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    font-family: var(--font);
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.contact-form button:hover {
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
}

footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form States */
.form-error {
    font-size: 15px;
    color: #ff6b6b;
    margin: 0;
    display: none;
}

.form-error.visible {
    display: block;
}

.submit-btn-success {
    background: #4ade80 !important;
    color: #000 !important;
    pointer-events: none;
}

/* Project Page Styles */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-card + .project-header {
    margin-top: 16px;
    margin-bottom: 48px;
}

.back-btn {
    display: flex;
    align-items: center;
    height: 44px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    padding: 0 20px;
    border-radius: 100px;
    text-decoration: none;
}

.btn-text-mobile {
    display: none;
}

.btn-text-desktop {
    display: inline;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(1.05);
}

[data-theme="dark"] .back-btn {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="nord"] .back-btn,
[data-theme="dracula"] .back-btn,
[data-theme="cyber"] .back-btn {
    background: var(--input-bg);
}

[data-theme="nord"] .back-btn:hover,
[data-theme="dracula"] .back-btn:hover,
[data-theme="cyber"] .back-btn:hover {
    background: var(--card-bg);
}

.appstore-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    background: #000;
    color: #fff;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    padding: 0 20px;
    border-radius: 100px;
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.apple-logo {
    height: 16px;
    width: 16px;
    max-height: 16px;
    max-width: 16px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .appstore-btn {
    background: #fff;
    color: #000;
}

[data-theme="dark"] .apple-logo {
    filter: brightness(0);
}

.appstore-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.appstore-btn-bottom {
    width: fit-content;
    margin: 0 auto 48px auto;
}

.appstore-btn-riot {
    background: #DF252C;
    color: #fff;
}

.appstore-btn-riot .apple-logo {
    filter: brightness(0) invert(1);
}

.riot-logo {
    height: 16px;
    width: 16px;
    max-height: 16px;
    max-width: 16px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.project-hero {
    text-align: center;
    padding: 48px 24px;
}

.project-page-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.project-page-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.project-banner {
    width: 100%;
    border-radius: 24px;
    margin-bottom: 16px;
}

.project-image {
    width: 100%;
    border-radius: 16px;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 2100px) {
    .page-home {
        width: 800px;
    }

    .page-project.active {
        width: 800px;
    }
}

@media (max-width: 1700px) {
    .page-home {
        width: 600px;
    }

    .page-project.active {
        width: 600px;
    }
}

@media (max-width: 1300px) {
    .page-home {
        width: 500px;
    }

    .page-project.active {
        width: 500px;
    }
}

/* Standalone project pages (mobile) */
.project-page-standalone {
    min-height: 100vh;
    background: var(--bg);
    padding: 24px;
    padding-bottom: 100px;
}

.project-page-standalone .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

.project-page-standalone img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 900px) {
    .pages-wrapper {
        display: block;
    }

    .page-home {
        width: 100%;
        height: auto;
        overflow-y: visible;
    }

    /* Hide embedded project pages on mobile - use separate pages instead */
    .page-project {
        display: none !important;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .btn-text-desktop {
        display: none;
    }

    .btn-text-mobile {
        display: inline;
    }
}

/* Theme-specific link buttons for Nord, Dracula, Cyber */
[data-theme="nord"] .appstore-btn,
[data-theme="dracula"] .appstore-btn,
[data-theme="cyber"] .appstore-btn {
    background: var(--accent) !important;
    color: var(--bg) !important;
}

[data-theme="nord"] .appstore-btn .apple-logo,
[data-theme="nord"] .appstore-btn .riot-logo,
[data-theme="dracula"] .appstore-btn .apple-logo,
[data-theme="dracula"] .appstore-btn .riot-logo,
[data-theme="cyber"] .appstore-btn .apple-logo,
[data-theme="cyber"] .appstore-btn .riot-logo {
    filter: brightness(0) !important;
}

/* Theme-specific titles use accent color */
[data-theme="nord"] .section-title,
[data-theme="dracula"] .section-title,
[data-theme="cyber"] .section-title {
    color: var(--accent);
}

[data-theme] .info p {
    color: var(--text-secondary);
}
