:root {
    --primary: #1a1a2e;
    --accent: #4a6cf7;
    --accent-light: #e8edff;
    --text: #2d2d2d;
    --text-light: #6b7280;
    --bg: #f8f9fc;
    --card: #ffffff;
    --border: #e5e7eb;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    background: var(--primary);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

header .container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header .subtitle {
    font-size: 1.1rem;
    color: #a5b4fc;
    font-weight: 400;
}

header .location {
    font-size: 0.95rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.contact-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.contact-bar a {
    color: #c7d2fe;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.contact-bar a:hover {
    color: white;
}

/* Profile */
.profile {
    font-size: 1rem;
    color: #d1d5db;
    margin-top: 1rem;
    line-height: 1.6;
    max-width: 600px;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.lang-switcher a {
    color: #c7d2fe;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    transition: all 0.2s;
}

.lang-switcher a:hover {
    color: white;
    border-color: white;
    background: rgba(255,255,255,0.1);
}

/* Side Navigation */
.side-nav {
    position: fixed;
    left: 1.5rem;
    top: 180px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.side-nav a {
    display: block;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.side-nav a:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.side-nav .back-to-top {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

@media only screen and (max-width: 1024px) {
    .side-nav {
        display: none;
    }
}

/* Mobile bottom navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    padding: 0.5rem 0.25rem;
    justify-content: space-around;
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.mobile-nav a:hover,
.mobile-nav a:active {
    color: var(--accent);
    background: var(--accent-light);
}

.mobile-nav .back-to-top {
    font-size: 1.1rem;
    font-weight: bold;
}

.mobile-nav .nav-icon {
    font-size: 1.1rem;
}

@media only screen and (max-width: 1024px) {
    .mobile-nav {
        display: flex;
    }
    body {
        padding-bottom: 60px;
    }
}

/* Languages list */
.lang-list {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    gap: 2rem;
}

.lang-item {
    font-size: 0.95rem;
    color: var(--text);
}

.lang-item strong {
    color: var(--primary);
}

.lang-item span {
    color: var(--text-light);
}

/* Sections */
section {
    margin-bottom: 2.5rem;
}

section > h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Experience cards */
.company-group {
    margin-bottom: 2rem;
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.company-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.company-duration {
    font-size: 0.85rem;
    color: var(--text-light);
}

.role-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s;
}

.role-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.role-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.role-period {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.role-card p, .role-card li {
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.7;
}

.role-card ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

.role-card li {
    margin-bottom: 0.3rem;
}

.role-card a {
    color: var(--accent);
    text-decoration: none;
}

.role-card a:hover {
    text-decoration: underline;
}

.tech-stack {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Portfolio */
.portfolio-group {
    margin-bottom: 2rem;
}

.portfolio-group h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-left: 0.25rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.portfolio-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.portfolio-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.portfolio-card:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.portfolio-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.portfolio-card .card-body {
    padding: 1rem 1.25rem;
}

.portfolio-card .card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.portfolio-card:hover .card-title {
    color: var(--accent);
}

.portfolio-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.portfolio-card .card-tag {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Education */
.edu-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.edu-card .institution {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
}

.edu-card .edu-degree {
    font-size: 0.95rem;
    color: var(--text);
    margin-top: 0.25rem;
}

.edu-card .edu-period {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 640px) {
    header h1 { font-size: 1.6rem; }
    .meta-row { grid-template-columns: 1fr; }
    .contact-bar { flex-direction: column; gap: 0.5rem; }
}

@media print {
    body { background: white; }
    header { background: var(--primary); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .role-card:hover { box-shadow: none; }
}
