/* ============================================================
   Growth Marketing Illustration — funnel + experiment log
   Lives under "The Reality" on /services/growth-marketing/.
   Visual metaphor: every stage of the funnel, tested continuously.
   All classes prefixed .gm-* to avoid global conflicts.
   ============================================================ */

.gm-ill-section {
    background: #FAFAF7;
    padding: clamp(2rem, 5vw, 4rem) 0;
}
.gm-ill-section__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
}

.gm-ill {
    width: 100%;
    max-width: 1240px;
    aspect-ratio: 16 / 9;
    position: relative;
    background: #FAFAF7;
    border-radius: 18px;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(17, 24, 39, 0.06);
    color: #111827;
    font-family: var(--font-primary, 'Plus Jakarta Sans'), system-ui, sans-serif;
}
.gm-ill *,
.gm-ill *::before,
.gm-ill *::after { box-sizing: border-box; }

.gm-ill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(217, 119, 6, 0.04), transparent 60%);
    pointer-events: none;
}

.gm-ill__inner {
    position: absolute;
    inset: 8% 8% 14% 8%;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 5%;
    align-items: stretch;
}

/* ── Left: Funnel panel ──────────────────────────── */
.gm-funnel {
    position: relative;
    background: #FFFFFF;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 12px;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.gm-funnel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    margin-bottom: 4px;
}
.gm-funnel__lbl {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: rgba(17, 24, 39, 0.5);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.gm-funnel__title {
    font-family: var(--font-primary, 'Plus Jakarta Sans'), sans-serif;
    font-weight: 300;
    font-size: 17px;
    color: #111827;
    letter-spacing: -0.2px;
}
.gm-funnel__period {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(17, 24, 39, 0.5);
    white-space: nowrap;
}

/* The funnel stages — each row holds a bar (narrowing) and labels */
.gm-stages {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0;
}
.gm-stage {
    position: relative;
    display: flex;
    align-items: center;
    height: 30px;
}
.gm-stage__bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.15), rgba(217, 119, 6, 0.06));
    border: 1px solid rgba(217, 119, 6, 0.20);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    transition: width 0.4s ease-out;
}
.gm-stage--1 .gm-stage__bar { width: 100%; }
.gm-stage--2 .gm-stage__bar { width: 76%; }
.gm-stage--3 .gm-stage__bar { width: 56%; }
.gm-stage--4 .gm-stage__bar { width: 38%; }
.gm-stage--5 .gm-stage__bar {
    width: 22%;
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.35), rgba(217, 119, 6, 0.18));
    border-color: rgba(217, 119, 6, 0.4);
}

.gm-stage__name {
    font-family: var(--font-primary, 'Plus Jakarta Sans'), sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    letter-spacing: -0.1px;
}
.gm-stage__val {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 500;
    color: #111827;
    margin-left: 14px;
    font-variant-numeric: tabular-nums;
}
.gm-stage--5 .gm-stage__name,
.gm-stage--5 .gm-stage__val { color: #7A3F03; }

/* Conversion % chip between stages */
.gm-conv {
    align-self: flex-start;
    margin: -2px 0 -2px 14px;
    padding: 1px 7px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: 0.8px;
    color: rgba(17, 24, 39, 0.5);
    background: #FAFAF7;
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 999px;
    text-transform: uppercase;
}

/* Traveling cohort dot — follows the funnel down */
.gm-cohort {
    position: absolute;
    left: 14px;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D97706;
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18), 0 0 12px rgba(217, 119, 6, 0.5);
    animation: gm-cohort-travel 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes gm-cohort-travel {
    0%        { top: 0; opacity: 0; transform: scale(0.6); }
    8%        { opacity: 1; transform: scale(1); }
    20%       { top: calc(34px * 1); }
    40%       { top: calc(34px * 2); }
    60%       { top: calc(34px * 3); }
    80%       { top: calc(34px * 4); }
    92%, 100% { top: calc(34px * 5); opacity: 0; transform: scale(0.6); }
}

/* LTV strip at bottom of funnel panel */
.gm-ltv {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(17, 24, 39, 0.06);
}
.gm-ltv__cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gm-ltv__cap {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: 1.2px;
    color: rgba(17, 24, 39, 0.45);
    text-transform: uppercase;
}
.gm-ltv__val {
    font-family: var(--font-primary, 'Plus Jakarta Sans'), sans-serif;
    font-weight: 300;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: #111827;
    font-variant-numeric: tabular-nums;
}
.gm-ltv__delta {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: #10B981;
    letter-spacing: 0.4px;
}
.gm-ltv__delta::before { content: '↑ '; }

/* ── Right: Experiments panel ──────────────────── */
.gm-exp {
    background: #FFFFFF;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 12px;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}
.gm-exp__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}
.gm-exp__head-meta {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: rgba(17, 24, 39, 0.5);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.gm-exp__head-title {
    font-family: var(--font-primary, 'Plus Jakarta Sans'), sans-serif;
    font-weight: 300;
    font-size: 17px;
    color: #111827;
    letter-spacing: -0.2px;
}
.gm-exp__count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: rgba(17, 24, 39, 0.5);
    letter-spacing: 0.5px;
    text-align: right;
}
.gm-exp__count strong {
    display: block;
    font-family: var(--font-primary, 'Plus Jakarta Sans'), sans-serif;
    font-weight: 300;
    font-size: 28px;
    letter-spacing: -1px;
    color: #D97706;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Individual experiment rows */
.gm-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(17, 24, 39, 0.08);
    animation: gm-row-in 1s ease-out both;
}
.gm-row:last-of-type { border-bottom: none; }
.gm-row--1 { animation-delay: 0.05s; }
.gm-row--2 { animation-delay: 0.15s; }
.gm-row--3 { animation-delay: 0.25s; }
.gm-row--4 { animation-delay: 0.35s; }
@keyframes gm-row-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gm-row__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.gm-row--won .gm-row__icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.gm-row--running .gm-row__icon {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.35);
    color: #D97706;
}
.gm-row--queued .gm-row__icon {
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(17, 24, 39, 0.15);
    color: rgba(17, 24, 39, 0.55);
}

