/* ==================== GLOBAL STYLES ==================== */
:root {
    /* Colors */
    --background-color: #111827;
    --text-color: #E5E7EB;
    --primary-color: #6366F1;
    --primary-color-hover: #4F46E5;
    --border-color: #374151;
    --surface-color: #1F2937;
    --heading-color: #FFFFFF;
    
    /* Typography */
    --font-family-sans: 'Inter', sans-serif;
    --font-family-heading: 'Manrope', sans-serif;
    
    /* Spacing */
    --container-width: 1140px;
    --container-padding: 1.5rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.6;
}

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-family-heading);
    color: var(--heading-color);
    line-height: 1.3;
}

ul {
    list-style: none;
}

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 5rem;
}

.header__logo {
    font-family: var(--font-family-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading-color);
}

.header__logo:hover {
    color: var(--heading-color);
}

.header__nav {
    display: none; /* Mobile first: hide on small screens */
}

.header__menu {
    display: flex;
    gap: 2.5rem;
}

.header__menu-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.header__menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-in-out;
}

.header__menu-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header__mobile-menu-button {
    background: none;
    border: none;
    color: var(--heading-color);
    cursor: pointer;
    padding: 0.5rem;
}

/* Show navigation on larger screens */
@media (min-width: 768px) {
    .header__nav {
        display: block;
    }
    .header__mobile-menu-button {
        display: none;
    }
}

/* ==================== FOOTER ==================== */
.footer {
    background-color: var(--surface-color);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer__grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

.footer__logo {
    font-family: var(--font-family-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--heading-color);
    display: inline-block;
    margin-bottom: 1rem;
}

.footer__tagline {
    color: var(--text-color);
    max-width: 300px;
}

.footer__heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer__list li {
    margin-bottom: 0.75rem;
}

.footer__link {
    color: var(--text-color);
}

.footer__link:hover {
    color: var(--primary-color);
}

.footer__list--contacts li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer__contact-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-color);
}

/* ==================== REUSABLE COMPONENTS ==================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    border-radius: 0.5rem;
    font-family: var(--font-family-sans);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.button--primary {
    background-color: var(--primary-color);
    color: var(--heading-color);
}

.button--primary:hover {
    background-color: var(--primary-color-hover);
    color: var(--heading-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.button__icon {
    width: 20px;
    height: 20px;
}


/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem; /* Header height */
    overflow: hidden;
    position: relative;
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 4rem;
}

@media (min-width: 992px) {
    .hero__container {
        grid-template-columns: 1.2fr 1fr;
    }
}

.hero__title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .hero__title {
        font-size: 3.5rem;
    }
}

.hero__title-animated-container {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    /* Базова висота для мобільної версії (під шрифт 2.5rem) */
    height: 2.8rem;
    vertical-align: bottom;
    overflow: hidden;
    /* Невелике налаштування для кращого візуального вирівнювання */
    margin-bottom: -0.6rem;
}

.hero__title-animated-word {
    position: absolute;
    left: 0;
    top: 100%;
    opacity: 0;
    transition: top 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.hero__title-animated-word--visible {
    top: 0;
    opacity: 1;
}

.hero__title-animated-word--hidden-top {
    top: -100%;
    opacity: 0;
}

.hero__subtitle {
    font-size: 1.1rem;
    max-width: 550px;
    margin-bottom: 2.5rem;
    color: var(--text-color);
}

.hero__visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero__image {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    position: relative;
    z-index: 2;
    background-color: var(--surface-color); /* To hide shapes behind it */
}

/* Abstract shapes for visual interest */
.hero__visual-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-hover));
    filter: blur(80px);
    z-index: 1;
}

.hero__visual-bg-shape--1 {
    width: 250px;
    height: 250px;
    top: -50px;
    right: -50px;
    opacity: 0.5;
}

.hero__visual-bg-shape--2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    opacity: 0.4;
}

/* ==================== SECTION HEADER (Reusable) ==================== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header__title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .section-header__title {
        font-size: 3rem;
    }
}

.section-header__subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
}

/* ==================== STORIES SECTION ==================== */
.stories {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.stories__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 640px) {
    .stories__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .stories__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

.story-card {
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
}

.story-card__link-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.story-card__image-container {
    position: relative;
    overflow: hidden;
}

.story-card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.story-card:hover .story-card__image {
    transform: scale(1.05);
}

.story-card__category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.story-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.story-card__title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    flex-grow: 1;
    color: var(--heading-color);
}

.story-card__author {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}
/* ==================== INSIGHTS SECTION ==================== */
.insights {
    padding-top: 6rem;
    padding-bottom: 6rem;
    background-color: var(--surface-color); /* A slightly different background to separate sections */
}

