@font-face {
    font-family: 'Samim';
    src: url("../fonts/Samim.1fbc03d10ac6.woff2") format('woff2'),
         url("../fonts/Samim.fa7346efac7e.woff") format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-primary: #e5322d;
    --color-secondary: #2f2049;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f7fc;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-card-shadow: rgba(47, 32, 73, 0.06);
    --radius: 1rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1.5rem;
    --font-en: 'Inter', sans-serif;
    --font-fa: 'Samim', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-h: 4.5rem;
}

[data-theme="dark"] {
    --color-bg: #0f0d1a;
    --color-bg-alt: #1a1625;
    --color-surface: #1e1a2e;
    --color-text: #f0edf5;
    --color-text-muted: #9ca3af;
    --color-border: #2d2640;
    --color-card-shadow: rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    font-family: var(--font-en);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

[dir="rtl"] body {
    font-family: var(--font-fa);
}

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

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

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

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    transition: background var(--transition), border-color var(--transition);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .header {
    background: rgba(15, 13, 26, 0.85);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 2rem;
}

.header__logo-img {
    height: 2.5rem;
    width: auto;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav__link {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity var(--transition), color var(--transition);
    white-space: nowrap;
}

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

.header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.icon--moon { display: none; }
[data-theme="dark"] .icon--sun { display: none; }
[data-theme="dark"] .icon--moon { display: block; }

.btn-lang {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-en);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-lang:hover {
    background: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}

.header__menu-btn {
    display: none;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 1.125rem;
    height: 0.875rem;
}

.menu-icon__line {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 999px;
    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.25s ease;
    transform-origin: center;
}

.header__menu-btn.is-active .menu-icon__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header__menu-btn.is-active .menu-icon__line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.header__menu-btn.is-active .menu-icon__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--header-h);
    background: url("../images/hero-bg.9e7ecfe1d97e.png") center / cover no-repeat;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(47, 32, 73, 0.82) 0%,
        rgba(47, 32, 73, 0.6) 50%,
        rgba(47, 32, 73, 0.72) 100%
    );
    z-index: 1;
}

[data-theme="dark"] .hero::before {
    background: linear-gradient(
        160deg,
        rgba(15, 13, 26, 0.88) 0%,
        rgba(15, 13, 26, 0.7) 50%,
        rgba(15, 13, 26, 0.82) 100%
    );
}

.hero__inner {
    position: relative;
    z-index: 2;
    padding: 6rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

[dir="rtl"] .hero__inner {
    flex-direction: row;
}

.hero__text {
    flex: 1;
}

.hero__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    animation: heroLogoFloat 6s ease-in-out infinite;
}

.hero__logo-img {
    height: clamp(8rem, 18vw, 14rem);
    width: auto;
    opacity: 1;
    filter: brightness(0) invert(1) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    transition: opacity var(--transition);
}

[data-theme="dark"] .hero__logo-img {
    opacity: 0.9;
    filter: brightness(0) invert(1) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

@keyframes heroLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    color: #ffffff;
}

[data-theme="dark"] .hero__title {
    color: #f0edf5;
}

.hero__subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero .btn--ghost {
    color: #ffffff;
}

.hero .btn--ghost:hover {
    color: rgba(255, 255, 255, 0.85);
}

