:root {
    /* A) Tech Minimal — токены */
    --primary: #124559;
    /* главный акцент из палитры */
    --accent: #AEC3B0;
    /* мягкий акцент/успех */
    --secondary: #01161E;
    /* основной текст/интерфейс */
    --muted: #598392;
    /* приглушённый текст */
    --light: rgb(245, 248, 255);
    /* фон страницы */
    --surface: #FFFFFF;
    /* поверхность карточек (для контраста) */
    --chip-bg: rgba(239, 246, 224, .22);
    /* полупрозрачный на базе --light */
    --chip-text: #ffffff;
    --radius-lg: 1.25rem;
    --radius-xl: 2rem;
    --shadow-sm: 0 4px 14px rgba(1, 22, 30, .06);
    --shadow-md: 0 8px 24px rgba(1, 22, 30, .12);
    --focus: rgba(18, 69, 89, .45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    color: var(--secondary);
    background: var(--light);
    line-height: 1.6;
}

/* ─── Header ────────────────────────────────────────── */
header {
    background: var(--primary);
    color: white;
    padding-bottom: 3.75rem;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    /* асимметрия */
}

.topbar {
    background: rgba(255, 255, 255, 0.06);
}

.topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
}

.topbar-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.topbar-right {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.topbar-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.topbar-right {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.theme-btn {
    border: 1.5px solid var(--light);
    color: var(--light);
    background: transparent;
    border-radius: 9999px;
    padding: .25rem .6rem;
    font-weight: 700;
    cursor: pointer;
}

.theme-btn[aria-pressed="true"] {
    background: var(--light);
    color: var(--primary);
}

.icon-link svg,
.icon-link img {
    width: 20px;
    height: 20px;
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    /* фото | текст | язык */
    gap: 1rem;
    padding: 1rem 1rem 0;
    align-items: start;
    position: relative;
    /* для фонового слоя */
    overflow: hidden;
}

.header-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero-bg, url('sandbox:/mnt/data/1d4ee88a-f7f4-4ec9-b111-d9cc818871fd.webp'));
    background-size: cover;
    background-position: center;
    filter: contrast(0.55) saturate(0.8) brightness(1.05) blur(1px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    /* фоновый слой всегда под контентом */
}

.header-inner>* {
    position: relative;
    z-index: 1;
}

.header-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #fff;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    transform: translateY(-18%);
    box-shadow: var(--shadow-md);
}

.branding {
    display: grid;
    gap: .75rem;
    align-content: start;
}

.branding h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

.branding p {
    opacity: .95;
}

/* Метрики-чипы */
.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .25rem;
    font-variant-numeric: tabular-nums;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: 9999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: saturate(120%) blur(2px);
    font-size: .9rem;
    font-weight: 600;
}

.chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, .25);
}

.cta-row {
    display: flex;
    gap: .75rem;
    margin-top: .5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    border-radius: 9999px;
    padding: .65rem 1rem;
    font-weight: 600;
    text-decoration: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    border-radius: 9999px;
    padding: .65rem 1rem;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary {
    background: var(--light);
    color: var(--primary);
    border: 2px solid transparent;
}

.btn-outline {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--light);
}

.btn:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.lang-toggle {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
}

.lang-toggle:hover {
    background: white;
    color: var(--primary);
}

.lang-toggle:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* ─── Sections ───────────────────────────────────────── */
section {
    padding: 4rem 1rem;
    max-width: 1040px;
    margin: 0 auto;
}

/* About — асимметрия: текст + декоративная картинка справа */
#about {
    display: flex;
    gap: 2rem;
    align-items: start;
}

#about img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

#about .text {
    text-align: justify;
    text-justify: inter-word;
}

#about .text p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

#about img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Services — вертикальная плашка слева */
#services .cards {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 4px;
    box-shadow: var(--shadow-sm);
    transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s;
}

.card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: .95;
    border-top-left-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.badge {
    display: inline-block;
    padding: .25rem .5rem;
    border-radius: .5rem;
    background: var(--light);
    color: var(--primary);
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid #AEC3B0;
}

/* Publications */
#publications .filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.filter-chip {
    border: 1.5px solid #59839266;
    background: var(--surface);
    color: var(--secondary);
    padding: .45rem .8rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
}

.filter-chip[aria-pressed="true"] {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--light);
}

.pub-list {
    display: grid;
    gap: 1rem;
}

.pub {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    gap: .4rem;
    border: 1px solid var(--pub-border, #CAD3E4);
}

.pub .title {
    font-weight: 600;
}

.pub .meta {
    color: var(--muted);
    font-size: .9rem;
}

.pub .tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.oa {
    background: #AEC3B0;
    color: #01161E;
}

.cite-btn {
    margin-left: auto;
    border: thin solid #cbd5e1;
    border-radius: 9999px;
    padding: .35rem .7rem;
    font-weight: 600;
    cursor: pointer;
    height: 38px;
    text-decoration: none;
    color: var(--secondary);
    background: #fff;
}

.cite-btn:hover {
     color: var(--primary);
    border: thin solid var(--light);
}

/* Contact */
#contact form {
    display: grid;
    gap: 1rem;
    max-width: 640px;
    margin: 0 auto;
}

