/* ===========================================================
   Nikita Sidarovich — Portfolio
   Clean, professional light theme
   =========================================================== */

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

:root {
    --bg: #ffffff;
    --bg-alt: #f8fafc;          /* slate-50 */
    --surface: #ffffff;
    --border: #e2e8f0;          /* slate-200 */
    --text: #334155;            /* slate-700 */
    --text-muted: #64748b;      /* slate-500 */
    --heading: #0f172a;         /* slate-900 */
    --accent: #2563eb;          /* blue-600 */
    --accent-dark: #1d4ed8;     /* blue-700 */
    --accent-soft: #eff6ff;     /* blue-50 */
    --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);
    --radius: 14px;
    --radius-sm: 8px;
    --maxw: 1100px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--accent-dark);
}

/* ---------------- Header / Nav ---------------- */
header {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: var(--maxw);
    margin: 0 auto;
}

.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--heading);
    letter-spacing: -.01em;
}

.logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: .95rem;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--heading);
    cursor: pointer;
}

/* ---------------- Layout ---------------- */
main {
    margin-top: 72px;
}

section {
    padding: 5.5rem 5% 4.5rem;
    max-width: var(--maxw);
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--heading);
    margin-bottom: .75rem;
}

.section-intro {
    text-align: center;
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 3rem;
}

/* ---------------- Hero ---------------- */
.hero {
    max-width: none;
    background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg);
    text-align: center;
    padding: 8rem 5% 6rem;
    min-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.hero-content {
    max-width: 760px;
}

.hero-eyebrow {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: .4rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--heading);
    line-height: 1.05;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: .85rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .98rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .2s ease;
}

.cta-button.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.cta-button.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
}

.cta-button.secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--border);
}

.cta-button.secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.hero-social {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-weight: 500;
    font-size: .95rem;
}

.hero-social a {
    color: var(--text-muted);
}

.hero-social a:hover {
    color: var(--accent);
}

/* ---------------- About ---------------- */
.about-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3.5rem;
    align-items: start;
}

.about-image {
    position: sticky;
    top: 100px;
    text-align: center;
}

.about-image img {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--surface);
    box-shadow: var(--shadow-lg);
}

.about-facts {
    list-style: none;
    margin-top: 1.75rem;
    text-align: left;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.about-facts li {
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    color: var(--heading);
}

.about-facts li:last-child {
    border-bottom: none;
}

.about-facts span {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: .1rem;
}

.about-description p {
    margin-bottom: 1.2rem;
    color: var(--text);
}

.about-description p:last-child {
    margin-bottom: 0;
}

.about-actions {
    margin-top: 2rem;
}

/* ---------------- Education ---------------- */
#education {
    background: var(--bg-alt);
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

#education > * {
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
    padding-left: 5%;
    padding-right: 5%;
}

.education-content {
    display: grid;
    gap: 1.75rem;
}

.education-item {
    background: var(--surface);
    padding: 2rem 2.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.education-item--featured {
    position: relative;
    border: 2px solid #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, .08), rgba(22, 163, 74, .03));
    box-shadow: 0 10px 30px rgba(34, 197, 94, .18);
}

.education-item--featured::before {
    content: "★ Highlight";
    position: absolute;
    top: -.75rem;
    left: 2rem;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    padding: .25rem .85rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    box-shadow: 0 4px 12px rgba(34, 197, 94, .35);
}

.education-item--featured .education-header h3 {
    font-size: 1.55rem;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.education-header h3 {
    color: var(--heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.institution {
    color: var(--accent);
    font-weight: 500;
    margin: 0;
}

.degree-type {
    background: var(--accent-soft);
    color: var(--accent-dark);
    padding: .35rem 1rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

.exchange-badge {
    display: inline-block;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    vertical-align: middle;
    margin-left: .4rem;
}

.specialization {
    color: var(--text-muted);
    margin: 0;
}

.courses {
    margin-top: 1.75rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.courses h4 {
    color: var(--heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.course-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
}

.course-category h5 {
    color: var(--accent);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .75rem;
}

.course-category h5:not(:first-child) {
    margin-top: 1.25rem;
}

.course-list {
    list-style: none;
    display: grid;
    gap: .4rem;
}

.course-list li a {
    display: block;
    background: var(--bg-alt);
    color: var(--text);
    padding: .55rem .85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: .9rem;
    transition: all .2s ease;
}

.course-list li a:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-soft);
    transform: translateX(4px);
}

/* ---------------- Skills ---------------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform .2s ease, box-shadow .2s ease;
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.skill-category h3 {
    color: var(--heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.skill-tag {
    background: var(--accent-soft);
    color: var(--accent-dark);
    padding: .4rem .85rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 500;
    border: 1px solid #dbeafe;
}

/* ---------------- Projects ---------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
}

.project-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    width: 100%;
    height: 190px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    color: var(--heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.project-content > p {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: 1rem;
}

.thesis-badge {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    padding: .2rem .7rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: auto 0 1.1rem;
}

.tech-tag {
    background: var(--bg-alt);
    color: var(--text);
    padding: .25rem .7rem;
    border-radius: var(--radius-sm);
    font-size: .78rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.project-links a {
    font-weight: 600;
    font-size: .92rem;
}

/* ---------------- Contact ---------------- */
.contact {
    max-width: none;
    background: var(--heading);
    color: #cbd5e1;
}

.contact .section-title {
    color: #fff;
}

.contact-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.contact-intro h3 {
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 1rem;
}

.contact-intro p {
    color: #94a3b8;
    margin-bottom: 2.5rem;
}

.contact-intro a {
    color: #93c5fd;
    font-weight: 600;
    border-bottom: 1px solid rgba(147, 197, 253, .4);
}

.contact-intro a:hover {
    color: #bfdbfe;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #e2e8f0;
    background: rgba(255, 255, 255, .06);
    padding: .85rem 1.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    font-weight: 500;
    transition: all .2s ease;
}

.social-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.social-icon {
    font-size: 1.1rem;
}

/* ---------------- Footer ---------------- */
footer {
    background: var(--heading);
    color: #64748b;
    text-align: center;
    padding: 2rem 5%;
    font-size: .88rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

/* ---------------- Scroll reveal ---------------- */
section {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease, transform .6s ease;
}

section.in-view,
.hero {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    section {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 820px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        position: static;
    }
}

@media (max-width: 680px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        padding: .5rem 0;
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: .85rem 5%;
    }

    section {
        padding: 4rem 5% 3rem;
    }

    .section-title {
        font-size: 1.9rem;
    }

    .education-header {
        flex-direction: column;
    }
}