.hero__bg-shape {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.btn--primary:hover {
    background: #c82a26;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(229, 50, 45, 0.3);
}

.btn--outline {
    background: transparent;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn--sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.btn--ghost {
    background: transparent;
    color: inherit;
    border: none;
    padding: 0.875rem 0.5rem;
    gap: 0.5rem;
}

.btn--ghost:hover {
    color: var(--color-primary);
    transform: translateX(4px);
}

[dir="rtl"] .btn--ghost:hover {
    transform: translateX(-4px);
}

[dir="rtl"] .btn--ghost svg {
    transform: rotate(180deg);
}

.btn--full {
    width: 100%;
}

.btn__spinner {
    display: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.65s linear infinite;
    flex-shrink: 0;
}

.btn--loading {
    cursor: wait;
    opacity: 0.92;
    transform: none;
    box-shadow: none;
}

.btn--loading .btn__spinner {
    display: inline-block;
}

.btn--loading:hover {
    transform: none;
    box-shadow: none;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.contact__form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact__form-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
}

[data-theme="dark"] .contact__form-overlay {
    background: rgba(15, 13, 26, 0.55);
}

.contact__form--submitting .contact__form-overlay {
    display: flex;
}

.contact__form-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}

.contact__form--submitting .field__input,
.contact__form--submitting .field__file,
.contact__form--submitting .field__checkboxes,
.contact__form--submitting .btn {
    pointer-events: none;
}

.hero__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.section {
    padding: 6rem 0;
}

.section--alt {
    background: var(--color-bg-alt);
}

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

.section__title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-secondary);
}

[data-theme="dark"] .section__title {
    color: #f0edf5;
}

.section__tagline {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.about__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    direction: ltr; /* physical left/right controlled via order */
}

[dir="rtl"] .about__layout {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

[dir="rtl"] .about__poster {
    order: -1; /* Persian: photo on the left */
}

.about__content {
    max-width: none;
    margin: 0;
    min-width: 0;
}

[dir="rtl"] .about__content {
    direction: rtl;
    text-align: right;
}

.about__poster {
    margin: 0;
    position: relative;
    justify-self: center;
    width: min(100%, 420px);
}

.about__poster::before {
    content: "";
    position: absolute;
    inset: 12% -8% -8% 12%;
    border-radius: 28px;
    background: linear-gradient(
        145deg,
        rgba(229, 50, 45, 0.16),
        rgba(47, 32, 73, 0.12) 45%,
        transparent 70%
    );
    z-index: 0;
    filter: blur(2px);
}

.about__poster-img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center;
    border-radius: 28px;
    border: 0;
    box-shadow:
        0 2px 4px rgba(47, 32, 73, 0.04),
        0 12px 28px rgba(47, 32, 73, 0.08),
        0 32px 64px rgba(47, 32, 73, 0.12);
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.about__poster:hover .about__poster-img {
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        0 4px 8px rgba(47, 32, 73, 0.05),
        0 18px 36px rgba(47, 32, 73, 0.1),
        0 40px 72px rgba(47, 32, 73, 0.14);
}

.services__intro,
.features__intro,
.certs__intro,
.contact__intro {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.about__content p,
.services__intro p,
.features__intro p,
.certs__intro p,
.contact__intro p {
    margin-bottom: 1.25rem;
    color: var(--color-text-muted);
}

.about__content p,
.services__intro p,
.features__intro p,
.certs__intro p,
.contact__intro p,
.service-block__text,
.feature-card__desc,
.cert-item p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.about__subtitle {
    font-size: 1.25rem;
    font-weight: 650;
    margin: 2rem 0 1rem;
    color: var(--color-text);
}

.service-blocks {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.service-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.service-block__title {
    font-size: 1.25rem;
    font-weight: 650;
    margin-bottom: 0.85rem;
    color: var(--color-text);
}

.service-block__text,
.service-block__label {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.85;
    margin-bottom: 1rem;
}

.service-block__label {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.service-block__list {
    margin: 0 0 1rem;
    padding-inline-start: 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.92rem;
    line-height: 1.9;
}

.service-block__list li + li {
    margin-top: 0.25rem;
}

.service-block__groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.service-group {
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.service-group__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition);
    min-width: 0;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--color-card-shadow);
}

.feature-card__num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    opacity: 0.3;
    line-height: 1;
    margin-bottom: 1rem;
    display: block;
    font-family: var(--font-en);
}

.feature-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-card__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}

.certs__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1.25rem;
}

.cert-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}

.cert-item:hover {
    border-color: var(--color-primary);
}

.cert-item__badge {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-en);
}

.cert-item p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.clients__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: center;
}

.client-logo {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    transition: all var(--transition);
}