input,
textarea {
    padding: .75rem 1rem;
    border: 1px solid #59839233;
    border-radius: .75rem;
    background: #ffffff;
    color: var(--secondary);
}

button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: .75rem 1.25rem;
    border-radius: .75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background .16s;
    box-shadow: var(--shadow-sm);
}

button[type="submit"]:hover {
    background: #0e3647;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
}

/* Адаптив */
@media (max-width: 860px) {
    .header-inner {
        grid-template-columns: auto 1fr;
    }

    .lang-toggle {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .header-photo {
        width: 130px;
        height: 130px;
        transform: translateY(-12%);
    }

    #about {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .branding h1 {
        font-size: 2rem;
    }

    .metrics {
        gap: .4rem;
    }

    .header-photo {
        width: 110px;
        height: 110px;
        transform: translateY(-8%);
    }
}

/* Expertise (второй раздел) */
#expertise {
    position: relative;
    background: linear-gradient(135deg, rgba(18, 69, 89, .12), rgba(174, 195, 176, .12));
}

.spec-tabs {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.spec-pane .spec-hero {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.spec-badge {
    display: inline-block;
    background: var(--light);
    color: var(--primary);
    border: 1px solid var(--accent);
    border-radius: .75rem;
    padding: .25rem .6rem;
    font-weight: 700;
    font-size: .75rem;
}

.spec-badge.alt {
    background: #e8f0e1;
}

.spec-title {
    font-size: 1.5rem;
    margin: .5rem 0 .25rem;
}

.spec-desc {
    color: var(--muted);
}

.spec-cards .card {
    min-height: 120px;
}


/* EDITORIAL THEME */
html {
    --primary: #124559;
    /* холодный акцент (сине-зелёный) */
    --secondary: #121212;
    /* очень тёмный серый текст */
    --muted: #65768A;
    /* холодный приглушённый */
    --light: rgb(196, 210, 240);
    /* более насыщённый холодный фон */
    --surface: #FFFFFF;
    --accent: #2B4E63;
    /* более холодный для ссылок/иконок */
    --chip-bg: transparent;
    --chip-text: #121212;
    --shadow-sm: 0 2px 0 rgba(18, 18, 18, .08);
    --shadow-md: 0 4px 0 rgba(18, 18, 18, .10);
}

html body {
    background: var(--light);
    color: var(--secondary);
}

html header {
    background: var(--light);
    color: var(--secondary);
    padding-bottom: 2.25rem;
    clip-path: none;
    border-bottom: 1px solid rgba(101, 118, 138, .25);
}

html .topbar {
    background: transparent;
    border-bottom: 1px solid rgba(101, 118, 138, .2);
}

html body {
    background: var(--light);
    color: var(--secondary);
}

html header {
    background: var(--light);
    color: var(--secondary);
    padding-bottom: 1rem;
    clip-path: none;
    border-bottom: 1px solid rgba(1, 22, 30, .12);
}

html .topbar {
    background: transparent;
    border-bottom: 1px solid rgba(1, 22, 30, .08);
}

html .theme-btn {
    border-color: rgba(1, 22, 30, .4);
    color: var(--secondary);
}

html .theme-btn[aria-pressed="true"] {
    background: var(--secondary);
    color: var(--light);
    border-color: var(--secondary);
}

html .header-inner {
    grid-template-columns: 1.2fr auto;
    align-items: end;
}

html .header-photo {
    width: 180px;
    height: 220px;
    border-radius: 1rem;
    border: 3px solid rgba(18, 18, 18, .20);
    box-shadow: none;
    transform: translateY(0);
    background-size: cover;
    background-position: center;
    background-clip: padding-box;
}

html .branding h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

html .branding p {
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    font-weight: 600;
}

/* editorial chips become subtle tags */
html .metrics {
    gap: .25rem;
    margin-top: .75rem;
}

html .chip {
    background: transparent;
    color: var(--secondary);
    border: none;
    padding: 0;
    font-weight: 600;
}

html .chip .dot {
    display: none;
}

html .metrics .chip:not(:last-child)::after {
    content: " · ";
    opacity: .5;
    margin: 0 .25rem;
}

/* editorial buttons as links */
html .btn-primary {
    background: transparent;
    color: var(--primary);
    border: none;
    padding: 0;
    position: relative;
}

html .btn-primary::after {
    content: "→";
    margin-left: .4rem;
}

html .btn-outline {
    background: transparent;
    color: var(--primary);
    border: none;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
}

html .lang-toggle {
    border-color: rgba(1, 22, 30, .4);
    color: var(--secondary);
}

/* sections spacing & typography */
html section {
    padding: 3.5rem 1rem;
}

html h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    letter-spacing: -0.01em;
}

/* cards become lighter with hairline borders */
html .card {
    border: 1px solid rgba(1, 22, 30, .12);
    box-shadow: none;
    border-radius: .75rem;
}

html .card::before {
    background: rgba(1, 22, 30, .08);
}

/* publications look like editorial list */
html .pub {
    border: 1px solid rgba(101, 118, 138, .35);
    box-shadow: none;
}

html .pub .title {
    font-family: 'Playfair Display', serif;
}

html .filter-chip {
    border-color: rgba(1, 22, 30, .25);
}

/* about image corners */
html #about img {
    border-radius: 1rem;
}