/* =============================================
   Portfolio — Nikita Nekliudov
   ============================================= */

/* ----- Variables ----- */
:root {
    --navy:      #1A2E45;
    --steel:     #2D6A9F;
    --teal:      #3AB5A0;
    --off-white: #F5F7FA;
    --white:     #FFFFFF;
    --text:      #1A2E45;
    --text-muted:#5A7089;
    --border:    #D8E2EC;
    --card-bg:   #FFFFFF;
    --section-alt: #EEF2F7;

    --font-display: "Playfair Display", Georgia, serif;
    --font-body:    "Inter", system-ui, sans-serif;
    --font-mono:    "IBM Plex Mono", "Courier New", monospace;

    --container:    1120px;
    --nav-h:        64px;
    --radius:       8px;
    --shadow:       0 2px 16px rgba(26,46,69,0.08);
    --shadow-hover: 0 6px 24px rgba(26,46,69,0.14);

    --transition:   0.2s ease;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--white);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--teal); }
ul { list-style: none; }

/* ----- Container ----- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ----- Reveal animation ----- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay { transition-delay: 0.15s; }

/* ----- Buttons ----- */
.btn {
    display: inline-block;
    padding: 13px 28px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition);
    text-align: center;
}
.btn-primary {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
}
.btn-primary:hover {
    background: #2fa090;
    border-color: #2fa090;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(58,181,160,0.3);
}
.btn-secondary {
    background: transparent;
    color: var(--navy);
    border-color: var(--navy);
}
.btn-secondary:hover {
    background: var(--navy);
    color: var(--white);
}
.btn-full { width: 100%; }

/* ----- Section titles ----- */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 48px;
}

/* =============================================
   NAV
   ============================================= */
.portfolio-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: box-shadow var(--transition);
}
.portfolio-nav.scrolled {
    box-shadow: 0 2px 16px rgba(26,46,69,0.1);
}
.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.nav-brand {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy);
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-brand:hover { color: var(--steel); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    padding: 6px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}
.nav-link:hover,
.nav-link.active {
    color: var(--navy);
    background: var(--section-alt);
}
.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* =============================================
   HERO
   ============================================= */
.section-hero {
    padding-top: calc(var(--nav-h) + 80px);
    padding-bottom: 0;
    background: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hero-inner {
    padding-bottom: 72px;
}
.hero-text {
    display: grid;
    grid-template-columns: 1fr 420px;
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
        "headline photo"
        "descriptor photo"
        "ctas photo"
        "stats photo";
    column-gap: 64px;
    align-items: start;
}
.hero-headline   { grid-area: headline; }
.hero-descriptor { grid-area: descriptor; }
.hero-photo      { grid-area: photo; align-self: center; }
.hero-ctas       { grid-area: ctas; }
.hero-stats      { grid-area: stats; }
.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--navy);
    margin-bottom: 20px;
}
.hero-descriptor {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.6;
}
.hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.hero-photo {
    position: relative;
}
.hero-photo img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    aspect-ratio: 5/6;
    box-shadow: var(--shadow-hover);
    filter: grayscale(8%);
}

/* Credibility strip */
.credibility-strip {
    border-top: 1px solid var(--border);
    background: var(--off-white);
    padding: 24px 0;
}
.cred-inner {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 24px;
    flex-wrap: wrap;
}
.cred-item img {
    height: 42px;
    width: auto;
    filter: grayscale(100%) opacity(0.55);
    transition: filter var(--transition);
}
.cred-item img:hover {
    filter: grayscale(60%) opacity(0.8);
}

/* Hero stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* default: 5, 6, 7+ items */
    gap: 24px 40px;
    margin-top: 36px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.hero-stats:has(> .hero-stat:only-child)              { grid-template-columns: 1fr; }
.hero-stats:has(> .hero-stat:nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.hero-stats:has(> .hero-stat:nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hero-stat-number {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--navy);
    line-height: 1;
    letter-spacing: -0.02em;
}
.hero-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* =============================================
   WHAT I DO
   ============================================= */
.section-cards {
    padding: 96px 0;
    background: var(--white);
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 56px;
}
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.card-icon {
    width: 44px;
    height: 44px;
    color: var(--teal);
    margin-bottom: 20px;
}
.card-icon svg { width: 100%; height: 100%; }
.card-headline {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
    line-height: 1.4;
}
.card-stat {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--teal);
    font-weight: 500;
    margin-bottom: 14px;
    letter-spacing: 0.01em;
}
.card-bullets {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card-bullets li {
    font-size: 1rem;
    color: var(--text-muted);
    padding-left: 14px;
    position: relative;
    line-height: 1.5;
}
.card-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--teal);
    opacity: 0.6;
}
.personal-statement {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
    padding: 0 24px;
}

/* =============================================
   SELECTED WORK
   ============================================= */
