/* =============================================================================
   InvestProp — Scorecard  («چرا اینوست پراپ؟»)
   -----------------------------------------------------------------------------
   Used by `site/index/compare.blade.php`. InvestProp named beside FTMO,
   FundedNext and The5%ers on the six criteria that decide things for a trader
   living in Iran, with a score under every column.

   The markup is a real <table> because the content is genuinely tabular, but
   NOTHING here is styled like a spreadsheet: no cell borders, no boxed cells,
   no zebra stripes. A lit lane runs behind our own column, rows are separated
   by hairlines, and the marks do the talking.

   Everything is scoped to `.sc-why`, the section's own root — NOT to a page
   body class — so the section can be dropped onto another public page later
   without dragging home.css along (same rule as bento.css / pricing.css).

   Conventions this file must respect (see the site design system):
     • dark is the DEFAULT theme (`html.dark`); light is the opt-in override,
       and neither compiled sheet sets a global text colour — every block here
       declares its own.
     • RTL is the default direction; logical properties throughout.

   Contract with scorecard.js
   --------------------------
     .sc-why.is-armed — JS is alive, so rows may start on their "before" frame.
                        WITHOUT this class everything is already on its finished
                        frame, which is what a blocked script or a
                        reduced-motion visitor sees.
     .sc-why.is-in    — the section has been reached; the rows land in order.
   ========================================================================== */

.sc-why {
    /* --- palette (dark = default) ----------------------------------------- */
    --sc-primary: #007BFF;
    --sc-primary-2: #1C8AFF;
    --sc-cyan: #5ED2EC;
    --sc-sky: #8DC4FF;
    --sc-mint: #3DD68C;
    --sc-no: #6E8099;

    --sc-surface: rgba(7, 19, 35, .55);
    --sc-line: rgba(141, 196, 255, .13);
    --sc-line-2: rgba(141, 196, 255, .3);
    --sc-text: #EAF2FF;
    --sc-text-2: #C3D4EA;
    --sc-muted: #8FA5C2;

    --sc-grad: linear-gradient(94.98deg, #007BFF 4.01%, #1C8AFF 103.03%);

    position: relative;
    margin-top: 96px;
    isolation: isolate;
}

html:not(.dark) .sc-why {
    --sc-surface: rgba(255, 255, 255, .7);
    --sc-line: rgba(0, 72, 153, .13);
    --sc-line-2: rgba(0, 72, 153, .26);
    --sc-text: #0A1A30;
    --sc-text-2: #2B4463;
    --sc-muted: #5D7492;
    --sc-no: #93A5BC;
}

@media (max-width: 767.98px) {
    .sc-why { margin-top: 64px; }
}

/* Latin numerals and Latin brand names inside an RTL run must not reorder. */
.sc-why .sc-num,
.sc-why .sc-latin {
    direction: ltr;
    unicode-bidi: isolate;
}

.sc-why .sc-num { font-variant-numeric: tabular-nums; }

/* -----------------------------------------------------------------------------
   Ambient background
   -----------------------------------------------------------------------------
   Both orbs fade to their own hue at zero alpha rather than to `transparent`,
   which would drag the gradient midpoint through grey and read muddy.
   -------------------------------------------------------------------------- */

.sc-why__bg {
    position: absolute;
    inset: -10% 0 -8%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.sc-why__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .4;
}

html:not(.dark) .sc-why__orb { opacity: .22; }

.sc-why__orb--a {
    inset-inline-start: 6%;
    top: 26%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 123, 255, .85) 0%, rgba(0, 123, 255, 0) 70%);
}

.sc-why__orb--b {
    inset-inline-end: 4%;
    top: 16%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(94, 210, 236, .55) 0%, rgba(94, 210, 236, 0) 70%);
}

.sc-why__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(141, 196, 255, .14) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(141, 196, 255, .14) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 60% 56% at 50% 50%, #000 0%, transparent 100%);
    mask-image: radial-gradient(ellipse 60% 56% at 50% 50%, #000 0%, transparent 100%);
    opacity: .42;
}

html:not(.dark) .sc-why__grid {
    background-image:
        linear-gradient(to right, rgba(0, 72, 153, .1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 72, 153, .1) 1px, transparent 1px);
}

/* -----------------------------------------------------------------------------
   Section header
   -------------------------------------------------------------------------- */

.sc-head {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
    margin-bottom: 44px;
}

.sc-head__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--sc-line-2);
    background: color-mix(in srgb, var(--sc-primary) 10%, transparent);
    color: var(--sc-sky);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    margin-bottom: 16px;
}