.client-logo:hover {
    border-color: var(--color-primary);
    transform: scale(1.03);
}

.client-logo img {
    max-height: 85px;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all var(--transition);
}

.client-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

.catalogs__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

.catalog-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--color-card-shadow);
}

.catalog-card__img {
    height: 200px;
    overflow: hidden;
    background: var(--color-bg-alt);
}

.catalog-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.catalog-card:hover .catalog-card__img img {
    transform: scale(1.05);
}

.catalog-card__body {
    padding: 1.5rem;
}

.catalog-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.catalog-card__desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.contact__wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 3rem;
    align-items: start;
}

.contact__info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.contact__item svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--color-primary);
    margin-top: 0.15rem;
}

.contact__item-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.contact__item-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.contact__note {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-top: 0.5rem;
}

.contact__form-heading {
    font-size: 1.05rem;
    font-weight: 650;
    margin: 0 0 0.5rem;
    color: var(--color-text);
}

.field--checkboxes > div {
    margin: 0.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1.25rem;
}

.field--checkboxes[data-field="project_field"] > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field--checkboxes > div > div {
    min-width: 0;
}

.field--checkboxes > div label {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.45;
    cursor: pointer;
}

.field--checkboxes input[type="checkbox"] {
    margin-top: 0.15rem;
    accent-color: var(--color-primary);
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
}

.field__help {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0.25rem 0 0.5rem;
    line-height: 1.6;
}

.field__file {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.num-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1;
}

[dir="rtl"] .num-ltr {
    text-align: left;
}

[dir="rtl"] .contact__item-body .num-ltr {
    display: block;
    width: 100%;
    text-align: right;
}

[dir="rtl"] input.field__input--phone:placeholder-shown {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] input.field__input--phone:not(:placeholder-shown),
[dir="rtl"] input.field__input--phone:focus:not(:placeholder-shown) {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] input.field__input--email {
    direction: rtl;
    text-align: right;
}

.form-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.field__label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.field__input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-bg-alt);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    transition: all var(--transition);
    outline: none;
}

.field__input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.1);
}

.field--error .field__input {
    border-color: var(--color-primary);
}

.field__error {
    font-size: 0.8rem;
    color: var(--color-primary);
}

textarea.field__input {
    resize: vertical;
    min-height: 120px;
}

.footer {
    background: var(--color-secondary);
    color: #f0edf5;
    padding: 3rem 0;
}

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

.footer__logo {
    height: 5.5rem;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer__contact {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.9rem;
}

.footer__contact a {
    opacity: 0.8;
    transition: opacity var(--transition);
}

.footer__contact a:hover {
    opacity: 1;
}

.footer__copy {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.text-muted {
    color: var(--color-text-muted);
    text-align: center;
}

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

[dir="rtl"] .toast-container {
    right: auto;
    left: 2rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 24px var(--color-card-shadow);
    animation: slideIn 0.3s ease-out;
}

.toast--success {
    border-color: #10b981;
    color: #10b981;
}

.toast--error {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.anim-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.anim-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

[dir="rtl"] @keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Blog */

.blog-hero {
    padding-top: calc(var(--header-h) + 3rem);
}

.blog__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 1.5rem;
}

.blog-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--color-card-shadow);
    border-color: var(--color-primary);
}

.blog-card__body {
    padding: 2rem;
}

.blog-card__date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-family: var(--font-en);
    display: block;
    margin-bottom: 0.75rem;
}

.blog-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.blog-card__title a {
    transition: color var(--transition);
}

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

.blog-card__excerpt {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.blog-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: gap var(--transition);
}

.blog-card__link:hover {
    gap: 0.625rem;
}

[dir="rtl"] .blog-card__link svg {
    transform: rotate(180deg);
}

.blog__view-all {
    text-align: center;
    margin-top: 2.5rem;
}

.blog__view-all .btn {
    gap: 0.5rem;
}

[dir="rtl"] .blog__view-all svg {
    transform: rotate(180deg);
}

.blog__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.blog__pagination-info {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-family: var(--font-en);
}