.insights__accordion {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--heading-color);
}

.accordion-item__title {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-family-sans);
}

.accordion-item__icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.accordion-item--active .accordion-item__icon {
    transform: rotate(180deg);
}

.accordion-item__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.accordion-item__content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    line-height: 1.7;
}

/* Add to REUSABLE COMPONENTS section */
.button--secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.button--secondary:hover {
    background-color: var(--primary-color);
    color: var(--heading-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

/* ==================== CASES SECTION ==================== */
.cases {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.cases__list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.case-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: box-shadow 0.3s ease;
}

.case-card:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.1);
}

@media (min-width: 768px) {
    .case-card {
        grid-template-columns: 120px 1fr;
        align-items: flex-start;
        gap: 2.5rem;
        padding: 2.5rem;
    }
}

.case-card__logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--background-color);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    margin: 0 auto; /* Center on mobile */
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .case-card__logo-container {
        width: 120px;
        height: 120px;
        margin: 0;
    }
}

.case-card__logo {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.case-card__details {
    text-align: center; /* On mobile */
}

@media (min-width: 768px) {
    .case-card__details {
        text-align: left;
    }
}

.case-card__title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.case-card__challenge {
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.case-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center; /* On mobile */
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .case-card__metrics {
        justify-content: flex-start;
    }
}

.case-card__metric {
    text-align: left;
}

.case-card__metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-family-heading);
    color: var(--primary-color);
}

.case-card__metric-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* ==================== COMMUNITY SECTION ==================== */
.community {
    padding-top: 6rem;
    padding-bottom: 6rem;
    position: relative;
    overflow: hidden;
    background-color: var(--background-color); /* Fallback */
}

/* Add a subtle decorative background */
.community::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1), transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
}

.community__container {
    position: relative;
    z-index: 1;
}

.community__main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

@media (min-width: 992px) {
    .community__main-content {
        grid-template-columns: 2fr 1.5fr;
        align-items: center;
    }
}

.community__title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .community__title {
        font-size: 3rem;
    }
}

.community__subtitle {
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 2rem;
}

.community__socials {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.community__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .community__stats {
        gap: 2rem;
    }
}

.stat-card {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card__value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-family-heading);
    color: var(--primary-color);
}

.stat-card__label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.community__cta {
    text-align: center;
    background-color: var(--surface-color);
    padding: 3rem 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.community__cta-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.community__cta-text {
    margin-bottom: 1.5rem;
}
/* ==================== CONTACT SECTION ==================== */
.contact {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.contact__wrapper {
    max-width: 650px;
    margin: 0 auto;
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .contact__wrapper {
        padding: 3rem;
    }
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input::placeholder {
    color: #6B7280;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input.is-invalid {
    border-color: #EF4444;
}

.form-error-message {
    color: #F87171;
    font-size: 0.8rem;
    position: absolute;
    left: 0;
    bottom: -1.2rem;
}

.form-group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.form-group--checkbox input[type="checkbox"] {
    margin-top: 5px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.form-group--checkbox label {
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-link {
    text-decoration: underline;
}

.contact-form__button {
    width: 100%;
    margin-top: 1rem;
}

.contact-form__button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.contact-form__success-message {
    display: none; /* Hidden by default */
    text-align: center;
    padding: 2rem 0;
}

.contact-form__success-icon {
    color: #34D399; /* A success green */
    margin-bottom: 1.5rem;
}

.contact-form__success-icon i {
    width: 64px;
    height: 64px;
}

.contact-form__success-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* ==================== COOKIE POPUP ==================== */
.cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    z-index: 200;
    transform: translateY(120%);
    transition: transform 0.5s ease-in-out;
}

.cookie-popup.is-visible {
    transform: translateY(0);
}

.cookie-popup__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .cookie-popup__container {
        flex-direction: row;
    }
}

.cookie-popup__text {
    font-size: 0.9rem;
    text-align: center;
}

@media (min-width: 768px) {
    .cookie-popup__text {
        text-align: left;
    }
}

.cookie-popup__link {
    text-decoration: underline;
}

.cookie-popup__button {
    flex-shrink: 0;
}

/* ==================== GENERIC PAGES (TERMS, PRIVACY, etc.) ==================== */
.pages {
    padding-top: 8rem; /* 5rem header + 3rem space */
    padding-bottom: 6rem;
}

.pages .container {
    max-width: 800px; /* Narrower container for better readability */
}

.pages h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    font-weight: 800;
}

.pages h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.pages p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.pages ul,
.pages ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem; /* Standard indentation */
}

.pages li {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.pages strong {
    font-weight: 600;
    color: var(--heading-color);
}

.pages a {
    text-decoration: underline;
}

.pages a:hover {
    text-decoration: none;
}