/* ═══════════════════════════════════════════════════════════════════
   Nonlinear Platform — platform page visuals (v2.1.0)
   Hero artwork, application screenshots, charts and "at a glance" tables
   of the natively written platform pages (inc/platform-visuals.php).
   Every chart is readable without JavaScript; the entrance animations
   only run when the page has the nlp-js class and the chart is reached.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hero artwork ── */
.nlp-hero-visual { position: relative; overflow: hidden; padding-bottom: 80px; max-width: none; width: 100%; }
.nlp-hero-bg {
    position: absolute; inset: -2%; z-index: 0;
    background-size: cover; background-position: 62% 50%; background-repeat: no-repeat;
    opacity: .62; transform: scale(1.04); will-change: transform;
    animation: nlpHeroDrift 32s ease-in-out infinite alternate;
}
.nlp-hero-visual::after {
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 50% 38%, rgba(7,10,18,0.15) 0%, rgba(7,10,18,0.72) 100%),
        linear-gradient(180deg, rgba(7,10,18,0.55) 0%, rgba(7,10,18,0.2) 30%, rgba(7,10,18,0.7) 78%, #070a12 100%);
}
.nlp-hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.nlp-hero-text, .nlp-hero-shot { position: relative; z-index: 2; }
.nlp-hero-shot { width: min(1000px, 92%); margin: 56px auto 0; }
.nlp-hero-shot .visual-showcase { margin: 0 auto; max-width: none; }
@keyframes nlpHeroDrift {
    from { transform: scale(1.04) translate3d(0, 0, 0); }
    to   { transform: scale(1.12) translate3d(-1.6%, -1.2%, 0); }
}

/* ── Application screenshots (frame shared with the older pages' showcase) ── */
.nlp-shot { position: relative; background: #0b1025; box-shadow: 0 18px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,168,76,0.08); }
.nlp-shot-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: rgba(255,255,255,0.035); border-bottom: 1px solid rgba(201,168,76,0.12); }
.nlp-shot-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.14); }
.nlp-shot-bar span:nth-child(1) { background: rgba(217,120,90,0.75); }
.nlp-shot-bar span:nth-child(2) { background: rgba(226,200,126,0.75); }
.nlp-shot-bar span:nth-child(3) { background: rgba(63,182,168,0.75); }
.nlp-shot img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.nlp-shot:hover img { transform: scale(1.012); }
.section .nlp-shot { max-width: 960px; margin: 44px auto 8px; }