/* Blog detail */

.blog-detail__header {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.blog-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    transition: color var(--transition);
}

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

[dir="rtl"] .blog-detail__back svg {
    transform: rotate(180deg);
}

.blog-detail__title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

[data-theme="dark"] .blog-detail__title {
    color: #f0edf5;
}

.blog-detail__date {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-family: var(--font-en);
}

.blog-detail__content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.9;
    font-family: var(--font-en);
    direction: ltr;
    text-align: left;
    overflow-wrap: break-word;
    word-break: break-word;
}

.blog-detail__content p {
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
}

@media (max-width: 1100px) {
    .header__nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem 1.5rem 1.75rem;
        gap: 0.25rem;
        transform: translateY(-8px) scale(0.98);
        transform-origin: top center;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        box-shadow: 0 18px 40px rgba(47, 32, 73, 0.08);
        transition:
            transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
            opacity 0.35s ease,
            visibility 0.45s ease,
            box-shadow 0.45s ease;
        z-index: 999;
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    [data-theme="dark"] .header__nav {
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    }

    .header__nav.is-open {
        transform: translateY(0) scale(1);
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        box-shadow: 0 20px 48px rgba(47, 32, 73, 0.12);
    }

    [data-theme="dark"] .header__nav.is-open {
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
    }

    .header__nav .nav__link {
        opacity: 0;
        transform: translateY(-10px);
        padding: 0.75rem 0.5rem;
        border-radius: var(--radius-sm);
        white-space: normal;
        transition:
            opacity 0.35s ease,
            transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
            background var(--transition),
            color var(--transition);
        transition-delay: 0s;
    }

    .header__nav .nav__link:hover {
        background: var(--color-bg-alt);
    }

    .header__nav.is-open .nav__link {
        opacity: 1;
        transform: translateY(0);
    }

    .header__nav.is-open .nav__link:nth-child(1) { transition-delay: 0.05s; }
    .header__nav.is-open .nav__link:nth-child(2) { transition-delay: 0.09s; }
    .header__nav.is-open .nav__link:nth-child(3) { transition-delay: 0.13s; }
    .header__nav.is-open .nav__link:nth-child(4) { transition-delay: 0.17s; }
    .header__nav.is-open .nav__link:nth-child(5) { transition-delay: 0.21s; }
    .header__nav.is-open .nav__link:nth-child(6) { transition-delay: 0.25s; }
    .header__nav.is-open .nav__link:nth-child(7) { transition-delay: 0.29s; }
    .header__nav.is-open .nav__link:nth-child(8) { transition-delay: 0.33s; }

    .header__menu-btn {
        display: flex;
    }

    body.menu-open {
        overflow: hidden;
    }

    .features__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-block__groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clients__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

    .field--checkboxes[data-field="project_field"] > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .about__layout,
    [dir="rtl"] .about__layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about__poster,
    [dir="rtl"] .about__poster {
        justify-self: center;
        width: min(100%, 340px);
        order: -1; /* same as English: poster above text */
    }

    .about__poster::before {
        inset: 10% -6% -6% 10%;
        border-radius: 24px;
    }

    .about__poster-img {
        border-radius: 24px;
    }

    .hero__inner,
    [dir="ltr"] .hero__inner,
    [dir="rtl"] .hero__inner {
        flex-direction: column;
        padding-block: 3rem;
        gap: 2rem;
    }

    [dir="ltr"] .hero__inner {
        direction: ltr;
        align-items: flex-start;
        text-align: left;
    }

    [dir="rtl"] .hero__inner {
        direction: rtl;
        align-items: flex-start;
        text-align: right;
    }

    [dir="ltr"] .hero__logo,
    [dir="ltr"] .hero__text {
        direction: ltr;
        text-align: left;
    }

    [dir="rtl"] .hero__logo,
    [dir="rtl"] .hero__text {
        direction: rtl;
        text-align: right;
    }

    .hero__logo-img {
        height: 5rem;
    }

    .hero__title {
        font-size: 2rem;
    }

    [dir="ltr"] .hero__subtitle {
        margin-left: 0;
        margin-right: auto;
    }

    [dir="rtl"] .hero__subtitle {
        margin-left: auto;
        margin-right: 0;
    }

    .hero__actions {
        justify-content: flex-start;
        width: 100%;
    }

    .hero__actions .btn {
        flex: 1 1 auto;
        min-width: min(100%, 10rem);
        justify-content: center;
    }

    .section {
        padding: 3.5rem 0;
    }

    .section__header {
        margin-bottom: 2rem;
    }

    .section__tagline {
        font-size: 0.95rem;
        padding-inline: 0.25rem;
    }

    .about__content,
    .services__intro,
    .features__intro,
    .certs__intro,
    .contact__intro {
        margin-bottom: 1.5rem;
    }

    .catalogs__grid,
    .blog__grid {
        grid-template-columns: 1fr;
    }

    .features__grid {
        grid-template-columns: 1fr;
    }

    .service-block__groups {
        grid-template-columns: 1fr;
    }

    .service-block,
    .feature-card {
        padding: 1.25rem;
    }

    .service-block__title {
        font-size: 1.1rem;
    }

    .service-block__list {
        padding-inline-start: 1.1rem;
        font-size: 0.88rem;
    }

    .certs__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .cert-item {
        padding: 1rem 0.75rem;
    }

    .clients__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .client-logo {
        padding: 0.75rem;
        min-height: 80px;
    }

    .client-logo img {
        max-height: 55px;
    }

    .contact__item {
        font-size: 0.875rem;
    }

    .contact__form {
        gap: 1rem;
    }

    .field--checkboxes > div,
    .field--checkboxes[data-field="project_field"] > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem 0.75rem;
    }

    .field--checkboxes > div label {
        font-size: 0.78rem;
    }

    .footer__inner {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
    }

    .footer__logo {
        height: 4rem;
    }

    .footer__contact {
        align-items: center;
    }

    .blog-hero {
        padding-top: calc(var(--header-h) + 2rem);
    }

    .blog-card__body {
        padding: 1.25rem;
    }

    .blog-detail__header {
        margin-bottom: 2rem;
    }

    .blog-detail__title {
        font-size: 1.5rem;
    }

    .blog-detail__back {
        margin-bottom: 1.25rem;
    }

    .blog-detail__content {
        font-size: 0.95rem;
    }

    .catalog-card__body {
        padding: 1.25rem;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }

    [dir="rtl"] .toast-container {
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .header__inner {
        gap: 0.75rem;
    }

    .header__logo-img {
        height: 2.1rem;
    }

    .hero {
        min-height: auto;
        padding-bottom: 3rem;
    }

    .hero__title {
        font-size: 1.65rem;
    }

    .hero__subtitle {
        font-size: 0.95rem;
    }

    .hero__logo-img {
        height: 4rem;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero__actions .btn {
        width: 100%;
        min-width: 0;
    }

    .about__poster {
        width: min(100%, 300px);
    }

    .about__poster-img {
        border-radius: 22px;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .btn--sm {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }

    .section__title {
        font-size: 1.45rem;
    }

    .about__subtitle {
        font-size: 1.1rem;
    }

    .features__grid {
        grid-template-columns: 1fr;
    }

    .certs__grid {
        grid-template-columns: 1fr;
    }

    .clients__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section {
        padding: 2.5rem 0;
    }

    .footer {
        padding: 2rem 0;
    }

    .blog__pagination {
        gap: 0.75rem;
    }

    .field--checkboxes > div {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .field--checkboxes[data-field="project_field"] > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.3rem 0.6rem;
    }

    .field--checkboxes > div label {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .field__input,
    .field__file {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
}

@media (max-width: 1100px) and (prefers-reduced-motion: reduce) {
    .header__nav,
    .header__nav .nav__link,
    .menu-icon__line {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    .header__nav {
        transform: none;
    }

    .header__nav .nav__link {
        transform: none;
    }
}
