/* ========================================
   ۱. رنگ‌ها و تنظیمات مشترک
======================================== */

:root {
    color-scheme: dark;

    --bg: #030b13;
    --bg-secondary: #071727;

    --surface: #091b2c;
    --surface-hover: #102a42;
    --header-bg: #04101cf5;
    --dialog-bg: #091b2c;

    --text: #f1f5fb;
    --muted: #b0bfd0;

    --blue: #0878f9;
    --blue-hover: #0060d5;
    --accent: #49caff;

    --border: #24415c;
    --border-hover: #38bdf8;

    --shadow: 0 14px 40px rgb(0 0 0 / 20%);
    --glow: 0 0 30px rgb(0 140 255 / 15%);

    --hero-start: #030b13;
    --hero-end: #082941;

    --wave-color: rgb(35 170 255 / 35%);
    --wave-glow: rgb(0 119 255 / 18%);

    --radius: 18px;
    --radius-small: 10px;

    --container-width: 1180px;
    --header-height: 88px;
}

body.light {
    color-scheme: light;

    --bg: #faf9f6;
    --bg-secondary: #edf4fa;

    --surface: #ffffff;
    --surface-hover: #edf6ff;
    --header-bg: #faf9f6f5;
    --dialog-bg: #ffffff;

    --text: #142337;
    --muted: #52647a;

    --blue: #0865db;
    --blue-hover: #004eb5;
    --accent: #0064bd;

    --border: #ccdfed;
    --border-hover: #0878f9;

    --shadow: 0 12px 36px rgb(22 74 125 / 8%);
    --glow: 0 0 30px rgb(0 119 255 / 10%);

    --hero-start: #faf9f6;
    --hero-end: #e5f2ff;

    --wave-color: rgb(0 119 255 / 25%);
    --wave-glow: rgb(0 119 255 / 12%);
}


/* ========================================
   ۲. تنظیمات پایه
======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    margin: 0;
    min-width: 0;

    background: var(--bg);
    color: var(--text);

    font-family: Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.9;

    overflow-wrap: break-word;
}

body.modal-open,
body.menu-open {
    overflow: hidden;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.6;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h3 {
    margin-bottom: 12px;
    font-size: 1.15rem;
}

p {
    margin-bottom: 16px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    touch-action: manipulation;
}

button:disabled {
    cursor: not-allowed;
}

img,
svg,
canvas {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 5px;
}

::selection {
    background: #0878f9;
    color: white;
}

[hidden] {
    display: none !important;
}

.container {
    width: min(var(--container-width), calc(100% - 48px));
    margin-inline: auto;
}

.container > *,
.header-inner > *,
.about-grid > *,
.app-panel > *,
.collaboration-banner > * {
    min-width: 0;
}

.section {
    padding-block: 76px;
    border-bottom: 1px solid var(--border);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 34px;
}

.section-heading p,
.section-heading-center p {
    color: var(--muted);
}

.section-heading-center {
    margin-inline: auto;
    text-align: center;
}

.eyebrow {
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: bold;
}

.text-accent {
    color: var(--accent);
}

.section-note,
.preview-note,
.founder-note {
    color: var(--muted);
    font-size: 0.875rem;
}

.skip-link {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;

    padding: 10px 18px;
    border-radius: 8px;

    background: var(--surface);
    color: var(--text);

    transform: translateY(-180%);
}

.skip-link:focus {
    transform: translateY(0);
}


/* ========================================
   ۳. دکمه‌ها
======================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 46px;
    padding: 11px 23px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    font-size: 0.9375rem;
    font-weight: bold;
    line-height: 1.6;
    text-align: center;

    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.button-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #ffffff;

    box-shadow: 0 6px 22px rgb(0 119 255 / 18%);
}

.button-primary:not(:disabled):hover {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
    box-shadow: 0 8px 28px rgb(0 119 255 / 28%);
    transform: translateY(-2px);
}

.button-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.button-secondary:not(:disabled):hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.button:disabled {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--muted);
    box-shadow: none;
}

.text-button,
.nav-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);

    font: inherit;
    text-align: start;
}

.text-button {
    min-height: 44px;
    font-size: 0.9375rem;
    font-weight: bold;
}

.text-button:hover {
    text-decoration: underline;
    text-underline-offset: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--bg-secondary);
    color: var(--accent);

    font-size: 0.8125rem;
    line-height: 1.7;
}


/* ========================================
   ۴. سربرگ و برند
======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    border-bottom: 1px solid var(--border);
    background: var(--header-bg);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: var(--header-height);
    padding-block: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    flex-shrink: 0;
    color: var(--text);
}

.brand-mark {
    display: grid;
    place-items: center;

    width: 49px;
    height: 49px;

    border: 2px solid #21baff;
    border-radius: 50%;

    background: linear-gradient(145deg, #005ed4, #0b2946);
    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    direction: ltr;

    box-shadow: 0 0 18px rgb(0 166 255 / 22%);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-text strong {
    font-family: Arial, sans-serif;
    font-size: 1.3rem;
    line-height: 1.2;
    letter-spacing: 3px;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.7;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.main-nav a,
.main-nav .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;

    color: var(--muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav .nav-link:hover {
    color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.header-actions .button {
    padding: 9px 13px;
    font-size: 0.875rem;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;

    width: 46px;
    min-height: 46px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
    color: var(--text);

    font-size: 1.4rem;
}


/* ========================================
   ۵. هیرو و زمینه متحرک
======================================== */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    padding-block: 105px 54px;

    background:
        radial-gradient(
            ellipse at 80% 15%,
            var(--wave-glow),
            transparent 60%
        ),
        linear-gradient(
            145deg,
            var(--hero-start),
            var(--hero-end)
        );

    border-bottom: 1px solid var(--border);
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;

    overflow: hidden;
    pointer-events: none;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-background::before,
