/* ============================================================
   SERVICES RINGS — framed grid (9 steps) in the site's
   wireframe language: title block separate, content board separate
   ============================================================ */

.rings-section {
    --r-line: var(--line-strong);
    --r-ink: var(--text-muted);
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.rings-section,
.rings-section .container,
.rings-section .inner {
    overflow: visible !important;
}

/* خطوط و نقطه‌های سکشن، هم‌رنگ بقیه سایت */
.rings-section::before,
.rings-section::after,
.rings-section .inner::before,
.rings-section .inner::after {
    background: var(--line-px) !important;
}

.rings-section .dot {
    background: var(--dot-empty) !important;
    border-color: var(--r-line) !important;
    box-shadow: none !important;
}

/* ============================================================
   HEADER — کادر خط‌کشی جدا برای تایتل
   ============================================================ */
.rings-section .rings-header {
    width: 100%;
    max-width: none;
    margin: 0 0 34px;
    padding: 26px 170px;
    position: relative;
    text-align: center;
}

.rings-section .rings-header::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--line-ext));
    right: calc(-1 * var(--line-ext));
    top: 0;
    bottom: 0;
    border-top: 1px solid var(--r-line);
    border-bottom: 1px solid var(--r-line);
    pointer-events: none;
}

.rings-section .rings-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-left: 1px solid var(--r-line);
    border-right: 1px solid var(--r-line);
    pointer-events: none;
}

.rings-section .rings-header h2 {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.2;
    margin: 0 0 6px;
}

.rings-section .rings-header p {
    max-width: 620px;
    font-size: 0.82rem;
    opacity: 0.45;
    margin: 0 auto;
}

/* ============================================================
   BOARD
   ============================================================ */
.rings-board {
    position: relative;
    border: 1px solid var(--r-line);
    z-index: 2;
}

.rings-board::before,
.rings-board::after {
    content: '';
    position: absolute;
    top: -1px;
    height: 1px;
    background: var(--r-line);
    pointer-events: none;
    z-index: 3;
}

.rings-board::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.rings-board::after { right: 100%; left: calc(-1 * var(--line-ext)); }

/* ============================================================
   GRID — 9 columns divided by vertical rules
   ============================================================ */
.rings-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    width: 100%;
}

.ring-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 26px 8px 24px;
    border-right: 1px solid var(--r-line);
    transition: background 0.3s ease;
}

.ring-cell:last-child {
    border-right: 0;
}

.ring-cell:hover {
    background: rgba(255, 255, 255, 0.016);
}

[data-theme="light"] .ring-cell:hover {
    background: rgba(0, 0, 0, 0.018);
}

/* number — فونت سایت */
.ring-num {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1;
    color: var(--r-ink);
    opacity: 0.55;
    margin-bottom: 14px;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.ring-cell:hover .ring-num {
    opacity: 1;
    color: var(--text);
}

/* ring frame with corner brackets */
.ring-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    z-index: 2;
}

.br-c {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 0 solid var(--r-line);
    transition: border-color 0.3s ease;
}

