/*=============== GOOGLE FONTS ===============*/
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Roboto:wght@400;500&display=swap');

/*=============== CSS VARIABLES ===============*/
:root {
  /* Colors */
  --bg-color: #F8F7F4;
  --text-color: #2C3E50;
  --primary-color: #16A085;
  --primary-color-alt: #1ABC9C;
  --secondary-color: #E67E22;
  --border-color: #E0E0E0;

  /* Typography */
  --header-font: 'Playfair Display', serif;
  --body-font: 'Roboto', sans-serif;

  /* Font size */
  --big-font-size: 2.5rem;
  --h1-font-size: 2.25rem;
  --h2-font-size: 1.5rem;
  --h3-font-size: 1.125rem;
  --normal-font-size: 1rem;
  --small-font-size: 0.875rem;

  /* Other */
  --header-height: 5rem;
  --border-radius: 0.5rem;
  --transition: color .3s, background-color .3s;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--bg-color);
  color: var(--text-color);
}

h1, h2, h3 {
  font-family: var(--header-font);
  color: var(--text-color);
  font-weight: 700;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

address {
    font-style: normal;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/*=============== HEADER ===============*/
.header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--bg-color);
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
}

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

.header__logo {
  font-family: var(--header-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  transition: var(--transition);
}

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

.nav__list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-weight: 500;
  position: relative;
  transition: var(--transition);
  padding: 0.5rem 0;
}

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

.nav__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 .3s ease-in-out;
}

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

/*=============== MAIN ===============*/
.main {
    padding-top: var(--header-height); /* Offset for fixed header */
}

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

.footer__container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
}

.footer__logo {
    display: inline-block;
    font-family: var(--header-font);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer__copy {
    font-size: var(--small-font-size);
    color: #6c757d;
}

.footer__title {
    font-size: var(--h3-font-size);
    margin-bottom: 1.25rem;
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__link {
    font-size: var(--normal-font-size);
    transition: var(--transition);
}

.footer__link:hover {
    color: var(--secondary-color);
    padding-left: .25rem;
}

.footer__address {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    margin-top: 2px;
}

/*=============== MEDIA QUERIES ===============*/
@media screen and (max-width: 768px) {
  .nav {
      display: none; /* Будем реализовывать мобильное меню позже */
  }

  .footer__container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer__column {
      align-items: center;
  }

  .footer__contact-item {
      justify-content: center;
      text-align: left;
  }
}

@media screen and (max-width: 320px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/*=============== BUTTON ===============*/
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
    transition: var(--transition), transform .3s;
    cursor: pointer;
}

.button:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.button__icon {
    width: 20px;
    height: 20px;
    transition: transform .3s;
}

.button:hover .button__icon {
    transform: translateX(4px);
}

/*=============== HERO ===============*/
.hero {
    padding: 4rem 0;
    min-height: calc(90vh - var(--header-height));
    display: flex;
    align-items: center;
}

.hero__container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    gap: 3rem;
}

.hero__title {
    font-size: var(--big-font-size);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero__description {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero__image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero__image {
    width: 100%;
    max-width: 450px;
    border-radius: var(--border-radius);
}

/* Animation classes */
.hero__title,
.hero__description,
.hero__cta,
.hero__image-wrapper {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Animation delays */
.hero__title { transition-delay: 0.2s; }
.hero__description { transition-delay: 0.4s; }
.hero__cta { transition-delay: 0.6s; }
.hero__image-wrapper { transition-delay: 0.8s; }

.hero.is-visible .hero__title,
.hero.is-visible .hero__description,
.hero.is-visible .hero__cta,
.hero.is-visible .hero__image-wrapper {
    opacity: 1;
    transform: translateY(0);
}


/*=============== MEDIA QUERIES (additions) ===============*/
@media screen and (max-width: 992px) {
    :root {
        --big-font-size: 2rem;
    }
    .hero__description {
        font-size: 1rem;
    }
}


@media screen and (max-width: 768px) {
  .hero {
      padding: 3rem 0;
      text-align: center;
  }
  .hero__container {
      grid-template-columns: 1fr;
      gap: 2rem;
  }
  .hero__content {
      order: 2; /* Text appears below the image on mobile */
  }
  .hero__image-wrapper {
      order: 1;
  }
   .hero__description {
      margin-left: auto;
      margin-right: auto;
   }
}

/*=============== REUSABLE SECTION STYLES ===============*/
.section {
    padding: 5rem 0;
}

.section__header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section__title {
    font-size: var(--h1-font-size);
    margin-bottom: 1rem;
}

.section__subtitle {
    font-size: var(--h3-font-size);
    max-width: 600px;
    margin: 0 auto;
    color: #6c757d;
    font-family: var(--body-font);
    font-weight: 400;
}

/*=============== ANALYTICS ===============*/
.analytics {
    background-color: #FFFFFF;
}

.analytics__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.analytics__card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.analytics__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.1);
}

.analytics__icon-wrapper {
    margin: 0 auto 1.5rem auto;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color .3s;
}

.analytics__icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    transition: transform .3s;
}

.analytics__card:hover .analytics__icon-wrapper {
    background-color: var(--primary-color);
}

.analytics__card:hover .analytics__icon {
    color: #FFFFFF;
    transform: scale(1.1);
}

.analytics__card-title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.75rem;
}