/* Spinner for running */
.gm-row--running .gm-row__icon::before {
    content: '';
    width: 11px;
    height: 11px;
    border: 2px solid rgba(217, 119, 6, 0.25);
    border-top-color: #D97706;
    border-radius: 50%;
    animation: gm-spin 0.9s linear infinite;
}
@keyframes gm-spin { to { transform: rotate(360deg); } }

.gm-row__name {
    font-family: var(--font-primary, 'Plus Jakarta Sans'), sans-serif;
    font-size: 13px;
    color: #111827;
    letter-spacing: -0.1px;
    line-height: 1.3;
}
.gm-row__sub {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: rgba(17, 24, 39, 0.5);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.gm-row__delta {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 4px 9px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.gm-row--won .gm-row__delta {
    color: #10B981;
    background: rgba(16, 185, 129, 0.08);
}
.gm-row--running .gm-row__delta {
    color: #D97706;
    background: rgba(217, 119, 6, 0.08);
}
.gm-row--queued .gm-row__delta {
    color: rgba(17, 24, 39, 0.5);
    background: rgba(17, 24, 39, 0.04);
}

.gm-exp__foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: rgba(17, 24, 39, 0.5);
    text-transform: uppercase;
}
.gm-exp__foot strong { color: #111827; font-weight: 500; }
.gm-exp__foot-bar {
    flex: 1;
    height: 2px;
    background: rgba(17, 24, 39, 0.06);
    border-radius: 1px;
    overflow: hidden;
    position: relative;
}
.gm-exp__foot-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #D97706, transparent);
    animation: gm-foot-sweep 3.5s ease-in-out infinite;
}
@keyframes gm-foot-sweep {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ── Bottom corner marks ─────────────────────────── */
.gm-ill__mark {
    position: absolute;
    bottom: 28px;
    left: 36px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(17, 24, 39, 0.35);
}
.gm-ill__mark strong { color: #111827; font-weight: 500; }
.gm-ill__mark-line {
    display: inline-block;
    width: 28px;
    height: 1px;
    background: rgba(217, 119, 6, 0.5);
    vertical-align: middle;
    margin: 0 8px;
}
.gm-ill__index {
    position: absolute;
    bottom: 28px;
    right: 36px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(17, 24, 39, 0.35);
}
.gm-ill__index strong { color: #D97706; font-weight: 500; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 920px) {
    .gm-ill { aspect-ratio: 4 / 5; }
    .gm-ill__inner {
        grid-template-columns: 1fr;
        inset: 6%;
        gap: 4%;
    }
    .gm-ltv { grid-template-columns: 1fr; gap: 8px; }
    .gm-ill__mark,
    .gm-ill__index { bottom: 16px; }
    .gm-ill__mark { left: 20px; }
    .gm-ill__index { right: 20px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gm-cohort,
    .gm-row,
    .gm-row--running .gm-row__icon::before,
    .gm-exp__foot-bar::after { animation: none; }
    .gm-row { opacity: 1; transform: none; }
    .gm-cohort { opacity: 1; top: calc(34px * 2); }
}