.hero-background::after {
    content: "";

    position: absolute;
    left: -20%;
    top: 8%;

    width: 140%;
    height: 440px;

    border: 1px solid var(--wave-color);
    border-radius: 50%;

    box-shadow:
        0 0 28px var(--wave-glow),
        inset 0 0 28px var(--wave-glow);

    transform: rotate(-14deg);
    animation: wave-drift 16s ease-in-out infinite alternate;
}

.hero-background::after {
    top: 17%;
    height: 350px;

    transform: rotate(13deg);
    animation-name: wave-drift-reverse;
    animation-delay: -8s;
}

.hero-glow {
    position: absolute;
    width: 470px;
    height: 470px;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        var(--wave-glow),
        transparent 68%
    );

    animation: glow-drift 18s ease-in-out infinite alternate;
}

.hero-glow-one {
    top: -160px;
    right: -80px;
}

.hero-glow-two {
    bottom: -200px;
    left: -100px;
    animation-delay: -9s;
}

.hero-content {
    text-align: center;
}

.hero-content > .eyebrow {
    margin-bottom: 20px;
}

.hero h1 {
    max-width: 900px;
    margin: 0 auto 20px;

    font-weight: 800;
    line-height: 1.55;
}

.hero-description {
    max-width: 660px;
    margin: 0 auto;

    color: var(--muted);
    font-size: 1.125rem;
    line-height: 2;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;

    margin-block: 32px 56px;
}

.hero-actions .button {
    min-width: 165px;
}

.hero-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.highlight-card {
    padding: 27px 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);
    box-shadow: var(--glow);
}

.card-symbol {
    display: inline-grid;
    place-items: center;

    width: 48px;
    height: 48px;

    margin-bottom: 12px;

    color: var(--accent);
    font-size: 2.1rem;
    line-height: 1;
}

.highlight-card h2 {
    margin-bottom: 10px;
    font-size: 1.125rem;
}

.highlight-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9375rem;
}


/* ========================================
   ۶. استوری‌ها
======================================== */

.stories-section {
    padding-block: 52px;
}

.stories-list {
    display: flex;
    justify-content: space-between;
    gap: 24px;

    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;

    padding: 12px 6px 20px;

    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;

    flex: 0 0 132px;

    padding: 0;
    border: 0;

    background: transparent;
    color: var(--text);

    font-size: 0.9375rem;
    scroll-snap-align: start;
}

.story-ring {
    display: block;

    width: 112px;
    height: 112px;

    padding: 5px;
    border: 2px solid #159cff;
    border-radius: 50%;

    box-shadow:
        0 0 0 3px var(--bg),
        0 0 0 5px #0878f9;

    transition: transform 180ms ease;
}

.story-item:hover .story-ring {
    transform: translateY(-4px);
}

