:root {
    color-scheme: light;
}

/* Dark Theme (Default) */
body[data-theme="dark"] {
    --bg: #0f172a;
    --bg-gradient-1: #1e293b;
    --bg-gradient-2: #0f172a;
    --bg-gradient-3: #0b1120;
    --card: rgba(255, 255, 255, 0.08);
    --card-strong: rgba(255, 255, 255, 0.12);
    --card-hover: rgba(30, 41, 59, 0.6);
    --text: #e2e8f0;
    --text-secondary: rgba(226, 232, 240, 0.92);
    --muted: #cbd5f5;
    --border: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(56, 189, 248, 0.5);
    --accent: #38bdf8;
    --accent-2: #a78bfa;
    --shadow: 0 25px 45px rgba(15, 23, 42, 0.35);
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(148, 163, 184, 0.35);
}

/* Light Theme */
body[data-theme="light"] {
    --bg: #ffffff;
    --bg-gradient-1: #f8fafc;
    --bg-gradient-2: #f1f5f9;
    --bg-gradient-3: #e2e8f0;
    --card: rgba(255, 255, 255, 0.95);
    --card-strong: rgba(241, 245, 249, 0.95);
    --card-hover: rgba(226, 232, 240, 0.8);
    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #475569;
    --border: rgba(203, 213, 225, 0.6);
    --border-hover: rgba(56, 189, 248, 0.7);
    --accent: #0284c7;
    --accent-2: #7c3aed;
    --shadow: 0 25px 45px rgba(15, 23, 42, 0.12);
    --input-bg: rgba(248, 250, 252, 0.9);
    --input-border: rgba(203, 213, 225, 0.6);
}

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

body {
    font-family: "Inter", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 45%, var(--bg-gradient-3) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 48px 20px 80px;
    transition: background 0.4s ease, color 0.4s ease;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    animation: fadeUp 0.7s ease both;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:nth-child(5) { animation-delay: 0.32s; }
.card:nth-child(6) { animation-delay: 0.4s; }

.header {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(167, 139, 250, 0.18));
    border: 1px solid rgba(148, 163, 184, 0.35);
}

body[data-theme="light"] .header {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(167, 139, 250, 0.15));
    border: 1px solid rgba(203, 213, 225, 0.5);
}

.header-content {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
}

.header-text h1 {
    font-size: clamp(2.2rem, 3vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.header-text h2 {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--muted);
    margin-top: 6px;
}

.subtitle {
    margin-top: 12px;
    max-width: 520px;
}

.pill-row {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    background: rgba(56, 189, 248, 0.2);
    color: #e0f2fe;
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.header-media {
    display: flex;
    justify-content: center;
}

.avatar {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 24px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.45);
    animation: float 4s ease-in-out infinite;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
}

p {
    color: var(--text-secondary);
}

.muted {
    color: var(--muted);
    margin-bottom: 8px;
}

.item {
    padding: 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.18);
    margin-bottom: 16px;
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

body[data-theme="light"] .item {
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(203, 213, 225, 0.4);
}

.item:last-child {
    margin-bottom: 0;
}

.item:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: var(--card-hover);
}

ul {
    list-style: none;
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

ul li {
    position: relative;
    padding-left: 18px;
}

ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.skill-grid li {
    background: var(--card-strong);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.skill-grid li::before {
    display: none;
}

.skill-grid li:hover {
    transform: translateY(-3px);
    background: rgba(56, 189, 248, 0.2);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.85);
}

input,
select,
textarea {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.8);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

button {
    border: none;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #0f172a;
    font-weight: 700;
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 16px 30px rgba(56, 189, 248, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px rgba(167, 139, 250, 0.35);
}

button:active {
    transform: translateY(1px);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text);
    transition: opacity 0.3s ease;
}

body[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 1;
}

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

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

body[data-theme="light"] .theme-toggle .moon-icon {
    opacity: 1;
}

body[data-theme="light"] .theme-toggle {
    background: var(--card);
    border-color: var(--border);
}

/* Download CV Button */
.download-cv {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: none;
}

.download-cv:hover {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

body[data-theme="light"] .download-cv {
    color: var(--accent);
}

body[data-theme="light"] .download-cv:hover {
    background: var(--accent);
    color: #ffffff;
}

.download-cv svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.footer {
    max-width: 1100px;
    margin: 48px auto 0;
    padding: 40px 20px 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text);
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--muted);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links li {
    padding: 0;
}

.footer-links li::before {
    display: none;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--muted);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 720px) {
    body {
        padding: 32px 16px 60px;
    }

    .card {
        padding: 22px;
    }

    .header-content {
        flex-direction: column-reverse;
        align-items: flex-start;
    }

    .avatar {
        width: 110px;
        height: 110px;
    }
}
