:root {
    --color-bg: #f8f9fb;
    --color-surface: #ffffff;
    --color-text: #1a1d23;
    --color-muted: #5c6573;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --max-width: 960px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

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

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

header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

nav a {
    font-weight: 500;
    text-decoration: none;
}

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

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

section h2 {
    margin: 0 0 1.25rem;
    font-size: 1.35rem;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.5rem;
    display: inline-block;
}

#hero {
    padding: 2.5rem 1.75rem;
}

.hero-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

.hero-text {
    flex: 1 1 280px;
}

.profile-photo {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--color-border);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

#hero h1 {
    margin: 0 0 0.5rem;
    font-size: 2.25rem;
}

#hero .hero-text {
    text-align: left;
}

#hero .title {
    font-size: 1.2rem;
    color: var(--color-muted);
    margin: 0 0 1.25rem;
}

#hero .meta {
    color: var(--color-muted);
    margin-bottom: 1.25rem;
}

#hero .contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.25rem;
}

.badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn {
    display: inline-block;
    background: var(--color-accent);
    color: #fff !important;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none !important;
}

.btn:hover {
    background: var(--color-accent-hover);
    color: #fff !important;
}

.skill-groups {
    display: grid;
    gap: 1.25rem;
}

.skill-group h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-tags li {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    padding: 0 0 1.5rem 1.25rem;
    border-left: 3px solid var(--color-accent);
    margin-left: 0.5rem;
    position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -0.45rem;
    top: 0.35rem;
    width: 0.65rem;
    height: 0.65rem;
    background: var(--color-accent);
    border-radius: 50%;
}

.timeline-item h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.timeline-item .period {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-item .description {
    white-space: pre-line;
}

.timeline-item .technologies {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.education-link {
    margin-top: 1rem;
}

.card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--color-bg);
}

.card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.card .org {
    color: var(--color-muted);
    margin-bottom: 0.5rem;
}

.card .meta {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 0.75rem;
}

.card-actions {
    margin-top: 0.75rem;
}

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--color-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.contacts-grid {
    display: grid;
    gap: 0.75rem;
}

.contacts-grid a {
    word-break: break-all;
}

.repo-note {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.95rem;
}

.repo-note a {
    font-weight: 500;
    white-space: nowrap;
}

footer .footer-sep {
    margin: 0 0.35rem;
    color: var(--color-muted);
}

footer .footer-repo {
    font-size: 0.9rem;
    color: var(--color-muted);
    text-decoration: none;
}

footer .footer-repo:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .hero-layout {
        justify-content: center;
        text-align: center;
    }

    #hero .hero-text {
        text-align: center;
    }

    #hero .contacts {
        justify-content: center;
    }

    #hero h1 {
        font-size: 1.75rem;
    }

    nav {
        justify-content: center;
    }
}

/* Admin */
.admin-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    font-weight: 600;
    color: var(--color-muted);
}

.admin-actions {
    white-space: nowrap;
}

.admin-actions a {
    margin-right: 0.75rem;
}

.inline-form {
    display: inline;
}

.link-button {
    background: none;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
}

.admin-form {
    display: grid;
    gap: 1rem;
    max-width: 520px;
}

.admin-form label {
    display: grid;
    gap: 0.35rem;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font: inherit;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.flash.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.flash.error {
    background: #ffebee;
    color: #c62828;
}

.field-error {
    color: #c62828;
    font-size: 0.9rem;
    margin: -0.5rem 0 0;
}

.meta {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-photo--preview {
    width: 120px;
    height: 120px;
}

.profile-photo-preview {
    margin: 0;
}
