/* ==========================================================================
   SenAI — inner page kit
   Loaded after css/system.css on every inner page (body.sx).
   Reuses the homepage tokens: --sig gradient, --indigo, --dia*, --tint, --lav,
   --red, --rule, --r, the 12-col .wrap grid, .btn, .link, .anno, .ticks, .frame.
   ========================================================================== */

/* ---------- section scaffolding ---------- */
.p-section {
    position: relative;
    padding-block: clamp(80px, 11vh, 140px);
}

.p-section--tint {
    background:
        radial-gradient(50% 45% at 80% 30%, rgba(232, 229, 255, 0.6), rgba(232, 229, 255, 0) 70%),
        radial-gradient(40% 35% at 10% 85%, rgba(63, 156, 232, 0.08), rgba(63, 156, 232, 0) 70%),
        var(--tint);
}

.p-head {
    row-gap: 18px;
    margin-bottom: clamp(40px, 6vh, 72px);
    align-items: end;
}

.p-head > .h1,
.p-head > .h2 {
    grid-column: 2 / 9;
}

.p-head > .lead {
    grid-column: 9 / -1;
    font-size: 17px;
}

.p-head--stack > .lead {
    grid-column: 2 / 8;
}

.p-body {
    grid-column: 2 / -1;
}

.p-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--rule);
    font: 500 12px/1 var(--f-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--indigo);
    width: max-content;
    max-width: 100%;
}

.p-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sig);
    flex: none;
}

.grad {
    background: var(--sig);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- page hero ---------- */
.p-hero {
    position: relative;
    min-height: min(100svh, 920px);
    padding: calc(var(--nav-h) + 6vh) 0 64px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.p-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(40% 50% at 78% 45%, rgba(232, 229, 255, 0.9), rgba(232, 229, 255, 0) 70%),
        radial-gradient(30% 36% at 64% 70%, rgba(63, 156, 232, 0.12), rgba(63, 156, 232, 0) 70%),
        radial-gradient(24% 30% at 92% 20%, rgba(159, 94, 223, 0.12), rgba(159, 94, 223, 0) 70%);
}

.p-hero .wrap {
    align-items: center;
    row-gap: 40px;
    position: relative;
    z-index: 2;
}

.p-hero-copy {
    grid-column: 2 / 8;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
}

.p-hero-copy--wide {
    grid-column: 2 / 11;
}

.p-hero h1 {
    font-size: clamp(40px, 4.6vw, 80px);
    font-weight: 620;
    line-height: 1.02;
    letter-spacing: -0.038em;
    color: var(--ink);
}

.p-hero .lead {
    font-size: 19px;
    max-width: 46ch;
}

.p-hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    align-items: center;
}

.p-hero-visual {
    grid-column: 8 / -1;
    position: relative;
}

.p-hero-visual > img,
.p-hero-visual > svg {
    width: 100%;
    height: auto;
}

.p-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    font: 400 12px/1.4 var(--f-mono);
    color: var(--navy);
}

.p-meta b {
    font-weight: 500;
    color: var(--ink);
}

/* ---------- cards ---------- */
.p-grid {
    display: grid;
    gap: 20px;
}

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

.p-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--rule);
    transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.4s;
}

.p-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 24px 60px rgba(79, 70, 229, 0.1);
}

.p-card h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--ink);
}

.p-card p,
.p-card li {
    font-size: 15.5px;
    color: var(--body);
    line-height: 1.55;
}

.p-card .p-num {
    font: 500 12px/1 var(--f-mono);
    color: var(--indigo);
}

.p-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--lav);
    color: var(--indigo);
    flex: none;
}

.p-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.p-card--tint {
    background: var(--tint);
}

.p-card--grad {
    background: var(--sig);
    border: 0;
    color: #fff;
}

.p-card--grad h3,
.p-card--grad p,
.p-card--grad li {
    color: #fff;
}

/* ---------- stats ---------- */
.p-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.p-stat {
    padding: 28px 24px 28px 0;
    display: grid;
    gap: 8px;
    align-content: start;
}

.p-stat + .p-stat {
    padding-left: 24px;
    border-left: 1px solid var(--rule);
}

.p-stat b {
    font-size: clamp(44px, 4.6vw, 76px);
    font-weight: 300;
    letter-spacing: -0.05em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: var(--sig);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-right: 0.06em;
    width: max-content;
}

/* the count-up number inside <b> is a span too: keep it at the big size */
.p-stat b span {
    font: inherit;
    color: inherit;
}

.p-stat > span {
    font-size: 15px;
    color: var(--body);
    line-height: 1.45;
}

/* ---------- split rows (text + media) ---------- */
.p-split {
    align-items: center;
    row-gap: 40px;
}

.p-split-text {
    grid-column: 2 / 7;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.p-split-media {
    grid-column: 8 / -1;
}

.p-split--rev .p-split-text {
    grid-column: 8 / -1;
    grid-row: 1;
}

.p-split--rev .p-split-media {
    grid-column: 2 / 7;
    grid-row: 1;
}

.p-media {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #fff;
}

.p-media img,
.p-media video {
    display: block;
    width: 100%;
    height: auto;
}

.p-media--pad {
    padding: 20px;
    background: var(--tint);
}

.p-media--pad img {
    border-radius: 12px;
}

/* ---------- comparison (problem vs solution) ---------- */
.p-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.p-compare .p-card:first-child {
    background: #fff7f8;
    border-color: rgba(224, 86, 111, 0.25);
}

.p-compare .p-card:first-child .p-num {
    color: var(--red);
}

/* ---------- steps / timeline ---------- */
.p-steps {
    display: grid;
    gap: 0;
    counter-reset: step;
}

.p-step {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 24px;
    padding: 28px 0;
    border-top: 1px solid var(--rule);
}

.p-step:last-child {
    border-bottom: 1px solid var(--rule);
}

.p-step-n {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    background: var(--sig);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    width: max-content;
    padding-right: 0.06em;
}

.p-step h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px !important;
}