.story-avatar {
    display: grid;
    place-items: center;

    width: 100%;
    height: 100%;

    border-radius: 50%;

    background: linear-gradient(145deg, #144b76, #061b32);
    color: #eaf6ff;

    font-size: 2rem;
    font-weight: bold;
}

.story-item:nth-child(2) .story-avatar {
    background: linear-gradient(145deg, #64465e, #221c31);
}

.story-item:nth-child(3) .story-avatar {
    background: linear-gradient(145deg, #486477, #172b3b);
}

.story-item:nth-child(4) .story-avatar {
    background: linear-gradient(145deg, #886447, #30231b);
}

.story-item:nth-child(5) .story-avatar {
    background: linear-gradient(145deg, #174e86, #071a31);
}

.story-item:nth-child(6) .story-avatar {
    background: linear-gradient(145deg, #466c68, #152e31);
}

.stories-section .section-note {
    margin: 18px 0 0;
    text-align: center;
}


/* ========================================
   ۷. درباره آرواکس
======================================== */

.about-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    align-items: center;
    gap: 70px;
}

.about-content > p:not(.eyebrow) {
    color: var(--muted);
}

.about-content .button {
    margin-top: 10px;
}

.about-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;

    min-height: 340px;
    padding: 32px;

    border: 1px solid var(--border);
    border-radius: 30px;

    background:
        radial-gradient(
            circle at center,
            var(--wave-glow),
            transparent 70%
        ),
        var(--bg-secondary);
}

.about-brand-mark {
    display: grid;
    place-items: center;

    width: 156px;
    height: 156px;

    border: 2px solid #21baff;
    border-radius: 50%;

    background: linear-gradient(145deg, #007cff, #073664);
    color: white;

    font-family: Arial, sans-serif;
    font-size: 3.6rem;
    font-weight: bold;
    direction: ltr;

    box-shadow: 0 0 45px rgb(0 140 255 / 22%);
}

.about-brand strong {
    font-family: Arial, sans-serif;
    font-size: 2.5rem;
    letter-spacing: 8px;
}

.about-brand > span:last-child {
    color: var(--muted);
    font-size: 0.9375rem;
}


/* ========================================
   ۸. خدمات
======================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
    padding: 28px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);
    box-shadow: var(--shadow);

    transition:
        transform 180ms ease,
        border-color 180ms ease;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.card-number {
    margin-bottom: 22px;
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: bold;
}

.service-card h3 {
    color: var(--text);
}

.service-card p {
    margin-bottom: 20px;
    color: var(--muted);
}

.service-card .text-button {
    margin-top: auto;
}


/* ========================================
   ۹. چرا آرواکس
======================================== */

.why-section {
    background: var(--bg-secondary);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.benefit-card {
    padding: 30px 24px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);
    text-align: center;
}

.benefit-card p {
    margin-bottom: 0;
    color: var(--muted);
}


/* ========================================
   ۱۰. نمونه‌کارها
======================================== */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.portfolio-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    transition:
        transform 180ms ease,
        border-color 180ms ease;
}

.portfolio-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.project-cover {
    display: grid;
    place-items: center;

    min-height: 170px;
    padding: 20px;

    border-bottom: 1px solid var(--border);

    color: white;
    text-align: center;
    font-weight: bold;
}

.project-cover span {
    padding: 9px 16px;

    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 999px;

    background: rgb(0 0 0 / 20%);
    font-size: 0.9375rem;
}

.project-cover-shop {
    background: linear-gradient(135deg, #1d3155, #475778);
}

.project-cover-company {
    background: linear-gradient(135deg, #14353c, #37686c);
}

.project-cover-app {
    background: linear-gradient(135deg, #152557, #514198);
}

.project-cover-brand {
    background: linear-gradient(135deg, #35283a, #755147);
}

.portfolio-card-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;

    padding: 22px;
}

.portfolio-card-content h3 {
    margin-top: 15px;
}

.portfolio-card-content p {
    color: var(--muted);
    font-size: 0.9375rem;
}

.portfolio-card-content .text-button {
    margin-top: auto;
}


/* ========================================
   ۱۱. مقالات
======================================== */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.article-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    padding: 28px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);
}

.article-card h3 {
    margin-top: 20px;
}

.article-card p {
    color: var(--muted);
}

.article-card .text-button {
    margin-top: auto;
}


/* ========================================
   ۱۲. مسیر همکاری
======================================== */

.process-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;

    margin: 0;
    padding: 0;

    list-style: none;
    counter-reset: process-step;
}

.process-list li {
    min-width: 0;
    padding: 24px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    counter-increment: process-step;
}

.process-list li::before {
    content: counter(process-step, decimal-leading-zero);

    display: inline-grid;
    place-items: center;

    width: 42px;
    height: 42px;

    margin-bottom: 18px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--bg-secondary);
    color: var(--accent);

    font-weight: bold;
}

.process-list p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

.collaboration-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;

    margin-top: 45px;
    padding: 38px;

    border: 1px solid var(--border-hover);
    border-radius: 22px;

    background:
        radial-gradient(
            ellipse at 0% 50%,
            var(--wave-glow),
            transparent 65%
        ),
        var(--bg-secondary);

    box-shadow: var(--glow);
}

.collaboration-banner h2 {
    font-size: 1.65rem;
}

.collaboration-banner p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.collaboration-banner > .button {
    flex-shrink: 0;
}


/* ========================================
   ۱۳. اپلیکیشن
======================================== */

.app-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

.app-panel > div {
    max-width: 720px;
}

.app-panel h2 {
    margin-top: 16px;
}

.app-panel p {
    color: var(--muted);
}

.app-panel .section-note {
    margin-bottom: 0;
}

.app-panel > .button {
    flex-shrink: 0;
}


/* ========================================
   ۱۴. پرسش‌های متداول
======================================== */

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-item {
    padding: 0 24px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
}

.faq-item summary {
    padding-block: 18px;

    color: var(--text);
    font-weight: bold;
    cursor: pointer;
}

.faq-item summary::marker {
    color: var(--accent);
}

.faq-item[open] {
    border-color: var(--border-hover);
}

.faq-item p {
    margin-bottom: 22px;
    color: var(--muted);
}


/* ========================================
   ۱۵. ارتباط
======================================== */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    padding: 28px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);
}

