:root {
    --primary-color: #4f46e5;
    --dark-bg: #1a202c;
    --light-bg: #f8fafc;
    --text-dark: #2d3748;
    --text-light: #e2e8f0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fff;
    overflow-x: hidden;
}

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

/* --- Заголовок --- */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none; /* прибираємо підкреслення у назви сайту */
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Мобільне меню --- */
.mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: all 0.3s;
    border-radius: 2px;
}

body.nav-active .mobile-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
body.nav-active .mobile-toggle span:nth-child(2) {
    opacity: 0;
}
body.nav-active .mobile-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Секції --- */
.section {
    padding: 120px 0;
}

.section:nth-child(even) {
    background: var(--light-bg);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem auto;
    color: #64748b;
    font-size: 1.1rem;
}

.featured-image {
    max-width: 100%;
    display: block;
    margin: 0 auto 4rem auto;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* --- Головна секція --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding-top: 70px;
}

.hero-content {
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    padding: 15px 35px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

/* Варіант основної кнопки без інлайнових стилів */
.cta-primary {
    background: var(--primary-color);
    color: #fff;
}

/* Кнопки в картках завжди мають відступ зверху */
.card .cta-button {
    margin-top: 1.5rem;
    display: inline-block;
}

/* --- Карточки --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    transition: all 0.3s ease-in-out;
    opacity: 0;
    transform: translateY(40px);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Видалено блоки для інтерактивного демо, LED та кнопок копіювання як невикористані */

/* --- Підвал --- */
footer {
    background: var(--dark-bg);
    color: var(--text-light);
    padding: 4rem 0 2rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid #4a5568;
    padding-bottom: 3rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.2rem;
}

.footer-section a {
    color: #cbd5e0;
    text-decoration: none;
    display: block;
    margin: 0.5rem 0;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    color: #a0aec0;
}

.tech-article h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.tech-article h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Покращення типографіки та списків на сторінці технічних деталей */
.tech-article {
    max-width: 860px;
    margin: 0 auto;
}

.tech-article p {
    font-size: 1.05rem;
    margin: 0.75rem 0 1.25rem;
}

.tech-article ul,
.tech-article ol {
    margin: 0.25rem 0 1.25rem 0;
    padding-left: 1.25rem; /* зона для маркера всередині колонки */
    list-style-position: outside; /* зберігаємо звичний висячий відступ */
}

.tech-article li {
    margin: 0.35rem 0;
}

.tech-article li::marker {
    color: var(--primary-color);
}

.tech-article figure {
    margin-left: 0;
    margin-right: 0;
}

/* Розумні переносы та уникнення розриву таблиці/тексту */
.tech-article p,
.tech-article li,
.tech-table td,
.tech-table th {
    hyphens: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tech-table {
    margin: 1rem 0 2rem;
}

.tech-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

.tech-table th, .tech-table td {
    border: 1px solid #e2e8f0;
    padding: 12px 15px;
    text-align: left;
}

.tech-table th {
    background-color: var(--light-bg);
    font-weight: 600;
    width: 30%;
}

.tech-table td {
    background-color: #fff;
}

.source-info {
    max-width: 860px;           /* вровень з колонкою тексту */
    margin: 3rem auto 0;        /* центруємо так само, як .tech-article */
    padding: 2rem;
    background: var(--light-bg);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.source-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.source-info p {
    margin-bottom: 0;
    color: var(--text-dark);
}

.source-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.source-info a:hover {
    color: #3730a3;
    text-decoration: underline;
}

.footer-disclaimer {
    margin-bottom: 3rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}

.footer-disclaimer p {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- FAQ --- */
.faq-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 0;
}

.faq-question {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 650;
    cursor: pointer;
    padding: 0.25rem 0;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: color 0.2s ease;
}

.faq-question:hover,
.faq-question:focus-visible {
    color: var(--primary-color);
    outline: none;
}

.faq-item.open .faq-question {
    color: var(--primary-color);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"]::after {
    content: '-';
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: #475569; /* кращий контраст для читання */
    font-size: 1.05rem;
    line-height: 1.7;
    padding: 0; /* наповнення додаємо лише у відкритому стані */
}

.faq-answer p {
    margin: 0.5rem 0 0.75rem;
}

.faq-answer ul,
.faq-answer ol {
    margin: 0.25rem 0 1rem;
    padding-left: 1.25rem;
    list-style-position: outside;
}

.faq-answer li {
    margin: 0.35rem 0;
}

.faq-answer li::marker {
    color: var(--primary-color);
}

.faq-answer a {
    color: var(--primary-color);
    text-decoration: underline;
}

.faq-item.open .faq-answer {
    max-height: 1200px; /* достатньо для довгих відповідей */
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--light-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
}

/* --- Анімації та адаптивність --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 1.5rem;
        gap: 1.5rem;
        align-items: center;
        animation: fadeInUp 0.3s;
    }

    body.nav-active .nav-links {
        display: flex;
    }

    .mobile-toggle {
        display: flex;
    }
}