.p-step p,
.p-step li {
    color: var(--body);
    max-width: 62ch;
}

/* ---------- quote ---------- */
.p-quote {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 64px);
    align-items: center;
    padding: clamp(24px, 4vw, 48px);
    border-radius: 28px;
    background: #fff;
    border: 1px solid var(--rule);
}

.p-quote blockquote {
    font-size: clamp(24px, 2.6vw, 40px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin: 0;
}

.p-quote .p-who {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    align-items: baseline;
}

.p-quote .p-who b {
    font-weight: 600;
}

.p-quote .p-who span {
    font: 400 12px/1.3 var(--f-mono);
    color: var(--navy);
}

.p-quote .p-quote-media {
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4 / 5;
    max-height: 70vh;
}

.p-quote .p-quote-media video,
.p-quote .p-quote-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.p-quote .p-quote-media--logo {
    background: #fff;
    border: 1px solid var(--rule);
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
    padding: 12%;
}

.p-quote .p-quote-media--logo img {
    object-fit: contain;
}

/* ---------- CTA band ---------- */
.p-cta {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    padding: clamp(36px, 6vw, 80px);
    background:
        radial-gradient(60% 80% at 85% 20%, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 60%),
        var(--sig);
    color: #fff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: center;
}

.p-cta h2 {
    font-size: clamp(30px, 3.4vw, 56px);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.04;
    color: #fff !important;
}

.p-cta p {
    margin-top: 14px !important;
    color: rgba(255, 255, 255, 0.85);
    max-width: 52ch;
}

.p-cta .btn {
    background: #fff;
    color: var(--ink) !important;
}

.p-cta .btn .btn__bar {
    background: var(--ink);
}

.p-cta .btn:hover {
    color: #fff !important;
}

/* ---------- prose ---------- */
.p-prose {
    max-width: 68ch;
    display: grid;
    gap: 18px;
}

.p-prose p,
.p-prose li {
    font-size: 18px;
    color: var(--body);
    line-height: 1.65;
}

.p-prose h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 12px !important;
}

.p-prose strong,
.p-prose b {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- animated diagram frame ---------- */
/* body.sx figure resets padding to 0 with higher specificity than .p-diagram, so the
   padding is set via a matching selector — otherwise captions sit on the card border. */
.p-diagram,
body.sx figure.p-diagram {
    position: relative;
    border-radius: 24px;
    border: 1px solid var(--rule);
    background: rgba(255, 255, 255, 0.85);
    padding: clamp(16px, 2.4vw, 32px);
}

.p-diagram svg {
    width: 100%;
    height: auto;
    overflow: visible;
    display: block;
}

.p-diagram text {
    font-family: var(--f-sans);
    fill: var(--ink);
}

.p-diagram .mono {
    font-family: var(--f-mono);
    fill: var(--navy);
}

.p-diagram .box {
    fill: #eef2ff;
    stroke: #6366f1;
    stroke-width: 1.2;
}

.p-diagram .box-soft {
    fill: #fff;
    stroke: var(--dia-soft);
    stroke-width: 1.2;
}

.p-diagram .box-red {
    fill: #fff1f2;
    stroke: var(--red);
    stroke-width: 1.2;
}

.p-diagram .box-sig {
    fill: url(#sigBox);
    stroke: none;
}

.p-diagram .wire {
    fill: none;
    stroke: #3f9ce8;
    stroke-width: 1.5;
}

.p-diagram .wire-sig {
    fill: none;
    stroke: url(#sig);
    stroke-width: 2;
}

.p-diagram .wire-red {
    fill: none;
    stroke: var(--red);
    stroke-width: 1.5;
    stroke-dasharray: 4 5;
}

/* ---------- breadcrumbs ---------- */
.p-crumbs {
    display: flex;
    gap: 10px;
    font: 400 12px/1 var(--f-mono);
    color: var(--navy);
}

.p-crumbs a:hover {
    color: var(--indigo);
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
    .p-head > .h1,
    .p-head > .h2,
    .p-head > .lead,
    .p-body,
    .p-hero-copy,
    .p-hero-copy--wide,
    .p-hero-visual,
    .p-split-text,
    .p-split-media,
    .p-split--rev .p-split-text,
    .p-split--rev .p-split-media {
        grid-column: 1 / -1;
        grid-row: auto;
    }

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

    .p-quote,
    .p-cta {
        grid-template-columns: 1fr;
    }

    .p-hero {
        min-height: 0;
    }
}

@media (max-width: 767px) {
    .p-grid--2,
    .p-grid--3,
    .p-grid--4,
    .p-compare {
        grid-template-columns: 1fr;
    }

    .p-stat + .p-stat {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--rule);
    }

    .p-step {
        grid-template-columns: 56px 1fr;
        gap: 16px;
    }

    .p-step-n {
        font-size: 34px;
    }

    .p-hero .lead {
        font-size: 17px;
    }

    /* tighter vertical rhythm on phones (desktop spacing left ~160px gaps) */
    .p-section {
        padding-block: 56px;
    }

    .p-hero {
        min-height: 0;
        padding: calc(var(--nav-h) + 28px) 0 40px;
    }

    .p-hero .wrap {
        row-gap: 28px;
    }
}