.contact-card p {
    color: var(--muted);
}

.contact-card .button {
    margin-top: auto;
}


/* ========================================
   ۱۶. پابرگ
======================================== */

.site-footer {
    padding-block: 45px 110px;
    background: var(--bg-secondary);
}

.footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;

    padding-bottom: 32px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.footer-nav a {
    color: var(--muted);
    font-size: 0.875rem;
}

.footer-nav a:hover {
    color: var(--accent);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.site-footer .preview-note {
    margin: 20px 0 0;
}


/* ========================================
   ۱۷. دکمه‌های شناور و خوش‌آمد
======================================== */

.floating-actions {
    position: fixed;
    right: 20px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 80;

    display: flex;
    align-items: center;
    gap: 10px;

    max-width: calc(100% - 40px);
}

.floating-actions .button {
    box-shadow: var(--shadow);
}

.welcome-message {
    position: fixed;
    right: 20px;
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    z-index: 80;

    width: min(340px, calc(100% - 40px));
    max-height: 60dvh;
    overflow-y: auto;

    padding: 22px;

    border: 1px solid var(--border-hover);
    border-radius: var(--radius);

    background: var(--dialog-bg);
    color: var(--text);
    box-shadow: var(--shadow);
}

.welcome-message > .dialog-close {
    float: left;
    margin: -8px 0 4px -8px;
}

.welcome-message strong {
    display: block;
    margin-bottom: 10px;
}

.welcome-message p {
    color: var(--muted);
    font-size: 0.9375rem;
}

.welcome-message > .button {
    width: 100%;
}

body.menu-open .floating-actions,
body.menu-open .welcome-message {
    visibility: hidden;
}


/* ========================================
   ۱۸. پنجره‌ها
======================================== */

.site-dialog {
    width: min(560px, calc(100% - 32px));
    max-width: none;

    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);

    margin: auto;
    padding: 28px;

    overflow-y: auto;
    overscroll-behavior: contain;

    border: 1px solid var(--border-hover);
    border-radius: 20px;

    background: var(--dialog-bg);
    color: var(--text);

    box-shadow: 0 25px 100px rgb(0 0 0 / 40%);
}

.site-dialog::backdrop {
    background: rgb(0 0 0 / 72%);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.site-dialog[open] {
    animation: dialog-enter 180ms ease-out;
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;
}

.dialog-heading h2 {
    margin-bottom: 0;
    font-size: 1.4rem;
}

.dialog-close {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
    color: var(--text);

    font-size: 1.7rem;
    line-height: 1;
}

.dialog-close:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.site-dialog > p {
    color: var(--muted);
}

.site-dialog label {
    display: block;
    margin-bottom: 9px;
    font-weight: bold;
}

.site-dialog input,
.site-dialog textarea,
.site-dialog select {
    display: block;
    width: 100%;

    padding: 13px 15px;
    margin-bottom: 16px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--bg);
    color: var(--text);

    font-size: 1rem;
    line-height: 1.8;
}

.site-dialog textarea {
    min-height: 110px;
    resize: vertical;
}

.site-dialog input::placeholder,
.site-dialog textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

.site-dialog input:focus,
.site-dialog textarea:focus,
.site-dialog select:focus {
    border-color: var(--border-hover);
}

.response-message:not(:empty) {
    padding: 15px;
    margin-block: 18px;

    border-inline-start: 3px solid var(--accent);
    border-radius: 8px;

    background: var(--bg-secondary);
    color: var(--text);
}

.response-message:empty {
    display: none;
}

.demo-notice {
    padding: 13px 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--bg-secondary);
    color: var(--muted);

    font-size: 0.875rem;
}