html:not(.dark) .sc-head__eyebrow { color: #0B62C4; }

.sc-head__eyebrow i { font-size: 15px; }

.sc-head__title {
    margin: 0;
    font-size: clamp(24px, 3.4vw, 40px);
    font-weight: 900;
    line-height: 1.35;
    color: var(--sc-text);
}

.sc-head__title b {
    background: linear-gradient(96deg, var(--sc-primary-2) 0%, var(--sc-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900;
}

.sc-head__desc {
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 2;
    color: var(--sc-muted);
}

/* -----------------------------------------------------------------------------
   The board
   -------------------------------------------------------------------------- */

.sc-board {
    position: relative;
    max-width: 1060px;
    margin-inline: auto;
}

.sc-table {
    width: 100%;
    border-collapse: collapse;
    /* Fixed layout so the columns cannot resize row by row — and so the lit
       lane below can be positioned from the same two widths. */
    table-layout: fixed;
}

/* The criterion column carries whole phrases; the firm columns carry a mark or
   a short value, so they get less. `--sc-crit-w` / `--sc-col-w` are shared
   with the lane. */
.sc-board {
    --sc-crit-w: 26%;
    --sc-col-w: 18.5%;
}

.sc-table .sc-crit { width: var(--sc-crit-w); }
.sc-table .sc-firm { width: var(--sc-col-w); }

/* --- head row --- */

.sc-firm,
.sc-crit--head {
    padding: 0 12px 22px;
    font-weight: 800;
    vertical-align: bottom;
}

.sc-crit--head {
    text-align: start;
    font-size: 12.5px;
    color: var(--sc-muted);
    letter-spacing: .02em;
}

.sc-firm {
    position: relative;
    text-align: center;
}

/* --- firm logos ------------------------------------------------------------
   Every mark is painted through a CSS mask rather than shown as an image, so
   four logos drawn in four different palettes come out in ONE flat colour and
   the header row reads as a set. Requires a transparent source file: the mask
   takes the alpha channel, so an opaque JPEG would paint a solid block.

   `--sc-logo` is the file, set inline by the partial. */

.sc-firm__logo {
    display: block;
    width: 100%;
    /* Per-firm box, from the partial. One shared size does not work: these
       marks run from 1.6:1 to 10.3:1, and `contain` in a fixed box renders the
       wide wordmark tiny and the near-square mark oversized. */
    max-width: var(--sc-logo-w, 132px);
    height: var(--sc-logo-h, 26px);
    margin-inline: auto;
    -webkit-mask: var(--sc-logo) no-repeat center / contain;
    mask: var(--sc-logo) no-repeat center / contain;
    background: var(--sc-text-2);
    transition: background .25s ease;
}

/* Our own column keeps the brand, the way its wordmark did. */
.sc-firm.is-us .sc-firm__logo {
    background: linear-gradient(96deg, var(--sc-cyan) 0%, var(--sc-primary-2) 60%, #8B7BFF 100%);
}

/* With a logo present the name stays in the accessibility tree but leaves the
   layout — otherwise the column is announced, and printed, twice. */
.sc-firm.has-logo .sc-firm__name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* No mask support (or a blocked file): fall back to the wordmark rather than
   to an invisible header. */
@supports not ((-webkit-mask-image: url("#")) or (mask-image: url("#"))) {
    .sc-firm__logo { display: none; }

    .sc-firm.has-logo .sc-firm__name {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip-path: none;
    }
}

.sc-firm__name {
    display: block;
    font-size: clamp(13px, 1.5vw, 17px);
    line-height: 1.4;
    color: var(--sc-text-2);
}

.sc-firm.is-us .sc-firm__name {
    font-size: clamp(15px, 1.8vw, 20px);
    font-weight: 900;
    background: linear-gradient(96deg, var(--sc-cyan) 0%, var(--sc-primary-2) 60%, #8B7BFF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sc-firm__ribbon {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--sc-grad);
    box-shadow: 0 8px 26px -10px rgba(0, 123, 255, .9);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    white-space: nowrap;
}

/* --- the lit lane behind our own column ------------------------------------
   Painted as one element rather than as a background on every cell, so the
   highlight is a continuous column of light with rounded ends instead of a
   stack of boxes. `--sc-n` is the column count, from the partial. */

.sc-lane {
    position: absolute;
    /* The criterion column takes the first of (n + 1) tracks. */
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: var(--sc-col-w);
    border-radius: 22px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--sc-primary) 22%, transparent) 0%,
        color-mix(in srgb, var(--sc-primary) 9%, transparent) 45%,
        color-mix(in srgb, var(--sc-primary) 16%, transparent) 100%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--sc-primary-2) 34%, transparent),
        0 24px 70px -34px rgba(0, 123, 255, .9);
    /* Our column is the SECOND track, so shift one criterion column across.
       The inline axis is used deliberately: the lane must land on the same
       column in RTL and LTR, and the table lays its columns out in the page
       direction too. */
    margin-inline-start: var(--sc-crit-w);
    pointer-events: none;
}

html:not(.dark) .sc-lane {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--sc-primary) 14%, transparent) 0%,
        color-mix(in srgb, var(--sc-primary) 5%, transparent) 45%,
        color-mix(in srgb, var(--sc-primary) 10%, transparent) 100%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--sc-primary-2) 26%, transparent),
        0 20px 50px -34px rgba(0, 90, 200, .7);
}

