/* Основные переменные */
:root {
    --primary: #0057b7; /* синий цвет украинского флага */
    --secondary: #ffd700; /* желтый цвет украинского флага */
    --light: #f8f9fa;
    --dark: #333;
    --gray: #6c757d;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --vowel: #dc3545; /* красный для гласных */
    --consonant: #0057b7; /* синий для согласных */
    --special: #333; /* черный для специальных знаков */
    --text-color: #333;
    --bg-color: #f5f7fa;
}

/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Скрытые элементы для доступности */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
header {
    background: linear-gradient(to right, var(--primary), #004a9e);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    font-weight: 700;
}

.logo-text span {
    color: var(--secondary);
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.lang-btn.active {
    background: var(--secondary);
    color: var(--primary);
}

.lang-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
    background-color: white;
    margin-bottom: 2rem;
    border-radius: 0 0 15px 15px;
    box-shadow: var(--shadow);
}

.hero h1 {
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.hero p {
    color: var(--gray);
    max-width: 800px;
    margin: 0 auto 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.stat-item {
    background: var(--light);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

/* Красный цвет для цифры 10 (гласные буквы) */
.stat-item:nth-child(2) .stat-number {
    color: var(--vowel) !important;
}

.stat-item div:last-child {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 0.5rem;
}

/* Alphabet Section */
.alphabet-section {
    padding: 2rem 0 3rem;
}

.alphabet-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
    font-size: 1.8rem;
}

.alphabet-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .alphabet-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

.letter-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem 0.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid transparent;
}

.letter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.letter-card.vowel {
    border-color: var(--vowel);
}

.letter-card.consonant {
    border-color: var(--consonant);
}

.letter-card.special {
    border-color: var(--special);
}

.letter-card.vowel:hover {
    background: var(--vowel);
    color: white;
}

.letter-card.consonant:hover {
    background: var(--consonant);
    color: white;
}

.letter-card.special:hover {
    background: var(--special);
    color: white;
}

.letter-card .letter {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    transition: var(--transition);
}

.vowel .letter {
    color: var(--vowel);
}

.consonant .letter {
    color: var(--consonant);
}

.special .letter {
    color: var(--special);
}

.letter-card:hover .letter {
    color: white;
}

.letter-name {
    font-size: 0.9rem;
    color: var(--gray);
    transition: var(--transition);
}

.letter-card:hover .letter-name {
    color: rgba(255, 255, 255, 0.9);
}

/* Information Article */
.info-article {
    background: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.info-article h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.info-article h3 {
    color: var(--primary);
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
}

.info-article p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--dark);
}

.info-article ul, .info-article ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-article li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.info-article strong {
    color: var(--primary);
}

.seo-block {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
    border-left: 4px solid var(--secondary);
}

.seo-block h4 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.keywords {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 15px;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(50px);
    transition: transform 0.4s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header.vowel {
    background: linear-gradient(to right, var(--vowel), #c82333);
    color: white;
}

.modal-header.consonant {
    background: linear-gradient(to right, var(--consonant), #004a9e);
    color: white;
}

.modal-header.special {
    background: linear-gradient(to right, var(--special), #555);
    color: white;
}

.letter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.big-letter {
    font-size: 4rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.letter-variants {
    display: flex;
    gap: 2rem;
    font-size: 1.5rem;
    color: white;
}

.capital-letter, .small-letter {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-width: 60px;
    text-align: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    line-height: 1;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.modal-close:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

.modal-content {
    padding: 2rem;
}

.letter-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.details-section {
    margin-bottom: 1.5rem;
}

.details-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    font-size: 1.3rem;
}

.details-row {
    display: flex;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.details-label {
    font-weight: 700;
    width: 180px;
    min-width: 180px;
    color: var(--primary);
    font-size: 0.95rem;
}

.details-value {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.visual-representations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.visual-item {
    text-align: center;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    transition: var(--transition);
}

.visual-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.visual-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.morse-code {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--dark);
    font-weight: bold;
}

.braille {
    font-size: 2rem;
    color: var(--dark);
}

.sign-language {
    font-size: 3rem;
    color: var(--dark);
}

.letter-examples {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.letter-examples h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.example-item {
    background: var(--light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.example-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.example-word {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    font-size: 1.5rem;
}

.footer-logo span {
    color: var(--secondary);
}

.footer-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem;
}

.footer-nav a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.copyright {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
}

.projects {
    text-align: left;
    margin: 2rem 0;
    width: 100%;
    max-width: 800px;
}

.projects h3 {
    margin-bottom: 1rem;
    color: var(--secondary);
    font-size: 1.2rem;
}

.projects ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.projects li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.projects a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

.projects a:hover {
    text-decoration: underline;
    color: #ffed4a;
}

hr {
    border: none;
    border-top: 1px solid #555;
    margin: 1.5rem 0;
    width: 100%;
}

.development {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #aaa;
}

.development a {
    color: var(--secondary);
    text-decoration: none;
}

.development a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .stats {
        gap: 1rem;
    }
    
    .stat-item {
        padding: 0.8rem 1.2rem;
    }
    
    .details-row {
        flex-direction: column;
    }
    
    .details-label {
        width: 100%;
        margin-bottom: 0.3rem;
    }
    
    .letter-details-grid {
        grid-template-columns: 1fr;
    }
    
    .visual-representations {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .footer-nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .big-letter {
        font-size: 3rem;
    }
    
    .letter-variants {
        font-size: 1.2rem;
        gap: 1rem;
    }
    
    .info-article {
        padding: 2rem 1rem;
    }
    
    .info-article h2 {
        font-size: 1.5rem;
    }
    
    .info-article h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .alphabet-container {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .letter-card {
        padding: 1rem 0.25rem;
    }
    
    .letter-card .letter {
        font-size: 2rem;
    }
    
    .hero {
        padding: 2rem 0 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.letter-card {
    animation: fadeIn 0.5s ease forwards;
}

.letter-card:nth-child(2) { animation-delay: 0.05s; }
.letter-card:nth-child(3) { animation-delay: 0.1s; }
.letter-card:nth-child(4) { animation-delay: 0.15s; }
.letter-card:nth-child(5) { animation-delay: 0.2s; }
.letter-card:nth-child(6) { animation-delay: 0.25s; }
.letter-card:nth-child(7) { animation-delay: 0.3s; }
.letter-card:nth-child(8) { animation-delay: 0.35s; }
.letter-card:nth-child(9) { animation-delay: 0.4s; }
.letter-card:nth-child(10) { animation-delay: 0.45s; }
.letter-card:nth-child(11) { animation-delay: 0.5s; }
.letter-card:nth-child(12) { animation-delay: 0.55s; }
.letter-card:nth-child(13) { animation-delay: 0.6s; }
.letter-card:nth-child(14) { animation-delay: 0.65s; }
.letter-card:nth-child(15) { animation-delay: 0.7s; }
.letter-card:nth-child(16) { animation-delay: 0.75s; }
.letter-card:nth-child(17) { animation-delay: 0.8s; }
.letter-card:nth-child(18) { animation-delay: 0.85s; }
.letter-card:nth-child(19) { animation-delay: 0.9s; }
.letter-card:nth-child(20) { animation-delay: 0.95s; }
.letter-card:nth-child(21) { animation-delay: 1s; }
.letter-card:nth-child(22) { animation-delay: 1.05s; }
.letter-card:nth-child(23) { animation-delay: 1.1s; }
.letter-card:nth-child(24) { animation-delay: 1.15s; }
.letter-card:nth-child(25) { animation-delay: 1.2s; }
.letter-card:nth-child(26) { animation-delay: 1.25s; }
.letter-card:nth-child(27) { animation-delay: 1.3s; }
.letter-card:nth-child(28) { animation-delay: 1.35s; }
.letter-card:nth-child(29) { animation-delay: 1.4s; }
.letter-card:nth-child(30) { animation-delay: 1.45s; }
.letter-card:nth-child(31) { animation-delay: 1.5s; }
.letter-card:nth-child(32) { animation-delay: 1.55s; }
.letter-card:nth-child(33) { animation-delay: 1.6s; }
.letter-card:nth-child(34) { animation-delay: 1.65s; }

/* Оптимизация загрузки */
img, svg {
    max-width: 100%;
    height: auto;
}

/* Доступность */
:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 1001;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}