.br-c.tl  { top: 0;    left: 0;  border-top-width: 1px;    border-left-width: 1px; }
.br-c.tr  { top: 0;    right: 0; border-top-width: 1px;    border-right-width: 1px; }
.br-c.bl  { bottom: 0; left: 0;  border-bottom-width: 1px; border-left-width: 1px; }
.br-c.brr { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.ring-cell:hover .br-c {
    border-color: var(--ring-color, var(--accent));
}

/* ---------- Ring (SVG donut) ---------- */
.ring-svg {
    position: relative;
    z-index: 3;
    display: block;
    width: 42px;
    height: 42px;
    color: var(--ring-color, var(--accent));
    transform-origin: center;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* هاور: حلقه نازک‌تر می‌شود */
.ring-cell:hover .ring-svg {
    transform: scale(0.8);
}

/* ---------- Text ---------- */
.ring-cell .ring-en {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.ring-cell .ring-fa {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--r-ink);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.ring-cell:hover .ring-en {
    color: var(--ring-color, var(--accent));
}

/* ---------- Ring colors ---------- */
/* یک‌درمیان با دو سرِ گرادیانت همین سکشن (#hl-1 / #hl-2) */
.r-tryon   { --ring-color: var(--hl-1, var(--accent)); }
.r-finance { --ring-color: var(--hl-2, var(--accent)); }
.r-crm     { --ring-color: var(--hl-1, var(--accent)); }
.r-chat    { --ring-color: var(--hl-2, var(--accent)); }
.r-cloud   { --ring-color: var(--hl-1, var(--accent)); }
.r-studio  { --ring-color: var(--hl-2, var(--accent)); }
.r-todo    { --ring-color: var(--hl-1, var(--accent)); }
.r-kanban  { --ring-color: var(--hl-2, var(--accent)); }
.r-ai      { --ring-color: var(--hl-1, var(--accent)); }

/* ============================================================
   FOOTER NOTE
   ============================================================ */
.rings-footer {
    position: relative;
    padding: 22px 30px 24px;
    border-top: 1px solid var(--r-line);
}

/* خط بالای فوتر تا لبه‌های صفحه */
.rings-footer::before,
.rings-footer::after {
    content: '';
    position: absolute;
    top: -1px;
    height: 1px;
    background: var(--r-line);
    pointer-events: none;
    z-index: 3;
}

.rings-footer::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.rings-footer::after { right: 100%; left: calc(-1 * var(--line-ext)); }

/* خط پایین برد تا لبه‌های صفحه */
.rings-board-edge {
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -1px;
    height: 1px;
    background: var(--r-line);
    pointer-events: none;
    z-index: 3;
}

.rings-board-edge::before,
.rings-board-edge::after {
    content: '';
    position: absolute;
    top: 0;
    height: 1px;
    background: var(--r-line);
    pointer-events: none;
}

.rings-board-edge::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.rings-board-edge::after { right: 100%; left: calc(-1 * var(--line-ext)); }

.rings-note {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.55;
    line-height: 1.7;
    max-width: 720px;
    padding-left: 16px;
    border-left: 1px solid var(--r-line);
    margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .rings-section .rings-header {
        padding: 22px 26px;
    }

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

    .ring-cell {
        padding: 24px 12px 22px;
        border-bottom: 1px solid var(--r-line);
    }

    .ring-cell:nth-child(3n) {
        border-right: 0;
    }

    .ring-cell:nth-last-child(-n+3) {
        border-bottom: 0;
    }
}

@media (max-width: 768px) {
    .rings-section .rings-header h2 { font-size: 1.5rem; }
    .rings-section .rings-header p { font-size: 0.8rem; }

    .ring-cell {
        padding: 20px 8px;
    }

    .ring-cell .ring-en { font-size: 0.82rem; }
    .ring-cell .ring-fa { font-size: 0.58rem; letter-spacing: 0.1em; }
}

@media (max-width: 480px) {
    .rings-section { padding: 40px 0; }

    .rings-section .rings-header {
        padding: 18px 16px;
        margin-bottom: 24px;
    }

    .rings-section .rings-header::before {
        left: -1200px;
        right: -1200px;
    }

    .rings-section .rings-header h2 { font-size: 1.2rem; }

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

    .ring-cell {
        padding: 18px 6px;
        border-bottom: 1px solid var(--r-line);
    }

    .ring-cell:nth-child(3n) {
        border-right: 1px solid var(--r-line);
    }

    .ring-cell:nth-child(2n) {
        border-right: 0;
    }

    .ring-cell:nth-last-child(-n+3) {
        border-bottom: 1px solid var(--r-line);
    }

    .ring-cell:last-child {
        border-bottom: 0;
    }

    .ring-wrap {
        width: 54px;
        height: 54px;
        margin-bottom: 10px;
    }

    .ring-svg { width: 36px; height: 36px; }

    .ring-cell .ring-en { font-size: 0.78rem; }
    .ring-cell .ring-fa { font-size: 0.56rem; }

    .rings-footer { padding: 18px 16px 20px; }

    .rings-note {
        font-size: 0.78rem;
        padding-left: 12px;
    }
}

/* ============================================================
   دایره‌های سرویس، لینک به صفحه‌ی همان سرویس
   ============================================================ */

/* دایره‌های سرویس حالا لینک به صفحه‌ی همان سرویس هستند */
a.ring-cell {
    color: inherit;
    text-decoration: none;
}

a.ring-cell:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: -3px;
}