.content-dialog {
    width: min(760px, calc(100% - 32px));
}

#content-dialog-body {
    color: var(--muted);
}

#content-dialog-body h3 {
    margin-top: 24px;
    color: var(--text);
}

#content-dialog-body p {
    line-height: 2;
}

#content-dialog-body img {
    width: 100%;
    margin-block: 18px;
    border-radius: 12px;
}

#content-dialog-body a:not(.button) {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}


/* ========================================
   ۱۹. دستیار
======================================== */

.assistant-dialog {
    width: min(620px, calc(100% - 32px));
}

.chat-messages {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;

    min-height: 150px;
    max-height: 310px;

    padding: 16px;
    margin-block: 18px;

    overflow-y: auto;
    overscroll-behavior: contain;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--bg);
}

.chat-message {
    max-width: 92%;

    padding: 12px 15px;
    margin: 0;

    border: 1px solid var(--border);
    border-radius: 14px;

    font-size: 0.9375rem;
    line-height: 1.9;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.assistant-message {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text);
}

.user-message {
    align-self: flex-end;
    background: var(--blue);
    border-color: var(--blue);
    color: #ffffff;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 20px;
}

.chat-suggestions button {
    min-height: 44px;
    padding: 8px 12px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface);
    color: var(--text);

    font-size: 0.875rem;
}

.chat-suggestions button:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.chat-composer label {
    font-size: 0.9375rem;
}

.chat-composer textarea {
    min-height: 85px;
}

.chat-composer > .button {
    width: 100%;
}

#reset-chat {
    margin-top: 16px;
}


/* ========================================
   ۲۰. اعلان کوتاه
======================================== */

.toast {
    position: fixed;
    left: 20px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 200;

    max-width: min(390px, calc(100% - 40px));
    padding: 14px 20px;

    border: 1px solid var(--border-hover);
    border-radius: 12px;

    background: var(--dialog-bg);
    color: var(--text);

    font-size: 0.9375rem;
    box-shadow: var(--shadow);
}


/* ========================================
   ۲۱. انیمیشن‌ها
======================================== */

@keyframes wave-drift {
    from {
        transform: translateY(0) rotate(-14deg) scale(1);
    }

    to {
        transform: translateY(30px) rotate(-9deg) scale(1.05);
    }
}

@keyframes wave-drift-reverse {
    from {
        transform: translateY(0) rotate(13deg) scale(1);
    }

    to {
        transform: translateY(-22px) rotate(8deg) scale(1.04);
    }
}

@keyframes glow-drift {
    from {
        transform: translate(0, 0);
        opacity: 0.7;
    }

    to {
        transform: translate(28px, 20px);
        opacity: 1;
    }
}

@keyframes dialog-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ========================================
   ۲۲. نمایش لپ‌تاپ کوچک و تبلت
======================================== */