.analytics__card-description {
    font-size: var(--normal-font-size);
    line-height: 1.6;
    color: #6c757d;
}

/* Scroll Animation */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/*=============== STRATEGY & ACCORDION ===============*/
.strategy {
    background-color: var(--bg-color); /* Or keep it same as body */
}

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

.strategy__image-wrapper {
    width: 100%;
}

.strategy__image {
    border-radius: var(--border-radius);
    width: 100%;
    height: auto;
}

.section__header--left {
    text-align: left;
    margin-bottom: 2.5rem;
}

.section__header--left .section__subtitle {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
}

.accordion__item {
    border-bottom: 1px solid var(--border-color);
}
.accordion__item:first-child {
    border-top: 1px solid var(--border-color);
}

.accordion__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    cursor: pointer;
    background-color: transparent;
    border: none;
}

.accordion__title {
    font-family: var(--body-font);
    font-size: var(--h3-font-size);
    font-weight: 500;
    color: var(--text-color);
    transition: color .3s;
}

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

.accordion__icon {
    width: 24px;
    height: 24px;
    transition: transform 0.4s ease;
    flex-shrink: 0;
}

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

.accordion__description {
    padding: 0 1rem 1.5rem 1rem;
    line-height: 1.7;
    color: #6c757d;
}

/* Accordion Open State */
.accordion__item.is-open .accordion__content {
    max-height: 300px; /* Adjust if content is taller */
    padding-top: 0;
}

.accordion__item.is-open .accordion__icon {
    transform: rotate(180deg);
}

.accordion__item.is-open .accordion__title {
    color: var(--primary-color);
}

/*=============== MEDIA QUERIES (additions) ===============*/
@media screen and (max-width: 992px) {
    .strategy__container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .strategy__image-wrapper {
        order: -1; /* Image appears on top on mobile */
        max-width: 500px;
        margin: 0 auto;
    }
    .section__header--left {
        text-align: center;
    }
     .section__header--left .section__subtitle {
        margin: 0 auto;
    }
}

/*=============== CASES ===============*/
.cases {
    background-color: #FFFFFF;
}

.cases__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.case-card {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.1);
}

.case-card__image-wrapper {
    overflow: hidden;
}

.case-card__image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

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

.case-card__category {
    display: inline-block;
    font-size: var(--small-font-size);
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.case-card__title {
    font-size: 1.25rem;
    font-family: var(--header-font);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.case-card__metric {
    background-color: #fff;
    border: 1px solid #eafaf6;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: auto; /* Pushes metric to the bottom */
    margin-bottom: 1.5rem;
    text-align: center;
}

.case-card__metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--header-font);
    color: var(--primary-color);
    line-height: 1;
}

.case-card__metric-label {
    font-size: var(--small-font-size);
    color: #6c757d;
}