/* --- body rows --- */

.sc-crit,
.sc-cell {
    padding: 18px 12px;
    border-top: 1px solid var(--sc-line);
}

.sc-crit--head,
.sc-firm { border-top: 0; }

/* NOT `display: flex`. Giving a <th> a flex display takes it out of the table
   layout — the browser wraps it in an anonymous cell — so `table-layout: fixed`
   stops seeing the column width above and the criterion column collapses to a
   one-word-per-line strip. The icon and the label are laid out inline instead,
   and the cell stays a real table cell. */
.sc-crit {
    text-align: start;
    vertical-align: middle;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--sc-text);
}

.sc-crit__ico {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-inline-end: 11px;
    border-radius: 10px;
    border: 1px solid var(--sc-line-2);
    background: color-mix(in srgb, var(--sc-primary) 12%, transparent);
    color: var(--sc-sky);
    font-size: 17px;
}

.sc-crit__label { vertical-align: middle; }

html:not(.dark) .sc-crit__ico { color: var(--sc-primary); }

.sc-cell {
    text-align: center;
    font-size: 13.5px;
    color: var(--sc-text-2);
}

.sc-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
}

.sc-mark--yes {
    background: color-mix(in srgb, var(--sc-mint) 18%, transparent);
    color: var(--sc-mint);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--sc-mint) 34%, transparent);
}

/* Ours is the brand tick, so the winning column reads at a glance. */
.sc-cell.is-us .sc-mark--yes {
    background: var(--sc-grad);
    color: #FFFFFF;
    box-shadow: 0 8px 22px -8px rgba(0, 123, 255, .95);
}

/* A hollow ring, not a red cross: the competitors are not being accused of
   anything, they simply do not offer it. */
.sc-mark--no {
    color: var(--sc-no);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc-no) 34%, transparent);
}

.sc-val {
    display: inline-block;
    font-weight: 700;
    color: var(--sc-muted);
}

.sc-cell.is-us .sc-val {
    color: var(--sc-text);
    font-weight: 800;
}

/* A qualifier under a mark — «پلن اسپید» under our tick on the "no rules but
   drawdown" row says which plan earns it. */
.sc-cell-note {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--sc-muted);
}

.sc-cell.is-us .sc-cell-note { color: var(--sc-sky); }
html:not(.dark) .sc-cell.is-us .sc-cell-note { color: var(--sc-primary); }

/* --- score row --- */

.sc-crit--score {
    padding-top: 24px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--sc-muted);
    border-top: 1px solid var(--sc-line-2);
}

.sc-cell--score {
    padding-top: 24px;
    border-top: 1px solid var(--sc-line-2);
    white-space: nowrap;
}

.sc-score {
    display: inline-block;
    font-size: clamp(22px, 2.6vw, 32px);
    font-weight: 900;
    line-height: 1.2;
    color: var(--sc-text-2);
}

.sc-cell--score.is-us .sc-score {
    background: linear-gradient(96deg, var(--sc-cyan) 0%, var(--sc-primary-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sc-score__of {
    font-size: .48em;
    font-weight: 700;
    color: var(--sc-muted);
}

/* The gradient is clipped to the digit only; the «/۶» keeps its own colour. */
.sc-cell--score.is-us .sc-score__of {
    -webkit-text-fill-color: var(--sc-muted);
    color: var(--sc-muted);
}

/* -----------------------------------------------------------------------------
   Footer strip
   -------------------------------------------------------------------------- */

.sc-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    max-width: 1060px;
    margin: 30px auto 0;
}

.sc-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    max-width: 640px;
    font-size: 12px;
    line-height: 1.9;
    color: var(--sc-muted);
}

.sc-note i {
    flex: 0 0 auto;
    margin-top: 4px;
    font-size: 14px;
}

.sc-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--sc-grad);
    box-shadow: 0 14px 40px -16px rgba(0, 123, 255, .95);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease;
}

.sc-cta:hover,
.sc-cta:focus-visible {
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 18px 46px -14px rgba(0, 123, 255, 1);
}