.section-work {
    padding: 96px 0;
    background: var(--off-white);
}
.pubs-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}
.pub-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 28px;
    align-items: start;
    transition: box-shadow var(--transition);
}
.pub-card:hover { box-shadow: var(--shadow-hover); }
.pub-card--lead {
    border-left: 4px solid var(--teal);
}
.pub-journal {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--teal);
    padding-top: 4px;
    line-height: 1.4;
}
.pub-title {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
    line-height: 1.4;
}
.pub-status {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-family: var(--font-mono);
}
.pub-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.pubs-footer {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}
.pubs-stats {
    font-size: 1rem;
    color: var(--text-muted);
}
.pubs-stats a {
    font-weight: 600;
    color: var(--steel);
}

/* =============================================
   EXPERIENCE
   ============================================= */
.section-experience {
    padding: 96px 0;
    background: var(--white);
}
.timeline {
    position: relative;
    padding-left: 32px;
    margin-bottom: 64px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 48px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -29px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--teal);
}
.timeline-org {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}
.timeline-role {
    font-size: 1.05rem;
    color: var(--steel);
    font-weight: 500;
    margin-bottom: 12px;
}
.timeline-dates {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
    font-size: 0.95rem;
}
.timeline-bullets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.timeline-bullets li {
    font-size: 1.05rem;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
    line-height: 1.55;
}
.timeline-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--teal);
    opacity: 0.6;
}

/* Education block */
.education-block {
    border-top: 1px solid var(--border);
    padding-top: 48px;
}
.education-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 28px;
}
.education-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.edu-item {
    background: var(--off-white);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.edu-institution {
    font-weight: 600;
    color: var(--navy);
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.edu-degree {
    font-size: 1rem;
    color: var(--text-muted);
}

/* =============================================
   CONSULTING
   ============================================= */
.section-consulting {
    padding: 96px 0;
    background: var(--navy);
    color: var(--off-white);
}
.section-consulting .section-title {
    color: var(--white);
}
.consulting-entity {
    display: block;
    font-size: 0.75em;
    font-weight: 400;
    font-style: italic;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}
.service-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: background var(--transition);
}
.service-card:hover {
    background: rgba(255,255,255,0.11);
}
.service-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--teal);
    margin-bottom: 10px;
    line-height: 1.35;
}
.service-desc {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.65;
}
.consulting-approach {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.75;
    color: rgba(255,255,255,0.75);
    max-width: 720px;
    margin: 0 0 40px;
    border-left: 3px solid var(--teal);
    padding-left: 24px;
}
.consulting-cta { display: flex; }

/* =============================================
   CONTACT
   ============================================= */
.section-contact {
    padding: 96px 0;
    background: var(--off-white);
}
.contact-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}
.contact-statement {
    font-size: 1.15rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 32px;
    font-family: Georgia, serif;
    font-style: italic;
}
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
}
.contact-details li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    color: var(--text);
}
.contact-details svg {
    width: 18px;
    height: 18px;
    color: var(--steel);
    flex-shrink: 0;
}
.contact-cv-links {
    margin-bottom: 28px;
}
.cv-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--steel);
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
    transition: color var(--transition), border-color var(--transition);
}
.cv-link:hover {
    color: var(--teal);
    border-color: var(--teal);
}
.contact-social {
    display: flex;
    gap: 14px;
}
.contact-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: color var(--transition), border-color var(--transition),
                box-shadow var(--transition);
}
.contact-social a:hover {
    color: var(--steel);
    border-color: var(--steel);
    box-shadow: 0 2px 8px rgba(45,106,159,0.15);
}
.contact-social svg { width: 16px; height: 16px; }

/* Form */
.contact-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    -webkit-appearance: none;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--steel);
    box-shadow: 0 0 0 3px rgba(45,106,159,0.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-feedback {
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 1.4em;
    text-align: center;
}
.form-feedback.success { color: var(--teal); }
.form-feedback.error   { color: #c0392b; }

/* =============================================
   FOOTER
   ============================================= */
.portfolio-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.4);
    padding: 24px 0;
    text-align: center;
    font-size: 0.82rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .cards-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }
    .pub-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .education-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .hero-text {
        display: block;
    }
    .hero-photo { max-width: 320px; margin: 0 auto 32px; }
    .hero-text  { text-align: center; }
    .hero-ctas  { justify-content: center; }
    .contact-inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 680px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 24px 20px;
        gap: 4px;
        box-shadow: 0 8px 24px rgba(26,46,69,0.1);
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 10px 8px; font-size: 0.95rem; }
    .nav-burger { display: flex; }

    .section-hero { padding-top: calc(var(--nav-h) + 48px); }

    .cred-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px 0;
    }
    .cred-item {
        flex: 0 0 33.33%;
        display: flex;
        justify-content: center;
    }
    .cred-item img { height: 33px; }

    .section-cards,
    .section-work,
    .section-experience,
    .section-consulting,
    .section-contact { padding: 64px 0; }

    .section-title { margin-bottom: 32px; }

    .contact-form { padding: 28px 20px; }
}