/* ── Chart panels ── */
.nlp-chart {
    margin: 0; text-align: left; position: relative;
    background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
    border: 1px solid rgba(201,168,76,0.14); border-radius: 14px; padding: 26px 26px 18px;
}
.nlp-chart-lead { max-width: 880px; margin: 36px auto 4px; }
.nlp-chart-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 22px; }
.nlp-chart-title { font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif); font-size: 1.32rem; font-weight: 600; color: var(--text-on-dark, #f5f1ea); line-height: 1.25; }
.nlp-chart-sub { font-size: .86rem; color: var(--text-muted, #a9a9a9); line-height: 1.5; }
.nlp-chart-note { font-size: .78rem; color: #8c8699; margin: 16px 0 0; line-height: 1.5; font-style: italic; }
.nlp-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 28px; margin-top: 56px; }
.nlp-chart-grid--one { max-width: 880px; margin-left: auto; margin-right: auto; grid-template-columns: 1fr; }
.nlp-numbers .stats-row { margin-top: 40px; }

/* horizontal bars */
.nlp-hbars { display: flex; flex-direction: column; gap: 12px; }
.nlp-hbar { display: grid; grid-template-columns: minmax(88px, 36%) 1fr minmax(42px, auto); align-items: center; gap: 12px; font-size: .88rem; }
.nlp-hbar-label { color: var(--text-on-dark, #f5f1ea); line-height: 1.3; }
.nlp-hbar-track { height: 14px; background: rgba(255,255,255,0.05); border-radius: 7px; overflow: hidden; }
.nlp-hbar-fill {
    display: block; height: 100%; width: max(3px, calc(var(--v) * 100%)); border-radius: 7px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.22)), var(--c);
    transform-origin: left center; transition: transform 1.1s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 80ms);
}
.nlp-hbar-value { color: var(--c); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.nlp-js .nlp-chart:not(.is-in) .nlp-hbar-fill { transform: scaleX(0); }

/* vertical bars (become horizontal rows on narrow screens) */
.nlp-vbars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; align-items: end; height: 280px; }
.nlp-vbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; min-width: 0; }
.nlp-vbar-col { position: relative; flex: 1; width: 72%; max-width: 56px; display: flex; align-items: flex-end; background: rgba(255,255,255,0.04); border-radius: 6px 6px 0 0; margin-top: 22px; }
.nlp-vbar-fill {
    display: block; width: 100%; height: max(2px, calc(var(--v) * 100%)); border-radius: 6px 6px 0 0;
    background: linear-gradient(0deg, rgba(255,255,255,0), rgba(255,255,255,0.22)), var(--c);
    transform-origin: center bottom; transition: transform 1s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 70ms);
}
.nlp-vbar-value { position: absolute; left: 50%; bottom: calc(max(2px, var(--v) * 100%) + 6px); transform: translateX(-50%); font-size: .8rem; color: var(--c); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition: opacity .5s ease calc(.6s + var(--i, 0) * 70ms); }
.nlp-js .nlp-chart:not(.is-in) .nlp-vbar-value { opacity: 0; }
.nlp-vbar-label { font-size: .74rem; color: var(--text-muted, #a9a9a9); text-align: center; line-height: 1.25; min-height: 2.5em; overflow-wrap: anywhere; }
.nlp-js .nlp-chart:not(.is-in) .nlp-vbar-fill { transform: scaleY(0); }
@media (max-width: 560px) {
    .nlp-vbars { display: flex; flex-direction: column; height: auto; gap: 12px; }
    .nlp-vbar { display: grid; grid-template-columns: minmax(84px, 36%) 1fr minmax(42px, auto); align-items: center; gap: 12px; height: auto; }
    .nlp-vbar-label { order: 1; text-align: left; min-height: 0; font-size: .84rem; color: var(--text-on-dark, #f5f1ea); }
    .nlp-vbar { grid-template-columns: minmax(84px, 36%) 1fr; }
    .nlp-vbar-col { order: 2; height: 14px; width: auto; max-width: none; flex: none; border-radius: 7px; align-items: stretch; margin: 0 56px 0 0; }
    .nlp-vbar-fill { height: 100%; width: max(3px, calc(var(--v) * 100%)); border-radius: 7px; transform-origin: left center; }
    .nlp-vbar-value { left: calc(max(3px, var(--v) * 100%) + 8px); bottom: auto; top: 50%; transform: translateY(-50%); font-size: .86rem; }
    .nlp-js .nlp-chart:not(.is-in) .nlp-vbar-fill { transform: scaleX(0); }
}

/* donut */
.nlp-donut-wrap { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }
.nlp-donut { width: 200px; height: 200px; flex: none; }
.nlp-donut-seg { transition: stroke-dasharray 1.2s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 120ms); }
.nlp-js .nlp-chart:not(.is-in) .nlp-donut-seg { stroke-dasharray: 0 var(--circ); }
.nlp-donut-total { fill: var(--text-on-dark, #f5f1ea); font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif); font-size: 36px; font-weight: 600; }
.nlp-donut-unit { fill: #a9a9a9; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.nlp-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1 1 220px; min-width: 0; }
.nlp-legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; font-size: .86rem; color: var(--text-on-dark, #f5f1ea); line-height: 1.35; }
.nlp-legend-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.nlp-legend-value { color: var(--c); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nlp-legend-value small { color: #8c8699; font-weight: 400; font-size: .78em; margin-left: 4px; }
.nlp-legend--inline { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.nlp-legend--inline li { grid-template-columns: 12px auto; }

/* radar */
.nlp-radar { width: 100%; max-width: 560px; display: block; margin: 0 auto; }
.nlp-radar-label { fill: #d8d2c6; font-size: 15px; }
.nlp-radar-shape { transform-box: view-box; transform-origin: 290px 215px; transition: transform 1.1s cubic-bezier(.2,.8,.2,1), opacity 1.1s ease; }
.nlp-js .nlp-chart:not(.is-in) .nlp-radar-shape { transform: scale(0.05); opacity: 0; }

/* line + scatter */
.nlp-line, .nlp-scatter { width: 100%; height: auto; display: block; }
.nlp-scatter { max-width: 560px; margin: 0 auto; }
.nlp-axis { fill: #8c8699; font-size: 14px; }
.nlp-axis-title { fill: #b8b2a6; font-size: 14px; }
.nlp-line-value { fill: #eae4d8; font-size: 13px; font-weight: 600; }
.nlp-line-path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(.4,.1,.2,1); }
.nlp-js .nlp-chart:not(.is-in) .nlp-line-path { stroke-dashoffset: 1; }
.nlp-line-dot, .nlp-line-value, .nlp-line-area { transition: opacity .6s ease calc(.7s + var(--i, 0) * 60ms); }
.nlp-js .nlp-chart:not(.is-in) .nlp-line-dot, .nlp-js .nlp-chart:not(.is-in) .nlp-line-value, .nlp-js .nlp-chart:not(.is-in) .nlp-line-area { opacity: 0; }
.nlp-scatter-label { fill: #eae4d8; font-size: 15px; font-weight: 600; }
.nlp-scatter-pt { transform-box: fill-box; transform-origin: center; transition: opacity .7s ease calc(var(--i, 0) * 160ms), transform .7s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 160ms); }
.nlp-js .nlp-chart:not(.is-in) .nlp-scatter-pt { opacity: 0; transform: scale(.4); }
.nlp-scatter-link { transition: opacity 1s ease .5s; }
.nlp-js .nlp-chart:not(.is-in) .nlp-scatter-link { opacity: 0; }

/* ── "At a glance" table ── */
.nlp-glance-title { margin-top: 64px; }
.nlp-glance { margin-top: 28px; border: 1px solid rgba(201,168,76,0.14); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.02); }
.nlp-glance table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.nlp-glance th, .nlp-glance td { padding: 14px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(255,255,255,0.05); line-height: 1.55; }
.nlp-glance thead th { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold, #c9a961); background: rgba(201,168,76,0.06); font-weight: 600; }
.nlp-glance tbody th { color: var(--text-on-dark, #f5f1ea); font-weight: 600; width: 32%; }
.nlp-glance td { color: var(--text-muted, #a9a9a9); }
.nlp-glance tbody tr:nth-child(even) th, .nlp-glance tbody tr:nth-child(even) td { background: rgba(255,255,255,0.012); }
.nlp-glance tbody tr:last-child th, .nlp-glance tbody tr:last-child td { border-bottom: none; }
.nlp-glance .nlp-chart-note { padding: 0 20px 16px; }

/* ── Utilities ── */
.nlp-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 768px) {
    .nlp-hero-visual { padding-bottom: 56px; }
    .nlp-hero-shot { margin-top: 40px; width: 100%; padding: 0 5%; }
    .nlp-chart { padding: 20px 16px 14px; border-radius: 12px; }
    .nlp-chart-title { font-size: 1.18rem; }
    .nlp-chart-grid { gap: 20px; margin-top: 40px; }
    .nlp-glance th, .nlp-glance td { padding: 12px 14px; font-size: .88rem; }
    .nlp-glance tbody th { width: 38%; }
    .nlp-donut { width: 180px; height: 180px; }
}
@media (max-width: 420px) {
    .nlp-glance thead { display: none; }
    .nlp-glance tbody tr { display: block; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .nlp-glance tbody th, .nlp-glance tbody td { display: block; width: auto; padding: 0; border: none; background: none !important; }
    .nlp-glance tbody th { margin-bottom: 4px; font-size: .86rem; }
    .nlp-hbar { grid-template-columns: minmax(76px, 38%) 1fr minmax(38px, auto); gap: 9px; font-size: .82rem; }
    .nlp-vbar { grid-template-columns: minmax(76px, 38%) 1fr; gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .nlp-hero-bg { animation: none; }
    .nlp-hbar-fill, .nlp-vbar-fill, .nlp-donut-seg, .nlp-radar-shape, .nlp-line-path, .nlp-line-dot, .nlp-line-value, .nlp-line-area, .nlp-scatter-pt, .nlp-scatter-link, .nlp-shot img { transition: none; }
}