.sc-cta:focus-visible {
    outline: 2px solid var(--sc-cyan);
    outline-offset: 3px;
}

/* site.css already mirrors `.isax-arrow-left` under LTR with `scaleX(-1)` at
   specificity (0,3,1), so this rule doubles the class to outrank it. */
.sc-cta i.isax { font-size: 17px; }
html[dir="ltr"] .sc-cta .sc-cta i.isax { transform: rotate(180deg); }

/* -----------------------------------------------------------------------------
   Phones — reflow the rows into blocks
   -----------------------------------------------------------------------------
   A four-firm table cannot be read at 390px and a sideways-scrolling table is
   worse. Each row becomes its own block: the criterion as a heading, then the
   four firms as labelled chips. The <table> semantics are kept for screen
   readers by leaving the elements in place and only changing `display`.
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    /* The lane cannot follow a column that no longer exists. */
    .sc-lane { display: none; }

    .sc-table,
    .sc-table thead,
    .sc-table tbody,
    .sc-table tfoot,
    .sc-table tr,
    .sc-table th,
    .sc-table td {
        display: block;
        width: auto;
    }

    /* The head row only labels columns; the chips carry their own labels (a
       wordmark logo at chip height would be unreadable, so the chips stay
       text — see the `data-firm` rule below). */
    .sc-table thead { display: none; }

    .sc-table tbody tr,
    .sc-table tfoot tr {
        padding-block: 18px;
        border-top: 1px solid var(--sc-line);
    }

    .sc-table tbody tr:first-child { border-top: 0; }

    .sc-crit,
    .sc-cell {
        padding: 0;
        border-top: 0;
    }

    .sc-crit { margin-bottom: 14px; }

    /* tbody rows lay their four cells out as a grid of labelled chips. */
    .sc-table tbody tr,
    .sc-table tfoot tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .sc-crit,
    .sc-crit--score { grid-column: 1 / -1; }

    .sc-cell {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 13px;
        border-radius: 13px;
        background: var(--sc-surface);
        box-shadow: inset 0 0 0 1px var(--sc-line);
        text-align: start;
    }

    /* The column header has to travel with the cell once the head row is
       gone — `data-firm` carries it. */
    .sc-cell::before {
        content: attr(data-firm);
        font-size: 11.5px;
        font-weight: 700;
        color: var(--sc-muted);
        /* Latin brand names inside an RTL run. */
        direction: ltr;
        unicode-bidi: isolate;
    }

    .sc-cell.is-us {
        background: color-mix(in srgb, var(--sc-primary) 16%, transparent);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc-primary-2) 40%, transparent);
    }

    .sc-cell.is-us::before { color: var(--sc-sky); }
    html:not(.dark) .sc-cell.is-us::before { color: var(--sc-primary); }

    .sc-mark { width: 26px; height: 26px; font-size: 16px; order: 3; }

    /* On a chip the qualifier rides beside the mark, at the far end. */
    .sc-cell-note {
        order: 2;
        margin-top: 0;
        margin-inline-start: auto;
    }

    .sc-crit--score {
        margin-bottom: 4px;
        border-top: 0;
        padding-top: 0;
    }

    .sc-cell--score { padding-top: 10px; border-top: 0; }
    .sc-score { font-size: 20px; }

    .sc-foot { flex-direction: column; align-items: stretch; }
    .sc-cta { justify-content: center; }
}

/* -----------------------------------------------------------------------------
   Entrance
   -----------------------------------------------------------------------------
   Y + opacity only. Nothing moves on the inline axis, so RTL and LTR play the
   identical timeline and nothing can walk off its own side.
   -------------------------------------------------------------------------- */

.sc-why.is-armed .sc-table tbody tr,
.sc-why.is-armed .sc-table tfoot tr {
    opacity: 0;
    transform: translateY(12px);
}

.sc-why.is-armed .sc-lane {
    opacity: 0;
    transform: scaleY(.8);
}

.sc-why.is-armed.is-in .sc-table tbody tr,
.sc-why.is-armed.is-in .sc-table tfoot tr {
    opacity: 1;
    transform: none;
    transition: opacity .5s ease var(--d, 0ms), transform .6s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms);
}

.sc-why.is-armed.is-in .sc-lane {
    opacity: 1;
    transform: none;
    transition: opacity .6s ease, transform .8s cubic-bezier(.22, 1, .36, 1);
}

/* -----------------------------------------------------------------------------
   Reduced motion
   -----------------------------------------------------------------------------
   scorecard.js never arms the section under this preference, so everything is
   already on its finished frame; this only silences the hovers.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .sc-why *,
    .sc-why *::before,
    .sc-why *::after {
        animation: none !important;
        transition-duration: .01ms !important;
    }
}
