body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f9f9f9 0%, #eef3f9 100%);
    min-height: 100vh;
    position: relative;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

body > * {
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
    background: #f4f6f8;
    border: 3px solid #2c3e50;
    margin-bottom: 20px;
    cursor: zoom-in;
}

h1 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h2 {
    color: #3498db;
    margin-top: 30px;
}

h3 {
    color: #2980b9;
    margin-top: 25px;
}

.section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.divider {
    text-align: center;
    margin: 30px 0;
    color: #7f8c8d;
    font-weight: bold;
}

.language-block {
    margin-bottom: 30px;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
}

ol, ul {
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
}

.discussion-links p {
    margin-bottom: 0.5em;
    font-weight: bold;
    display: inline;
    margin-right: 15px;
}

.discussion-links a {
    display: inline-block;
    margin-right: 15px;
    color: #3A5AFF;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #f5f7ff;
}

.discussion-links a:hover {
    background-color: #e0e5ff;
    text-decoration: none;
}

.table-container {
    overflow-x: auto;
    margin: 1.5em 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #f1f3f5;
}

/* Улучшенные стили для научного контента */
.article-meta {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 2em;
    text-align: center;
}

.abstract {
    background-color: #f8f9fa;
    padding: 1.5em;
    border-left: 4px solid #3498db;
    margin-bottom: 1.5em;
    border-radius: 0 4px 4px 0;
}

.keywords {
    margin-top: 1em;
    font-style: italic;
}

.references {
    padding-left: 2em;
}

.references li {
    margin-bottom: 1em;
    text-align: justify;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    margin-bottom: 1em;
    display: inline-block;
}

.back-link:hover {
    text-decoration: underline;
}

.hero {
    text-align: center;
    padding: 40px 20px 20px;
    margin-bottom: 30px;
}

.hero h1 {
    border-bottom: none;
    margin-bottom: 8px;
    font-size: 2em;
}

.tagline {
    color: #7f8c8d;
    font-size: 1.05em;
    margin: 0 0 20px;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-links a {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 6px;
    background-color: #2c3e50;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.hero-links a:hover {
    background-color: #3498db;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.card {
    display: block;
    padding: 20px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e0e6ed;
    color: #2c3e50;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    border-color: #3498db;
    text-decoration: none;
}

.card h3 {
    margin: 0 0 8px;
    color: #2c3e50;
}

.card p {
    margin: 0;
    color: #555;
    font-size: 0.95em;
}

.card-meta {
    display: inline-block;
    margin-top: 12px;
    color: #3498db;
    font-size: 0.9em;
    font-weight: 500;
}

.project-card {
    background-color: white;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

.profile-img {
    transition: width 0.55s cubic-bezier(.4,0,.2,1),
                height 0.55s cubic-bezier(.4,0,.2,1),
                border-radius 0.55s ease,
                margin-left 0.55s cubic-bezier(.4,0,.2,1),
                object-position 0.55s ease,
                transform 0.4s ease,
                box-shadow 0.4s ease;
}
.profile-img:not(.profile-img--expanded):hover {
    transform: scale(1.04) rotate(-2deg);
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.35);
}
.profile-img.profile-img--expanded {
    width: min(100vw, calc(90vh * 727 / 637));
    height: min(calc(100vw * 637 / 727), 90vh);
    border-radius: 6px;
    margin-left: calc(50% - min(50vw, calc(45vh * 727 / 637)));
    object-fit: cover;
    object-position: center;
    transform: none;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
    cursor: zoom-out;
}

.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    display: inline-flex;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid #dfe6ee;
    border-radius: 999px;
    padding: 3px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lang-switch button {
    border: 0;
    background: transparent;
    padding: 5px 14px;
    font: 500 0.85em 'Segoe UI', sans-serif;
    color: #7f8c8d;
    cursor: pointer;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease;
    letter-spacing: 0.04em;
}

.lang-switch button:hover {
    color: #2c3e50;
}

.lang-switch button.active {
    background: #2c3e50;
    color: white;
}

.name-swap {
    min-height: 1.3em;
    perspective: 600px;
    overflow: hidden;
}

.name-slot {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.4s ease, filter 0.4s ease;
    background: linear-gradient(90deg, #2c3e50, #3498db, #2c3e50);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: name-shine 6s linear infinite;
}

.name-slot.swap-out {
    opacity: 0;
    transform: translateY(-12px) rotateX(40deg);
    filter: blur(4px);
}

.name-slot.swap-in {
    animation: name-in 0.5s cubic-bezier(.4, 0, .2, 1), name-shine 6s linear infinite;
}

@keyframes name-in {
    from { opacity: 0; transform: translateY(14px) rotateX(-40deg); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0) rotateX(0); filter: blur(0); }
}

@keyframes name-shine {
    to { background-position: 200% center; }
}

.name-ru {
    font-weight: 400;
    opacity: 0.85;
}

.tagline {
    min-height: 1.6em;
    font-family: 'Courier New', Courier, monospace;
    color: #34495e;
}

.cursor {
    display: inline-block;
    margin-left: 2px;
    color: #3498db;
    animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
    to { visibility: hidden; }
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.card {
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        220px circle at var(--mx, 50%) var(--my, 50%),
        rgba(52, 152, 219, 0.18),
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.card:hover::before {
    opacity: 1;
}

.card-icon {
    display: inline-block;
    font-size: 1.6em;
    margin-bottom: 6px;
    color: #3498db;
    transition: transform 0.3s ease;
}
.card:hover .card-icon {
    transform: scale(1.15) rotate(8deg);
}

.section {
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.85);
}

.hero-links a {
    position: relative;
    overflow: hidden;
}
.hero-links a::after {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 0.55s ease;
}
.hero-links a:hover::after {
    left: 120%;
}