/* ==================== GLOBAL STYLES & VARIABLES ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --bg-color: #111827;
    --surface-color: #1F2937;
    --primary-text-color: #F3F4F6;
    --secondary-text-color: #9CA3AF;
    --accent-color: #22d3ee;
    --border-color: #374151;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

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

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

ul {
    list-style: none;
}

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

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

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

.header__logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-text-color);
}
.header__logo:hover {
    color: var(--primary-text-color);
}

.header__menu {
    display: flex;
    gap: 30px;
}

.header__menu-link {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.header__menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.header__menu-link:hover::after {
    width: 100%;
}

.header__burger {
    display: none;
    background: none;
    border: none;
    color: var(--primary-text-color);
    cursor: pointer;
    z-index: 1001;
}

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

.footer__container {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer__logo {
    font-size: 1.75rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 15px;
}
.footer__logo:hover {
    color: var(--primary-text-color);
}

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

.footer__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-text-color);
}

.footer__list li {
    margin-bottom: 10px;
}

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

.footer__link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer__list--contacts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer__contact-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 4px;
    color: var(--secondary-text-color);
}

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

/* ==================== ADAPTIVE STYLES ==================== */
@media (max-width: 992px) {
    .footer__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 73px; /* Height of the header */
    }
    .header__nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
    }

    .header__nav.is-active {
        transform: translateX(0);
    }

    .header__menu {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .header__menu-link {
        font-size: 1.5rem;
    }

    .header__burger {
        display: block;
    }
    
    .footer__container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer__column--about, .footer__list--contacts li {
        align-items: center;
        justify-content: center;
    }
    
    .footer__description {
        margin: 0 auto;
    }
}

/* ==================== REUSABLE COMPONENTS (BUTTON) ==================== */
.button {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-weight: 700;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    text-align: center;
}

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

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 100px 0;
    text-align: center;
}

.hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero__container {
    position: relative;
    z-index: 2;
}

.hero__content {
    max-width: 750px;
    margin: 0 auto;
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--primary-text-color);
    margin-bottom: 20px;
    line-height: 1.2;
    min-height: 170px; /* Фиксированная высота для предотвращения "прыжков" текста */
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--secondary-text-color);
    margin-bottom: 40px;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
    }
    
    .hero__title {
        min-height: 120px;
    }

    .hero__subtitle {
        font-size: 1rem;
    }
}

/* ==================== GENERIC SECTION STYLES ==================== */
.section {
    padding: 80px 0;
}

.section__header {
    text-align: center;
    margin-bottom: 60px;
}

.section__title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-text-color);
}

.section__subtitle {
    font-size: 1.125rem;
    color: var(--secondary-text-color);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}


/* ==================== STORIES SECTION ==================== */
.stories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.story-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    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 10px 25px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--accent-color);
}

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

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

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

.story-card__content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Makes content fill the space */
}

.story-card__tags {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    background-color: rgba(34, 211, 238, 0.1);
    color: var(--accent-color);
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-card__title {
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 700;
    margin-bottom: 15px;
    flex-grow: 1; /* Pushes meta to the bottom */
}

.story-card__title a {
    color: var(--primary-text-color);
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s;
}

.story-card__title a:hover {
    color: var(--primary-text-color);
    background-size: 100% 2px;
}

.story-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--secondary-text-color);
    margin-top: auto; /* Pushes meta to the bottom */
}

.story-card__author {
    font-weight: 500;
    color: var(--primary-text-color);
}

.story-card__reading-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.story-card__reading-time i {
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }
    .section__header {
        margin-bottom: 40px;
    }
    .stories__grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== PROFESSIONS SECTION ==================== */
.professions {
    background-color: var(--surface-color);
}

.professions__component {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.professions__nav {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px; /* For scrollbar */
}

.professions__nav-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    color: var(--secondary-text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.professions__nav-button:hover {
    color: var(--primary-text-color);
    background-color: rgba(243, 244, 246, 0.05);
}

.professions__nav-button.is-active {
    color: var(--accent-color);
    background-color: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
}

.professions__nav-button i {
    width: 20px;
    height: 20px;
}

.professions__content {
    position: relative;
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-height: 300px;
}

.professions__pane {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.professions__pane.is-active {
    display: block;
}

.professions__pane-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-text-color);
}

.professions__pane-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--secondary-text-color);
    margin-bottom: 25px;
}

.professions__quote {
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
    margin-bottom: 25px;
    font-style: italic;
    color: var(--primary-text-color);
}

.professions__quote footer {
    font-style: normal;
    font-weight: 500;
    color: var(--secondary-text-color);
    margin-top: 10px;
    font-size: 0.9rem;
}

.professions__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    font-weight: 700;
}