@media (max-width: 1150px) {
    :root {
        --header-height: 80px;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;

        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;

        max-height: calc(100dvh - var(--header-height) - 24px);
        padding: 18px 24px;

        overflow-y: auto;
        overscroll-behavior: contain;

        border-bottom: 1px solid var(--border);

        background: var(--surface);
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a,
    .main-nav .nav-link {
        width: 100%;
        padding: 10px 12px;

        border-radius: 8px;
        color: var(--text);

        font-size: 1rem;
        text-align: start;
        white-space: normal;
    }

    .main-nav a:hover,
    .main-nav .nav-link:hover {
        background: var(--surface-hover);
    }

    .menu-toggle {
        display: inline-flex;
    }

    .about-grid {
        gap: 40px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .process-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-main {
        align-items: flex-start;
    }
}


/* ========================================
   ۲۳. تبلت و موبایل افقی
======================================== */

@media (max-width: 850px) {
    .section {
        padding-block: 56px;
    }

    .hero {
        padding-block: 75px 40px;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-highlights,
    .benefits-grid {
        gap: 14px;
    }

    .highlight-card,
    .benefit-card {
        padding: 23px 16px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-brand {
        min-height: 280px;
    }

    .about-brand-mark {
        width: 125px;
        height: 125px;
        font-size: 3rem;
    }

    .services-grid,
    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .collaboration-banner,
    .app-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-main {
        flex-direction: column;
    }
}


/* ========================================
   ۲۴. موبایل
======================================== */

@media (max-width: 600px) {
    :root {
        --header-height: 76px;
        --radius: 14px;
    }

    .container {
        width: calc(100% - 28px);
    }

    .header-inner {
        gap: 10px;
        flex-wrap: wrap;
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        font-size: 0.9375rem;
    }

    .brand-text strong {
        font-size: 1.05rem;
        letter-spacing: 2px;
    }

    .site-header .brand-text small {
        display: none;
    }

    .header-actions {
        gap: 6px;
        flex-wrap: wrap;
        margin-inline-start: auto;
    }

    .header-actions .button {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 0.875rem;
    }

    .menu-toggle {
        width: 44px;
        min-height: 44px;
    }

    .hero {
        padding-block: 55px 30px;
    }

    .hero h1 {
        font-size: 2.05rem;
        line-height: 1.65;
    }

    .hero-content > .eyebrow {
        font-size: 0.875rem;
    }

    .hero-actions {
        gap: 12px;
        margin-block: 26px 34px;
    }

    .hero-actions .button {
        flex: 1 1 140px;
        min-width: 0;
        max-width: 240px;
    }

    .hero-highlights,
    .benefits-grid,
    .services-grid,
    .articles-grid,
    .process-list {
        grid-template-columns: 1fr;
    }

    .highlight-card {
        padding: 22px;
    }

    .hero-background::before,
    .hero-background::after {
        left: -60%;
        width: 220%;
        height: 300px;
    }

    .hero-glow {
        width: 320px;
        height: 320px;
    }

    .section {
        padding-block: 44px;
    }

    .section-heading {
        margin-bottom: 26px;
    }

    .stories-list {
        justify-content: flex-start;
        gap: 16px;
    }

    .story-item {
        flex-basis: 105px;
        font-size: 0.875rem;
    }

    .story-ring {
        width: 90px;
        height: 90px;
    }

    .story-avatar {
        font-size: 1.65rem;
    }

    .service-card,
    .article-card,
    .contact-card {
        padding: 23px;
    }

    .portfolio-grid {
        gap: 14px;
    }

    .project-cover {
        min-height: 140px;
        padding: 12px;
    }

    .project-cover span {
        padding: 7px 10px;
        font-size: 0.875rem;
    }

    .portfolio-card-content {
        padding: 17px;
    }

    .portfolio-card-content h3 {
        font-size: 1rem;
    }

    .portfolio-card-content p {
        font-size: 0.875rem;
    }

    .collaboration-banner {
        gap: 22px;
        padding: 26px;
        margin-top: 30px;
    }

    .collaboration-banner h2 {
        font-size: 1.4rem;
    }

    .collaboration-banner > .button,
    .app-panel > .button {
        width: 100%;
    }

    .faq-item {
        padding-inline: 18px;
    }

    .faq-item summary {
        font-size: 0.9375rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .site-footer {
        padding-bottom: 120px;
    }

    .floating-actions {
        right: 14px;
        max-width: calc(100% - 28px);
        gap: 8px;
    }

    .floating-actions .button {
        padding: 10px 14px;
        font-size: 0.875rem;
    }

    .welcome-message {
        right: 14px;
        width: min(340px, calc(100% - 28px));
    }

    .site-dialog {
        width: calc(100% - 24px);
        padding: 22px;
        border-radius: 16px;
    }

    .dialog-heading h2 {
        font-size: 1.25rem;
    }

    .chat-messages {
        max-height: 260px;
        padding: 12px;
    }

    .chat-message {
        max-width: 96%;
    }

    .toast {
        left: 14px;
        max-width: calc(100% - 28px);
    }
}


/* ========================================
   ۲۵. صفحه‌های خیلی باریک
======================================== */

@media (max-width: 380px) {
    .site-header .brand-text {
        display: none;
    }

    .header-actions {
        gap: 5px;
    }

    .header-actions .button {
        padding-inline: 8px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .project-cover {
        min-height: 170px;
    }

    .site-dialog {
        padding: 18px;
    }
}


/* ========================================
   ۲۶. احترام به تنظیم کاهش حرکت
======================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
/* صفحه آغازین */

.splash-dialog {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100vh;
    height: 100dvh;

    max-width: none;
    max-height: none;

    margin: 0;
    padding: 24px;

    border: 0;
    border-radius: 0;

    overflow-y: auto;

    background:
        radial-gradient(
            ellipse at 20% 25%,
            var(--wave-glow),
            transparent 60%
        ),
        radial-gradient(
            ellipse at 85% 80%,
            var(--wave-glow),
            transparent 55%
        ),
        linear-gradient(
            145deg,
            var(--hero-start),
            var(--hero-end)
        );

    color: var(--text);
}

.splash-dialog[open] {
    display: flex;
    animation: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(100%, 680px);
    margin: auto;
    padding-block: 32px;

    text-align: center;
}

.splash-logo {
    display: grid;
    place-items: center;

    width: 132px;
    height: 132px;

    margin-bottom: 24px;

    border: 2px solid #21baff;
    border-radius: 50%;

    background: linear-gradient(145deg, #007cff, #073664);
    color: white;

    font-family: Arial, sans-serif;
    font-size: 3rem;
    font-weight: bold;
    direction: ltr;

    box-shadow: 0 0 35px rgb(0 140 255 / 25%);

    animation: splash-pulse 3s ease-in-out infinite;
}

.splash-brand {
    margin-bottom: 20px;

    font-family: Arial, sans-serif;
    font-size: clamp(2rem, 7vw, 3.3rem);
    letter-spacing: 7px;
}

.splash-content h2 {
    font-size: clamp(1.4rem, 4vw, 2rem);
}

.splash-content p {
    color: var(--muted);
}

.splash-content .button {
    min-width: 190px;
    margin-top: 18px;
}

@keyframes splash-pulse {
    0%,
    100% {
        box-shadow: 0 0 25px rgb(0 140 255 / 20%);
    }

    50% {
        box-shadow: 0 0 60px rgb(0 140 255 / 40%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .splash-logo {
        animation: none;
    }
}
/* ========================================
   اصلاح سربرگ، شیشه و دکمه‌های شناور
======================================== */

:root {
    --glass-surface: rgb(12 31 49 / 88%);
    --glass-header: rgb(4 16 28 / 90%);
    --glass-dialog: rgb(9 27 44 / 96%);
    --glass-border: rgb(153 207 255 / 22%);
    --glass-highlight: rgb(255 255 255 / 10%);
    --glass-shadow: 0 18px 45px rgb(0 0 0 / 22%);
}

body.light {
    --glass-surface: rgb(255 255 255 / 88%);
    --glass-header: rgb(250 249 246 / 90%);
    --glass-dialog: rgb(250 252 255 / 97%);
    --glass-border: rgb(82 142 195 / 25%);
    --glass-highlight: rgb(255 255 255 / 90%);
    --glass-shadow: 0 16px 40px rgb(26 72 120 / 12%);
}


/* برند سمت چپ، ورود سمت راست */

.site-header {
    background: var(--glass-header);
    border-bottom-color: var(--glass-border);

    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.header-inner {
    direction: ltr;
}

.header-inner > .brand {
    direction: ltr;
}

.header-inner > .main-nav,
.header-inner > .header-actions {
    direction: rtl;
}

.site-header .brand-text strong {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 1.45rem;
    font-weight: 500;
    letter-spacing: 4px;
    line-height: 1.2;
}

.site-header .brand-text small {
    display: none;
}

/* آماده برای جایگزینی فایل لوگوی اصلی */

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-mark.has-image {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}


/* دکمه تغییر تم فقط با نماد */

.header-actions .theme-toggle {
    display: inline-grid;
    place-items: center;

    width: 44px;
    height: 44px;
    min-height: 44px;

    padding: 0;
    flex-shrink: 0;

    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;

    background: var(--glass-surface);
    border-color: var(--glass-border);

    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 4px 12px rgb(0 0 0 / 8%);
}


/* پرداخت شیشه‌ای ملایم روی کارت‌های پایین صفحه */

.service-card,
.benefit-card,
.portfolio-card,
.article-card,
.contact-card,
.faq-item,
.process-list li {
    background: var(--glass-surface);
    border-color: var(--glass-border);

    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        var(--glass-shadow);
}

/* شفافیت کنترل‌شده؛ خوانایی متن اولویت دارد */

.button-secondary {
    background: var(--glass-surface);
    border-color: var(--glass-border);

    box-shadow: inset 0 1px 0 var(--glass-highlight);
}


/* پنجره ورود، پشتیبانی و دستیار */

.site-dialog:not(.splash-dialog) {
    background: var(--glass-dialog);
    border-color: var(--glass-border);

    backdrop-filter: blur(28px) saturate(135%);
    -webkit-backdrop-filter: blur(28px) saturate(135%);

    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 28px 100px rgb(0 0 0 / 38%);
}

.site-dialog::backdrop {
    background: rgb(0 7 18 / 65%);

    backdrop-filter: blur(14px) saturate(65%);
    -webkit-backdrop-filter: blur(14px) saturate(65%);
}

/* حرکت آرام هنگام بازشدن پنجره */

.site-dialog[open]:not(.splash-dialog) {
    animation: glass-dialog-enter 240ms ease-out;
}

@keyframes glass-dialog-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* پرده پشت منوی موبایل */

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;

    background: rgb(0 7 18 / 58%);

    backdrop-filter: blur(13px) saturate(65%);
    -webkit-backdrop-filter: blur(13px) saturate(65%);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 240ms ease,
        visibility 240ms ease;
}

body.menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ربات بالا، پشتیبانی پایین */

.floating-actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.floating-actions .assistant-fab {
    display: grid;
    place-items: center;

    width: 60px;
    height: 60px;
    min-height: 60px;

    padding: 0;
    border-radius: 22px;

    font-size: 1.8rem;

    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 25%),
        0 10px 30px rgb(0 119 255 / 28%);
}

.floating-actions .support-fab {
    min-height: 44px;
    padding: 9px 16px;
    border-radius: 999px;

    background: var(--glass-surface);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* خوش‌آمد بالاتر از هر دو دکمه */

.welcome-message {
    bottom: calc(150px + env(safe-area-inset-bottom, 0px));

    background: var(--glass-dialog);
    border-color: var(--glass-border);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast {
    bottom: calc(150px + env(safe-area-inset-bottom, 0px));
}


/* منوی شناور شیشه‌ای و حرکت سه‌بعدی ملایم */

@media (max-width: 1150px) {
    .header-actions {
        margin-inline-start: 0;
        margin-left: auto;
    }

    .main-nav {
        top: calc(100% + 12px);
        right: 14px;
        left: auto;

        display: flex;
        width: min(390px, calc(100% - 28px));

        max-height: calc(100dvh - var(--header-height) - 48px);
        padding: 18px;

        border: 1px solid var(--glass-border);
        border-radius: 22px;

        background: var(--glass-dialog);

        backdrop-filter: blur(26px) saturate(140%);
        -webkit-backdrop-filter: blur(26px) saturate(140%);

        box-shadow:
            inset 0 1px 0 var(--glass-highlight),
            0 24px 65px rgb(0 0 0 / 28%);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform-origin: top right;
        transform:
            perspective(900px)
            translateY(-12px)
            rotateX(-7deg)
            scale(0.97);

        transition:
            opacity 240ms ease,
            transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1),
            visibility 300ms ease;
    }

    .main-nav.open {
        display: flex;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform:
            perspective(900px)
            translateY(0)
            rotateX(0)
            scale(1);
    }

    .main-nav a,
    .main-nav .nav-link {
        padding: 12px 15px;
        border: 1px solid transparent;
        border-radius: 12px;
    }

    .main-nav a:hover,
    .main-nav .nav-link:hover,
    .main-nav a:focus-visible,
    .main-nav .nav-link:focus-visible {
        background: var(--surface-hover);
        border-color: var(--glass-border);
    }

    /* سربرگ هنگام بازبودن منو خوانا باقی می‌ماند */

    body.menu-open .site-header {
        background: var(--dialog-bg);
    }
}

@media (max-width: 600px) {
    .site-header .brand-text strong {
        font-size: 1.15rem;
        letter-spacing: 3px;
    }

    .floating-actions .assistant-fab {
        width: 54px;
        height: 54px;
        min-height: 54px;
        font-size: 1.65rem;
        border-radius: 19px;
    }

    .floating-actions .support-fab {
        padding: 8px 13px;
    }
}

@media (max-width: 380px) {
    /* نام آرواکس در گوشی کوچک هم باقی بماند */

    .site-header .brand-text {
        display: flex;
    }

    .site-header .brand-text strong {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .site-header .brand {
        gap: 6px;
    }

    .site-header .brand-mark {
        width: 34px;
        height: 34px;
    }

    .header-inner {
        column-gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-nav,
    .menu-backdrop,
    .site-dialog[open]:not(.splash-dialog) {
        animation: none !important;
        transition: none !important;
    }
}
/* نماد و نوشته اصلی آرواکس */

.site-header .brand {
    direction: ltr;
    gap: 10px;
}

.site-header .brand-mark {
    display: block;

    width: 52px;
    height: 52px;

    padding: 0;
    border: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;

    flex-shrink: 0;
}

.site-header .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-header .brand-text {
    display: block;
    width: 115px;
}

.site-header .brand-text img {
    width: 100%;
    height: auto;
}

.site-header .wordmark-on-dark {
    display: block;
}

.site-header .wordmark-on-light {
    display: none;
}

body.light .site-header .wordmark-on-dark {
    display: none;
}

body.light .site-header .wordmark-on-light {
    display: block;
}

@media (max-width: 600px) {
    .site-header .brand {
        gap: 7px;
    }

    .site-header .brand-mark {
        width: 43px;
        height: 43px;
    }

    .site-header .brand-text {
        width: 92px;
    }
}

@media (max-width: 380px) {
    .site-header .brand-mark {
        width: 36px;
        height: 36px;
    }

    .site-header .brand-text {
        width: 76px;
    }
}