/* ==========================================================================
   Almas Preform — minimal, bidirectional (RTL/LTR) stylesheet
   Uses CSS logical properties (margin-inline, inset-inline, text-align:start)
   so the same rules work for fa/ar (rtl) and en (ltr).
   ========================================================================== */

:root {
    --ink: #0d1b2a;
    --text: #33414f;
    --muted: #6b7785;
    --line: #e4e9ee;
    --bg: #ffffff;
    --soft: #f3f6f8;
    --primary: #0b6e7f;
    --primary-600: #095a68;
    --primary-50: #e7f3f5;
    --accent: #5fc4d4;
    --dark: #0c1c26;
    --success: #1f8a5b;
    --danger: #c0392b;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(13, 27, 42, .04), 0 8px 24px rgba(13, 27, 42, .06);
    --container: 1200px;
    --header-h: 76px;

    --font: "Vazirmatn", "Inter", system-ui, sans-serif;
}

html[lang="en"] { --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-align: start;
}
html[lang="en"] body { line-height: 1.65; }

body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.35; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-600); }
img, svg { max-width: 100%; }
ul, ol { padding-inline-start: 1.2em; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container--narrow { max-width: 860px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.075rem; color: var(--text); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; inset-inline-start: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 6px 12px; border-radius: 8px; }
.skip-link:focus { inset-inline-start: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Icons ---------- */
.icon { flex: none; vertical-align: -0.2em; }
[dir="rtl"] .icon--dir { transform: scaleX(-1); }
.icon--back { transform: scaleX(-1); }
[dir="rtl"] .icon--dir.icon--back { transform: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: .65em 1.3em; border-radius: 999px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.4;
    cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--lg { padding: .85em 1.6em; font-size: 1rem; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-600); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--light { background: #fff; color: var(--primary); }
.btn--light:hover { background: var(--primary-50); color: var(--primary-600); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn--outline-light:hover { border-color: #fff; color: #fff; }

.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; }
.link-arrow .icon { transition: translate .2s; }
.link-arrow:hover .icon { translate: 4px 0; }
[dir="rtl"] .link-arrow:hover .icon { translate: -4px 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .5em;
    font-size: .85rem; font-weight: 600; color: var(--primary);
    margin-bottom: .75rem;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; border-radius: 2px; }

.badge {
    display: inline-block; padding: .2em .8em; border-radius: 999px;
    background: var(--primary-50); color: var(--primary); font-size: .8rem; font-weight: 600;
}
.badge--muted { background: var(--soft); color: var(--muted); }
.badge--light { background: rgba(255, 255, 255, .9); color: var(--ink); }

.chip {
    display: inline-flex; align-items: center; gap: .35em;
    padding: .4em 1em; border-radius: 999px; border: 1px solid var(--line);
    color: var(--text); font-size: .9rem; background: #fff; transition: all .2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }

.count {
    display: inline-grid; place-items: center; min-width: 1.8em; height: 1.8em; padding-inline: .4em;
    border-radius: 999px; background: var(--soft); color: var(--muted); font-size: .75rem; font-weight: 600;
}

.meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: .35em; }
.meta .icon { width: 16px; height: 16px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--dark); color: rgba(255, 255, 255, .75); font-size: .82rem; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; }
.topbar__info { display: flex; align-items: center; gap: 1.5rem; }
.topbar__info a, .topbar__info span { display: inline-flex; align-items: center; gap: .4em; color: inherit; }
.topbar__info a:hover { color: #fff; }
.topbar .icon { width: 15px; height: 15px; opacity: .8; }

/* ---------- Language switcher ---------- */
.lang { position: relative; }
.lang summary { list-style: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang__toggle {
    display: inline-flex; align-items: center; gap: .4em; cursor: pointer;
    padding: .25em .75em; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2);
    color: #fff; user-select: none; transition: background .2s;
}
.lang__toggle:hover { background: rgba(255, 255, 255, .08); }
.lang__chev { transition: transform .2s; }
.lang[open] .lang__chev { transform: rotate(180deg); }
.lang__menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60;
    min-width: 180px; margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.lang__item {
    display: flex; align-items: center; gap: .6em; padding: .5em .7em; border-radius: 8px;
    color: var(--ink); font-size: .9rem;
}
.lang__item:hover { background: var(--soft); color: var(--ink); }
.lang__item.is-active { color: var(--primary); font-weight: 600; }
.lang__item[lang="en"] { font-family: "Inter", system-ui, sans-serif; }
.lang__item[lang="fa"], .lang__item[lang="ar"] { font-family: "Vazirmatn", system-ui, sans-serif; }
.lang__code {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
    background: var(--soft); font-size: .75rem; font-weight: 700;
}
.lang__check { margin-inline-start: auto; color: var(--primary); }

/* ---------- Header ---------- */
.header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 16px rgba(13, 27, 42, .04); }
.header__inner { display: flex; align-items: center; gap: 2rem; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 40px; height: 40px; color: var(--primary); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 1.1rem; font-weight: 800; }
.brand__text small { font-size: .72rem; color: var(--muted); }
.brand--light, .brand--light:hover { color: #fff; }
.brand--light .brand__mark { color: var(--accent); }
.brand--light small { color: rgba(255, 255, 255, .55); }

.nav { display: flex; align-items: center; gap: .25rem; margin-inline-start: auto; }
.nav__link {
    position: relative; padding: .5em .85em; color: var(--text); font-weight: 500; font-size: .95rem; border-radius: 8px;
}
.nav__link:hover { color: var(--ink); background: var(--soft); }
.nav__link.is-active { color: var(--primary); }
.nav__link.is-active::after {
    content: ""; position: absolute; inset-inline: .85em; bottom: 2px; height: 2px; border-radius: 2px; background: var(--primary);
}
.nav__cta-mobile { display: none; }

.nav-toggle {
    display: none; margin-inline-start: auto; width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
    align-items: center; justify-content: center;
}
.nav-toggle__close { display: none; }
.nav-backdrop { display: none; }

/* ---------- Page header ---------- */
.page-header {
    position: relative; overflow: hidden;
    padding-block: 3.5rem 3rem; background: var(--soft); border-bottom: 1px solid var(--line);
}
.page-header__title { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-block: .75rem .25rem; }
.page-header__subtitle { color: var(--muted); max-width: 640px; margin: 0; }
.page-header__shape {
    position: absolute; inset-inline-end: -80px; top: -80px; width: 320px; height: 320px;
    border-radius: 50%; border: 48px solid var(--primary-50); pointer-events: none;
}
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current] { color: var(--ink); }
.breadcrumb__sep { opacity: .4; }

/* ---------- Sections ---------- */
.section { padding-block: 5rem; }
.section--soft { background: var(--soft); }
.section--dark { background: var(--dark); color: rgba(255, 255, 255, .7); }
.section--dark .section__title, .section--dark h3 { color: #fff; }
.section__title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 1.5rem; }
.section__title--spaced { margin-top: 4.5rem; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section__head .section__title { margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.split--reverse .split__visual { order: 2; }

/* ---------- Hero ---------- */
.hero { padding-block: 4rem 0; background: linear-gradient(180deg, var(--primary-50) 0%, #fff 75%); overflow-x: clip; overflow-y: visible; }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero__title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.01em; margin-bottom: 1rem; }
html[lang="en"] .hero__title { letter-spacing: -.03em; }
.hero__text { font-size: 1.1rem; max-width: 540px; color: var(--text); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.hero__visual { position: relative; height: 460px; display: grid; place-items: center; }
.hero__ring {
    position: absolute; width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, var(--primary-50) 70%);
    box-shadow: inset 0 0 0 1px rgba(11, 110, 127, .08), 0 0 0 40px rgba(11, 110, 127, .03), 0 0 0 80px rgba(11, 110, 127, .02);
}
.hero__preforms { position: relative; display: flex; align-items: end; gap: 10px; height: 380px; }
.hero__p { width: 92px; height: auto; filter: drop-shadow(0 16px 24px rgba(13, 27, 42, .1)); animation: float 6s ease-in-out infinite; }
.hero__p--1 { width: 78px; animation-delay: -2s; }
.hero__p--2 { width: 110px; }
.hero__p--3 { width: 84px; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .hero__p { animation: none; } }

.stats {
    display: grid; grid-template-columns: repeat(4, 1fr); margin: 3rem 0 0;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    position: relative; z-index: 2; translate: 0 50%;
}
.stats__item { padding: 1.5rem; display: flex; flex-direction: column-reverse; gap: .1rem; }
.stats__item + .stats__item { border-inline-start: 1px solid var(--line); }
.stats dd { margin: 0; font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stats dt { color: var(--muted); font-size: .9rem; }
.hero + .section { padding-top: 8rem; }

/* ---------- Home: about visual ---------- */
.about-visual { position: relative; aspect-ratio: 5 / 4; border-radius: 24px; overflow: hidden; background: var(--dark); }
.about-visual__grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 32px 32px;
}
.about-visual::after {
    content: ""; position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%;
    inset-inline-end: -10%; bottom: -20%; background: radial-gradient(circle, rgba(95, 196, 212, .45), transparent 65%);
}
.about-visual__card {
    position: absolute; z-index: 1; inset-inline-start: 2rem; bottom: 2rem;
    display: flex; flex-direction: column; gap: .25rem; padding: 1.5rem 1.75rem;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px);
    border-radius: var(--radius); color: rgba(255, 255, 255, .75);
}
.about-visual__card .brand__mark { color: var(--accent); margin-bottom: .5rem; }
.about-visual__card strong { color: #fff; font-size: 2.5rem; line-height: 1.1; }

.checklist { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: grid; gap: .6rem; }
.checklist li { display: flex; align-items: center; gap: .6rem; }
.checklist .icon { color: #fff; background: var(--primary); border-radius: 50%; padding: 3px; width: 22px; height: 22px; }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.cat-card {
    position: relative; display: flex; flex-direction: column; gap: .4rem; padding: 1.5rem;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.cat-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow); color: var(--text); }
.cat-card__art { height: 120px; display: flex; align-items: end; margin-bottom: .75rem; }
.cat-card__art .art { height: 100%; width: auto; }
.cat-card__name { font-weight: 700; color: var(--ink); }
.cat-card__desc { font-size: .85rem; color: var(--muted); line-height: 1.7; }
.cat-card__go {
    position: absolute; top: 1.25rem; inset-inline-end: 1.25rem; width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center; background: var(--soft); color: var(--ink); transition: background .2s, color .2s;
}
.cat-card:hover .cat-card__go { background: var(--primary); color: #fff; }

/* ---------- Product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.product-grid--4 { grid-template-columns: repeat(4, 1fr); }
.product-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.product-card__media {
    position: relative; display: grid; place-items: center; height: 240px;
    background: radial-gradient(circle at 50% 60%, #fff 0, var(--soft) 70%);
}
.product-card__media .art--preform { height: 200px; width: auto; transition: transform .4s; }
.product-card__media .art--cap { height: 120px; width: auto; transition: transform .4s; }
.product-card:hover .product-card__media .art { transform: scale(1.05); }
.product-card__code {
    position: absolute; top: 12px; inset-inline-start: 12px; padding: .15em .6em; border-radius: 6px;
    background: #fff; border: 1px solid var(--line); font-size: .75rem; font-weight: 700; color: var(--ink);
    font-family: "Inter", system-ui, sans-serif;
}
.product-card__body { padding: 1.1rem 1.25rem 1.25rem; }
.product-card__title { font-size: 1rem; margin-bottom: .75rem; }
.product-card__title a { color: var(--ink); }
.product-card__title a:hover { color: var(--primary); }
.specs-inline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.specs-inline li { display: flex; flex-direction: column; padding: .5rem .75rem; background: var(--soft); border-radius: 8px; }
.specs-inline span { font-size: .72rem; color: var(--muted); }
.specs-inline b { font-size: .9rem; color: var(--ink); font-weight: 600; }

/* ---------- Features & steps (dark) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.feature { padding: 1.75rem; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius); background: rgba(255, 255, 255, .02); }
.feature h3 { font-size: 1.05rem; margin-top: 1rem; }
.feature p { margin: 0; font-size: .9rem; }
.feature__icon {
    display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
    background: rgba(95, 196, 212, .12); color: var(--accent);
}
.feature__icon .icon { width: 24px; height: 24px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; counter-reset: s; }
.steps__item { position: relative; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.steps__item::before {
    content: ""; position: absolute; top: -5px; inset-inline-start: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.steps__num { display: block; font-size: 2.25rem; font-weight: 800; color: rgba(255, 255, 255, .15); line-height: 1; margin-bottom: .75rem; font-family: "Inter", var(--font); }
html[lang="fa"] .steps__num { font-family: var(--font); }
.steps__item h3 { font-size: 1.05rem; }
.steps__item p { font-size: .9rem; margin: 0; }

/* ---------- Posts ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.post-card { display: flex; flex-direction: column; }
.post-card__media { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius); margin-bottom: 1.1rem; transition: transform .3s; }
.post-card:hover .post-card__media { transform: scale(.98); }
.post-card__title { font-size: 1.1rem; margin-block: .5rem; }
.post-card__title a { color: var(--ink); }
.post-card__title a:hover { color: var(--primary); }
.post-card__excerpt { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Generated cover art (replace with real images later) */
.cover { position: relative; overflow: hidden; background-color: var(--primary); }
.cover::before, .cover::after { content: ""; position: absolute; border-radius: 50%; }
.cover::before { width: 70%; aspect-ratio: 1; inset-inline-end: -15%; top: -30%; background: rgba(255, 255, 255, .12); }
.cover::after { width: 40%; aspect-ratio: 1; inset-inline-start: 10%; bottom: -25%; border: 18px solid rgba(255, 255, 255, .14); }
.cover--1 { background: linear-gradient(135deg, #0b6e7f, #5fc4d4); }
.cover--2 { background: linear-gradient(135deg, #0c1c26, #1d4e5f); }
.cover--3 { background: linear-gradient(135deg, #3fae7a, #a4dcc0); }
.cover--4 { background: linear-gradient(135deg, #c99a2e, #f1d98f); }

.featured-post {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center;
    margin-bottom: 3rem; padding-bottom: 3rem; border-bottom: 1px solid var(--line);
}
.featured-post__media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 20px; }
.featured-post__media .badge { position: absolute; top: 1rem; inset-inline-start: 1rem; z-index: 1; }
.featured-post__title { font-size: clamp(1.4rem, 2.5vw, 2rem); margin-block: .75rem; }
.featured-post__title a { color: var(--ink); }

.pagination { display: flex; justify-content: center; align-items: center; gap: .4rem; margin-top: 3rem; flex-wrap: wrap; }
.pagination__num, .pagination__btn {
    display: inline-flex; align-items: center; gap: .4em; justify-content: center;
    min-width: 42px; height: 42px; padding-inline: .9rem; border-radius: 12px; border: 1px solid var(--line); color: var(--ink);
}
.pagination__num:hover, .pagination__btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination__num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Events ---------- */
.event-list { display: grid; gap: 1.25rem; }
.event-card {
    display: grid; grid-template-columns: 96px 220px 1fr; gap: 1.5rem; align-items: stretch;
    padding: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    transition: box-shadow .2s;
}
.event-card:hover { box-shadow: var(--shadow); }
.event-card--past { opacity: .8; }
.event-card--past .event-card__media { filter: grayscale(.7); }
.event-card__date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 12px; background: var(--primary-50); color: var(--primary); text-align: center; padding: .75rem;
}
.event-card__day { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.event-card__month { font-size: .85rem; font-weight: 600; margin-top: .35rem; }
.event-card__media { border-radius: 12px; min-height: 150px; }
.event-card__body { padding-block: .25rem; }
.event-card__title { font-size: 1.2rem; margin-block: .25rem .75rem; }
.event-card__meta { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: .85rem; color: var(--muted); }
.event-card__meta li { display: inline-flex; align-items: center; gap: .35em; }
.event-card__meta .icon { width: 16px; height: 16px; color: var(--primary); }
.event-card p { font-size: .92rem; margin-bottom: .75rem; }

.tabs { display: inline-flex; gap: .25rem; padding: .3rem; background: var(--soft); border-radius: 14px; margin-bottom: 2rem; }
.tabs__item { display: inline-flex; align-items: center; gap: .5em; padding: .55em 1.2em; border-radius: 10px; color: var(--text); font-weight: 500; }
.tabs__item.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(13, 27, 42, .08); }
.tabs__item.is-active .count { background: var(--primary); color: #fff; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--primary); color: rgba(255, 255, 255, .85); padding-block: 3.5rem; position: relative; overflow: hidden; }
.cta-band::before {
    content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
    inset-inline-start: -120px; top: -200px; border: 60px solid rgba(255, 255, 255, .06);
}
.cta-band__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; font-size: clamp(1.3rem, 2.4vw, 1.8rem); margin-bottom: .25rem; }
.cta-band p { margin: 0; }
.cta-band__actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---------- About ---------- */
.quote {
    margin: 1.5rem 0 0; padding: 1rem 1.5rem; border-inline-start: 3px solid var(--primary);
    background: var(--primary-50); border-radius: 0 12px 12px 0; color: var(--ink); font-weight: 600;
}
[dir="rtl"] .quote { border-radius: 12px 0 0 12px; }
.factory-visual {
    aspect-ratio: 5 / 4; border-radius: 24px; display: grid; place-items: end center; padding: 2rem 1rem 0;
    background: linear-gradient(180deg, var(--soft), var(--primary-50)); border: 1px solid var(--line); overflow: hidden;
}
.factory-visual__row { display: flex; align-items: end; gap: 4%; height: 85%; }
.factory-visual__row .art { height: 100%; width: auto; }
.factory-visual__row .art:nth-child(even) { height: 82%; }

.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.pillar { padding: 2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.pillar .feature__icon { background: var(--primary-50); color: var(--primary); }
.pillar h3 { margin-top: 1rem; }
.pillar p { margin: 0; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.timeline__item { position: relative; padding-top: 2rem; }
.timeline__item::before { content: ""; position: absolute; top: 7px; inset-inline: 0; height: 2px; background: var(--line); }
.timeline__item::after {
    content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 3px solid var(--primary);
}
.timeline__year { display: block; font-size: 1.6rem; font-weight: 800; color: var(--ink); margin-bottom: .25rem; }
.timeline__item p { color: var(--muted); margin: 0; }

.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.cert { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; padding: 2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.cert__icon { color: var(--primary); margin-bottom: .5rem; }
.cert__icon .icon { width: 36px; height: 36px; }
.cert strong { font-size: 1.15rem; color: var(--ink); font-family: "Inter", var(--font); }
.cert span { color: var(--muted); font-size: .9rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 360px 1fr; gap: 2rem; align-items: start; }
.contact-info { display: grid; gap: 1rem; }
.info-card { display: flex; gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); }
.info-card__icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--primary-50); color: var(--primary); }
.info-card h3 { font-size: .95rem; margin-bottom: .15rem; }
.info-card p { margin: 0; font-size: .92rem; color: var(--muted); }
.info-card a { color: var(--text); }
.info-card a:hover { color: var(--primary); }

.form-card { padding: 2.25rem; background: var(--soft); border-radius: 20px; }
.form-card h2 { font-size: 1.4rem; margin-bottom: .25rem; }
.form { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea, .search input {
    width: 100%; font: inherit; color: var(--ink); background: #fff;
    border: 1px solid var(--line); border-radius: 12px; padding: .75em 1em; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11, 110, 127, .12); }
.field textarea { resize: vertical; min-height: 140px; }
.field input[dir="ltr"] { text-align: left; }
[dir="rtl"] .field input[dir="ltr"]::placeholder { text-align: right; }
.field .input-validation-error { border-color: var(--danger); }
.field__error { font-size: .8rem; color: var(--danger); }
.form .btn { justify-self: start; }

.alert { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-radius: 12px; margin-top: 1rem; font-size: .92rem; }
.alert--success { background: #e7f6ee; color: var(--success); }
.alert--error { background: #fdecea; color: var(--danger); }
.alert--error.validation-summary-valid { display: none; }
.alert--error ul { margin: 0; }

.map { padding-bottom: 5rem; }
.map__frame { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 21 / 8; background: var(--soft); }
.map__frame iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.4); }

/* ---------- Products (shop) ---------- */
.shop { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: start; }
.shop__sidebar { position: sticky; top: calc(var(--header-h) + 1rem); display: grid; gap: 1.25rem; }
.shop__heading { font-size: .95rem; margin: .5rem 0 0; }
.search { position: relative; }
.search input { padding-inline-end: 3rem; }
.search button {
    position: absolute; inset-inline-end: 6px; top: 50%; translate: 0 -50%; width: 38px; height: 38px;
    border: 0; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.search .icon { width: 18px; height: 18px; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.cat-list a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6em .85em; border-radius: 10px; color: var(--text); font-size: .93rem; }
.cat-list a:hover { background: var(--soft); color: var(--ink); }
.cat-list a.is-active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.cat-list a.is-active .count { background: var(--primary); color: #fff; }
.sidebar-cta { padding: 1.5rem; border-radius: var(--radius); background: var(--dark); color: rgba(255, 255, 255, .7); font-size: .9rem; }
.sidebar-cta h3 { color: #fff; font-size: 1.05rem; }
.shop__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; min-height: 36px; }
.empty { padding: 3rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ---------- Product details ---------- */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: start; }
.product__gallery {
    position: sticky; top: calc(var(--header-h) + 1rem);
    display: grid; place-items: center; aspect-ratio: 1; border-radius: 24px;
    background: radial-gradient(circle at 50% 55%, #fff 0, var(--soft) 65%); border: 1px solid var(--line);
}
.product__gallery .art--lg { height: 80%; width: auto; }
.product__gallery .art--lg-cap { width: 50%; height: auto; }
.product__gallery .product-card__code { font-size: .9rem; top: 1.25rem; inset-inline-start: 1.25rem; }
.product__info .badge { margin-bottom: 1rem; }
.product__subhead { font-size: 1rem; margin-top: 2rem; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.spec-table th, .spec-table td { padding: .8rem 0; border-bottom: 1px solid var(--line); text-align: start; }
.spec-table th { color: var(--muted); font-weight: 500; width: 40%; }
.spec-table td { color: var(--ink); font-weight: 600; }
[dir="rtl"] .spec-table td[dir="ltr"] { text-align: right; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--swatch); margin-inline-end: .5rem; vertical-align: -2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.product__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-block: 2rem 1.25rem; }

/* ---------- Blog article ---------- */
.article__header { padding-block: 3rem 2rem; text-align: center; }
.article__header .breadcrumb { justify-content: center; margin-bottom: 1.5rem; }
.article__title { font-size: clamp(1.7rem, 4vw, 2.75rem); font-weight: 800; margin-block: 1rem; }
.article__lead { font-size: 1.1rem; color: var(--muted); max-width: 680px; margin-inline: auto; }
.meta--lg { justify-content: center; font-size: .9rem; margin-top: 1.5rem; }
.author { gap: .5em !important; color: var(--ink); font-weight: 600; }
.author__avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .8rem; }
.article__cover { aspect-ratio: 21 / 8; border-radius: 24px; margin-bottom: 3rem; }

.article__layout { display: grid; grid-template-columns: 260px minmax(0, 760px); gap: 3.5rem; justify-content: center; }
.article__aside { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; display: grid; gap: 2rem; }
.toc__title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; }
html[lang="fa"] .toc__title, html[lang="ar"] .toc__title { letter-spacing: 0; font-size: .9rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--line); }
.toc a { display: block; padding: .4em 1em; margin-inline-start: -2px; border-inline-start: 2px solid transparent; color: var(--text); font-size: .9rem; line-height: 1.6; }
.toc a:hover, .toc a.is-active { color: var(--primary); border-inline-start-color: var(--primary); }
.share__buttons { display: flex; gap: .5rem; }
.share__buttons a, .share__buttons button {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: all .2s;
}
.share__buttons a:hover, .share__buttons button:hover { border-color: var(--primary); color: var(--primary); }
.share__buttons button.is-copied { background: var(--primary); color: #fff; border-color: var(--primary); }

.prose { font-size: 1.06rem; line-height: 2; color: var(--text); }
html[lang="en"] .prose { line-height: 1.8; }
.prose h2 { font-size: 1.45rem; margin-block: 2.25rem .75rem; }
.prose ul, .prose ol { margin-bottom: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--primary); }
.prose > p:first-child { font-size: 1.15rem; color: var(--ink); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-block: 4rem 5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-nav__item { display: flex; flex-direction: column; gap: .35rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.post-nav__item:hover { border-color: var(--primary); color: var(--ink); }
.post-nav__item .muted { display: inline-flex; align-items: center; gap: .4em; font-size: .85rem; }
.post-nav__item--next { text-align: end; align-items: end; }

/* ---------- Empty / error ---------- */
.empty-state { text-align: center; padding-block: 7rem; }
.empty-state__code { display: block; font-size: 6rem; font-weight: 800; line-height: 1; color: var(--primary-50); -webkit-text-stroke: 2px var(--primary); margin-bottom: 1rem; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: rgba(255, 255, 255, .6); padding-top: 4.5rem; font-size: .92rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 2.5rem; }
.footer__brand p { margin-block: 1.25rem; max-width: 320px; }
.footer__title { color: #fff; font-size: 1rem; margin-bottom: 1.25rem; }
.footer__links, .footer__contact { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.footer a { color: rgba(255, 255, 255, .6); }
.footer a:hover { color: #fff; }
.footer__contact li { display: flex; gap: .6rem; align-items: start; }
.footer__contact .icon { color: var(--accent); margin-top: .3em; width: 18px; height: 18px; }
.social { display: flex; gap: .5rem; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .12); }
.social a:hover { background: var(--primary); border-color: var(--primary); }
.footer__bottom {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-top: 3.5rem; padding-block: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .82rem;
}
.footer .muted { color: rgba(255, 255, 255, .35); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .product-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .article__layout { grid-template-columns: 1fr; gap: 0; }
    .article__aside { position: static; grid-template-columns: 1fr auto; align-items: start; margin-bottom: 2rem; padding: 1.25rem; background: var(--soft); border-radius: var(--radius); }
    .header__cta { display: none; }
}

@media (max-width: 992px) {
    :root { --header-h: 68px; }

    /* off-canvas nav
       NOTE: backdrop-filter on an ancestor turns it into the containing block of
       position:fixed children, so it is removed on mobile. */
    .header { backdrop-filter: none; background: #fff; }
    .nav-open .header { z-index: 90; }
    .nav-toggle { display: inline-flex; }
    .nav {
        position: fixed; z-index: 70; top: 0; bottom: 0; inset-inline-end: 0;
        width: min(320px, 85vw); margin: 0; padding: 5rem 1.25rem 1.5rem;
        flex-direction: column; align-items: stretch; gap: .25rem;
        background: #fff; box-shadow: -10px 0 40px rgba(13, 27, 42, .12);
        transform: translateX(100%); transition: transform .3s ease; overflow-y: auto;
    }
    [dir="rtl"] .nav { transform: translateX(-100%); box-shadow: 10px 0 40px rgba(13, 27, 42, .12); }
    .nav__link { padding: .8em 1em; font-size: 1rem; }
    .nav__link.is-active { background: var(--primary-50); }
    .nav__link.is-active::after { display: none; }
    .nav__cta-mobile { display: inline-flex; margin-top: 1rem; }
    .nav-toggle { position: relative; z-index: 80; }
    .nav-open .nav { transform: none; }
    .nav-open .nav-toggle__open { display: none; }
    .nav-open .nav-toggle__close { display: inline; }
    .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(13, 27, 42, .4); }

    .hero__grid, .split, .featured-post, .product, .contact-grid, .shop { grid-template-columns: 1fr; }
    .hero { padding-top: 2.5rem; }
    .hero__visual { height: 300px; }
    .hero__ring { width: 280px; height: 280px; }
    .hero__preforms { height: 280px; }
    .hero__p { width: 68px; } .hero__p--2 { width: 82px; } .hero__p--1, .hero__p--3 { width: 60px; }
    .split { gap: 2.5rem; }
    .split--reverse .split__visual { order: 0; }
    .stats { grid-template-columns: repeat(2, 1fr); translate: 0 30%; }
    .stats__item:nth-child(3) { border-inline-start: 0; }
    .stats__item:nth-child(n+3) { border-top: 1px solid var(--line); }
    .hero + .section { padding-top: 7rem; }
    .product__gallery { position: static; max-width: 480px; width: 100%; margin-inline: auto; }
    .shop__sidebar { position: static; }
    .sidebar-cta { display: none; }
    .cat-list { display: flex; overflow-x: auto; gap: .5rem; padding-bottom: .5rem; scrollbar-width: thin; }
    .cat-list a { white-space: nowrap; border: 1px solid var(--line); }
    .timeline { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
    .pillar-grid, .cert-grid { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .event-card { grid-template-columns: 80px 1fr; }
    .event-card__media { display: none; }
    .map__frame { aspect-ratio: 4 / 3; }
    .hide-md { display: none !important; }
}

@media (max-width: 640px) {
    .container { padding-inline: 16px; }
    .section { padding-block: 3.5rem; }
    .section__head { flex-direction: column; align-items: start; }
    .cat-grid, .product-grid, .product-grid--4, .product-grid--3, .post-grid, .feature-grid, .steps { grid-template-columns: 1fr; }
    .cat-grid { grid-template-columns: 1fr 1fr; }
    .cat-card { padding: 1rem; }
    .cat-card__desc, .cat-card__go { display: none; }
    .cat-card__art { height: 90px; }
    .stats dd { font-size: 1.5rem; }
    .stats__item { padding: 1rem; }
    .form__row { grid-template-columns: 1fr; }
    .form-card { padding: 1.5rem; }
    .form .btn { justify-self: stretch; }
    .footer__grid { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .article__aside { grid-template-columns: 1fr; }
    .article__cover { aspect-ratio: 16 / 9; }
    .timeline { grid-template-columns: 1fr; }
    .event-card { grid-template-columns: 1fr; }
    .event-card__date { flex-direction: row; gap: .5rem; justify-content: start; padding: .5rem 1rem; }
    .event-card__day { font-size: 1.4rem; }
    .event-card__month { margin: 0; }
    .hide-sm { display: none !important; }
    .brand__text small { display: none; }
    .hero__actions .btn { flex: 1; }
}