.professions__link i {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.professions__link:hover i {
    transform: translateX(5px);
}

/* Keyframes for fade-in effect */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Desktop layout */
@media (min-width: 768px) {
    .professions__component {
        flex-direction: row;
        gap: 40px;
    }
    
    .professions__nav {
        flex-direction: column;
        overflow-x: visible;
        padding-bottom: 0;
        gap: 15px;
        align-items: flex-start;
        flex: 0 0 200px; /* Nav width */
    }

    .professions__nav-button {
        width: 100%;
    }

    .professions__content {
        flex-grow: 1;
        padding: 40px;
    }
}

/* ==================== TOOLS SECTION ==================== */
.tools__grid {
    display: grid;
    /* Умная сетка, которая адаптирует количество колонок */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.tool-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    
    /* Стили для анимации появления */
    opacity: 0;
    transform: translateY(20px);
}

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

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.tool-card__logo {
    height: 50px;
    width: 50px;
    margin: 0 auto 20px auto;
    object-fit: contain;
    /* Для SVG логотипов может понадобиться filter для инверсии цвета на темной теме */
    /* filter: invert(100%) brightness(200%); */
}

.tool-card__name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-text-color);
}

.tool-card__description {
    font-size: 0.875rem;
    color: var(--secondary-text-color);
    line-height: 1.4;
}

@media (max-width: 480px) {
    .tools__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    .tool-card {
        padding: 20px;
    }
}

/* ==================== OPINIONS SECTION ==================== */
.opinions {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

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

.opinions__topic {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background-color: rgba(17, 24, 39, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.opinions__topic i {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    margin-top: 4px;
}

.opinions__topic-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.5;
}

.opinions__list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.opinion-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-top: none;
}
/* Скругляем углы у последней карточки */
.opinions__list .opinion-card:last-child {
    border-radius: 0 0 12px 12px;
}

.opinion-card__header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.opinion-card__avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.opinion-card__author-name {
    font-weight: 700;
    color: var(--primary-text-color);
}

.opinion-card__author-title {
    font-size: 0.875rem;
    color: var(--secondary-text-color);
}

.opinion-card__body {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--secondary-text-color);
}

.opinion-card__body p {
    margin: 0;
}

/* ==================== CONTACT SECTION ==================== */
.contact__form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form__group {
    margin-bottom: 20px;
}

.form__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-text-color);
}

.form__input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-text-color);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form__input::placeholder {
    color: #4b5563; /* Tailwind gray-600 */
}

.form__input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

/* Captcha styling */
.form__group--captcha {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

/* Checkbox styling */
.form__group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 30px;
}

.form__checkbox {
    flex-shrink: 0;
    margin-top: 5px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color); /* Modern way to style checkboxes */
}

.form__label--checkbox {
    font-size: 0.875rem;
    color: var(--secondary-text-color);
    line-height: 1.5;
}

.form__link {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-color: rgba(34, 211, 238, 0.5);
}
.form__link:hover {
    text-decoration-color: var(--accent-color);
}

.contact__button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}
.contact__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form__message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none; /* Hidden by default */
}

.form__message.is-success {
    display: block;
    background-color: rgba(16, 185, 129, 0.1); /* Green-100 with opacity */
    color: #10b981; /* Green-500 */
}

.form__message.is-error {
    display: block;
    background-color: rgba(239, 68, 68, 0.1); /* Red-100 with opacity */
    color: #ef4444; /* Red-500 */
}

@media (max-width: 480px) {
    .contact__form-wrapper {
        padding: 20px;
    }
}
/* ==================== COOKIE POP-UP ==================== */
.cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    z-index: 2000;
    transform: translateY(150%);
    transition: transform 0.5s ease-in-out;
}

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

.cookie-popup__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-popup__text {
    color: var(--secondary-text-color);
    margin: 0;
}

.cookie-popup__link {
    color: var(--accent-color);
    text-decoration: underline;
}

.cookie-popup__button {
    flex-shrink: 0;
    padding: 8px 20px;
}

@media (max-width: 768px) {
    .cookie-popup__content {
        flex-direction: column;
        text-align: center;
    }
}

/* ==================== GENERIC PAGES STYLING ==================== */
/* (e.g., privacy.html, terms.html) */
.pages {
    padding: 120px 0 80px 0; /* Доп. отступ сверху из-за фикс. хедера */
    min-height: 80vh;
}

.pages h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--primary-text-color);
}

.pages h2 {
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--primary-text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.pages p, .pages li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--secondary-text-color);
    margin-bottom: 20px;
    max-width: 80ch; /* Оптимальная длина строки для чтения */
}

.pages a {
    color: var(--accent-color);
    text-decoration: underline;
}

.pages ul, .pages ol {
    padding-left: 25px;
}

.pages strong {
    color: var(--primary-text-color);
    font-weight: 500;
}