.case-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
    transition: gap .3s, color .3s;
}

.case-card__link:hover {
    gap: 0.75rem;
    color: var(--secondary-color);
}

.case-card__link-icon {
    width: 18px;
    height: 18px;
}

/*=============== PUBLICATIONS ===============*/
.publications {
    background-color: var(--bg-color);
}

.publications__list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color .3s;
}

.publication-item:first-child {
    border-top: 1px solid var(--border-color);
}

.publication-item:hover {
    background-color: #fff;
}

.publication-item__meta {
    font-size: var(--normal-font-size);
    font-weight: 500;
    color: #6c757d;
    padding-top: 0.25rem;
}

.publication-item__title {
    font-family: var(--header-font);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.publication-item__title a {
    color: var(--text-color);
    transition: var(--transition);
}

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

.publication-item__excerpt {
    line-height: 1.6;
    color: var(--text-color);
}


/*=============== MEDIA QUERIES (additions) ===============*/
@media screen and (max-width: 768px) {
    .publication-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .publication-item__meta {
        font-size: var(--small-font-size);
        padding-top: 0;
    }

    .publication-item__title {
        font-size: 1.25rem;
    }
}

/*=============== CONTACT FORM ===============*/
.contact {
    background-color: #FFFFFF;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

.contact-form__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: var(--small-font-size);
}

#captcha-question {
    font-weight: bold;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-color);
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    transition: border-color .3s, box-shadow .3s;
}

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

.form-group--checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.form-group--checkbox input[type="checkbox"] {
    width: 1.25em;
    height: 1.25em;
    accent-color: var(--primary-color);
}

.form-group--checkbox label {
    font-size: var(--small-font-size);
    color: #6c757d;
}

.form-group--checkbox a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: var(--transition);
}

.form-group--checkbox a:hover {
    color: var(--secondary-color);
}

.contact-form__footer {
    text-align: center;
}

.contact-form__button {
    min-width: 200px;
}

/* Form Message Styling */
.form-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: none; /* Hidden by default */
    font-weight: 500;
}

.form-message.is-visible {
    display: block;
}

.form-message.success {
    background-color: #eafaf6;
    color: #0b8f6c;
}

.form-message.error {
    background-color: #fceeee;
    color: #c0392b;
}

/* Button loading state */
.contact-form__button.is-loading {
    pointer-events: none;
    background-color: var(--primary-color-alt);
}


/*=============== MEDIA QUERIES (additions) ===============*/
@media screen and (max-width: 768px) {
    .contact-form__grid {
        grid-template-columns: 1fr;
    }
}

/*=============== COOKIE POPUP ===============*/
.cookie-popup {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    max-width: 450px;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.15);
    z-index: 200;
    transform: translateY(200%);
    transition: transform 0.5s ease-in-out;
}

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

.cookie-popup__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cookie-popup__text {
    font-size: var(--small-font-size);
    color: var(--text-color);
}

.cookie-popup__link {
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-popup__button {
    padding: 0.75rem 1.5rem;
    flex-shrink: 0;
}

/*=============== GENERIC PAGES STYLES (privacy.html, etc.) ===============*/
.pages {
    padding: 5rem 0;
    background-color: #fff;
}

.pages .container {
    max-width: 800px;
}

.pages h1,
.pages h2 {
    font-family: var(--header-font);
    color: var(--text-color);
    margin-bottom: 1rem;
}

.pages h1 {
    font-size: var(--big-font-size);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.pages h2 {
    font-size: var(--h1-font-size);
    margin-top: 2.5rem;
}

.pages p {
    font-size: var(--normal-font-size);
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.pages ul {
    list-style: disc;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.pages li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.pages a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: underline;
    transition: var(--transition);
}

.pages a:hover {
    color: var(--secondary-color);
}

.pages strong {
    font-weight: 700;
}

/*=============== MEDIA QUERIES (additions) ===============*/
@media screen and (max-width: 768px) {
    .cookie-popup {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .cookie-popup__content {
        flex-direction: column;
        text-align: center;
    }
}