/* ============================================
   COMPOXER FOR MAC — Launch article visual layer
   Scoped, progressive-enhancement components for the
   "Compoxer for Mac on the Mac App Store" article on
   /news. Activated by js/news-mac.js, which replaces
   [[CX:*]] marker paragraphs with the live components
   below. Without the script the article stays fully
   readable (the prose carries the substance).

   Design language mirrors genesis-article.css (same
   --news-font-* tokens, dark surfaces, hairline borders)
   but swaps the warm champagne accent for the product's
   real brand blue → cyan, the same gradient used by the
   app's Sign-in / Generate buttons.
   ============================================ */

:root {
    --cx-blue:        #3b82f6;
    --cx-blue-deep:   #1e40af;
    --cx-cyan:        #22d3ee;
    --cx-grad:        linear-gradient(135deg, #1e40af 0%, #3b82f6 55%, #22d3ee 100%);
    --cx-surface:     rgba(255, 255, 255, 0.035);
    --cx-surface-2:   rgba(255, 255, 255, 0.025);
    --cx-border:      rgba(255, 255, 255, 0.08);
    --cx-border-soft: rgba(255, 255, 255, 0.06);
    --cx-tint-6:      rgba(59, 130, 246, 0.06);
    --cx-tint-10:     rgba(59, 130, 246, 0.10);
    --cx-tint-18:     rgba(59, 130, 246, 0.18);
    --cx-line:        rgba(59, 130, 246, 0.28);
}

/* ════════════════════════════════════════════════════════
   KEYNOTE LAYER  — scoped to the Compoxer-for-Mac article
   Re-paces the header, hero image and prose into an Apple-
   keynote cadence: oversized headline, cinematic hero,
   clean gradient section titles and a centered pull-quote.
   Scoped via .cx-article / .cx-article-view (added at runtime
   by news-mac.js) so no other News post is ever affected.
   ════════════════════════════════════════════════════════ */

/* Cinematic featured / hero image */
.cx-article-view .article-featured-image {
    max-width: 1120px;
    margin-top: 30px;
    position: relative;
}
.cx-article-view .article-featured-image::before {
    content: '';
    position: absolute;
    inset: -8% 6% auto 6%;
    height: 78%;
    background: radial-gradient(58% 100% at 50% 0%, rgba(59, 130, 246, 0.22), transparent 72%);
    filter: blur(46px);
    z-index: -1;
    pointer-events: none;
}
.cx-article-view .article-featured-image img {
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 34px 96px rgba(0, 0, 0, 0.62),
        0 12px 54px rgba(59, 130, 246, 0.12);
}

/* Header rhythm — oversized, tightly tracked */
.cx-article-view .article-view-inner { max-width: 740px; }
.cx-article-view .article-view-title {
    font-size: 3.15rem;
    letter-spacing: -0.035em;
    line-height: 1.07;
}
.cx-article-view .article-view-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.64);
    line-height: 1.55;
}

/* Section headings — clean, large, soft gradient, no hairline */
.article-view-body.cx-article h2 {
    font-size: 2.05rem;
    letter-spacing: -0.028em;
    border-bottom: none;
    padding-bottom: 0;
    margin: 2.7em 0 0.7em;
    background: linear-gradient(180deg, #ffffff 32%, rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Centered keynote pull-quote — sized to stay on one line */
.article-view-body.cx-article blockquote {
    border: none;
    background: none;
    border-radius: 0;
    text-align: center;
    font-style: normal;
    font-family: var(--news-font-display);
    font-size: 2.1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fff;
    max-width: none;
    margin: 2.6em auto;
    padding: 0;
    white-space: nowrap;
}
.article-view-body.cx-article blockquote strong {
    background: var(--cx-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Inline links carry the brand accent */
.article-view-body.cx-article a:not(.cx-cta-btn) {
    text-decoration-color: var(--cx-line);
}
.article-view-body.cx-article a:not(.cx-cta-btn):hover {
    color: #fff;
    text-decoration-color: var(--cx-cyan);
}

/* Apple-style highlight line (replaces the old stat boxes) */
.article-view-body.cx-article .cx-lede {
    font-family: var(--news-font-display);
    font-size: 1.62rem;
    line-height: 1.4;
    letter-spacing: -0.02em;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    max-width: 620px;
    margin: 2.2em auto 2.4em;
}

/* Technical specifications — clean, software-style two-column table
   Inspired by Apple's "Tech Specs" pages on apple.com. Scoped to this
   article via .cx-article, so the look never leaks into other posts. */
.article-view-body.cx-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0 2.6em;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.article-view-body.cx-article thead { display: none; }
.article-view-body.cx-article th,
.article-view-body.cx-article td {
    text-align: left;
    padding: 18px 0;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    text-transform: none;
    letter-spacing: normal;
}
.article-view-body.cx-article tr:last-child td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.article-view-body.cx-article td:first-child {
    width: 32%;
    color: #fff;
    font-family: var(--news-font-display);
    font-weight: 600;
    font-size: 0.92rem;
    padding-right: 24px;
    letter-spacing: -0.005em;
}
.article-view-body.cx-article td:first-child strong { font-weight: 600; }
.article-view-body.cx-article td:nth-child(2) {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.55;
}
@media (max-width: 640px) {
    .article-view-body.cx-article table { display: block; }
    .article-view-body.cx-article tbody,
    .article-view-body.cx-article tr { display: block; width: 100%; }
    .article-view-body.cx-article td {
        display: block;
        padding: 6px 0;
        border-bottom: none;
    }
    .article-view-body.cx-article td:first-child {
        width: auto;
        padding-top: 16px;
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.55);
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }
    .article-view-body.cx-article td:nth-child(2) {
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}

/* Compoxer Connect rig (reuses .plugin-rig / .plugin-core / .pc-*
   styles in styles.css). The rig is wider than the article column,
   so we break it out of the 740px content width and recentre. */
.article-view-body.cx-article .cx-plugin {
    margin: 2.8em auto 2.2em;
    width: min(96vw, 1040px);
    margin-left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}
.article-view-body.cx-article .cx-plugin .plugin-rig {
    width: 100%;
    max-width: 980px;
}
@media (max-width: 720px) {
    .article-view-body.cx-article .cx-plugin {
        width: 100%;
        margin-left: 0;
        transform: none;
    }
}
/* Phones: mirror the home page's plugin treatment. The control core is
   confined to ~300px while the animated neural board breaks out to the
   screen edges, so the controls (incl. the Key toggle) never get cramped
   and the network reads at full width — exactly like .home-section--mac. */
@media (max-width: 480px) {
    .article-view-body.cx-article .cx-plugin {
        width: calc(100% + 36px);
        max-width: none;
        margin-left: -18px;
        margin-right: -18px;
        transform: none;
        overflow: hidden;
    }
    .article-view-body.cx-article .cx-plugin .plugin-visual,
    .article-view-body.cx-article .cx-plugin .plugin-rig {
        width: 100%;
        max-width: none;
    }
}

/* Apple-style download action (clean pill, no surrounding box) */
.article-view-body.cx-article .cx-actions {
    text-align: center;
    margin: 2.2em 0 0.6em;
}
.article-view-body.cx-article .cx-appstore {
    position: relative;
    display: inline-block;
    overflow: hidden;
    isolation: isolate;
    font-family: var(--news-font-body);
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #22d3ee 100%);
    background-size: 200% 100%;
    border-radius: 999px;
    padding: 14px 30px;
    box-shadow: 0 10px 34px rgba(59, 130, 246, 0.28);
    animation: cxBtnGlow 3.6s ease-in-out infinite, cxBtnHue 7s ease-in-out infinite;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
/* Elegant light sweep across the button */
.article-view-body.cx-article .cx-appstore::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-18deg);
    animation: cxBtnSheen 3.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
.article-view-body.cx-article .cx-appstore:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 16px 44px rgba(59, 130, 246, 0.42);
    color: #fff;
    text-decoration: none;
}
@keyframes cxBtnGlow {
    0%, 100% { box-shadow: 0 10px 34px rgba(59, 130, 246, 0.26); }
    50%      { box-shadow: 0 12px 42px rgba(34, 211, 238, 0.5); }
}
@keyframes cxBtnHue {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes cxBtnSheen {
    0%   { left: -60%; }
    55%  { left: 120%; }
    100% { left: 120%; }
}
@media (prefers-reduced-motion: reduce) {
    .article-view-body.cx-article .cx-appstore { animation: none; }
    .article-view-body.cx-article .cx-appstore::before { animation: none; display: none; }
}
.article-view-body.cx-article .cx-actions-alt {
    text-align: center;
    font-family: var(--news-font-body);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 1.2em;
}

/* ── Scroll reveal ─────────────────────────────────────── */
.cx-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.cx-reveal.cx-in {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .cx-reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Wide images (hero / screenshots inside the article) ── */
.article-view-body img.cx-img-wide {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 16px;
    margin: 2.2em auto;
    box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.55),
        0 8px 40px rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.07);
    opacity: 1;
    transition: opacity 0.4s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.article-view-body img.cx-img-wide[loading="lazy"] { opacity: 0; }
.article-view-body img.cx-img-wide.loaded,
.article-view-body img.cx-img-wide:not([loading="lazy"]) { opacity: 1; }
.article-view-body img.cx-img-wide:hover {
    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.6),
        0 10px 50px rgba(59, 130, 246, 0.16);
    transform: translateY(-2px);
}
.article-view-body figure.cx-figure { margin: 2.2em 0; }
.article-view-body figure.cx-figure img.cx-img-wide { margin: 0 auto 0.7em; }
.article-view-body figure.cx-figure figcaption {
    font-family: var(--news-font-body);
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.42);
    text-align: center;
    margin: 0;
}

/* ════════════════════════════════════════════════════════
   STAT STRIP  — [[CX:STATS]]
   ════════════════════════════════════════════════════════ */
.cx-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 2.6em 0;
}
.cx-stat {
    background: linear-gradient(165deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
    border: 1px solid var(--cx-border);
    border-radius: 16px;
    padding: 22px 14px 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.cx-stat::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: var(--cx-grad);
    opacity: 0.55;
}
.cx-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.cx-stat-value {
    font-family: var(--news-font-display);
    font-size: 1.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.08;
    letter-spacing: -0.02em;
    display: block;
    min-height: 1.08em;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.22);
}
.cx-stat-label {
    font-family: var(--news-font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 10px;
    display: block;
}
.cx-stat-sub {
    font-family: var(--news-font-body);
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.42);
    margin-top: 4px;
    display: block;
}

/* ════════════════════════════════════════════════════════
   WORKFLOW STEPS  — [[CX:STEPS]]
   ════════════════════════════════════════════════════════ */
.cx-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 2.6em 0;
    counter-reset: cx-step;
}
.cx-step {
    position: relative;
    background: var(--cx-surface);
    border: 1px solid var(--cx-border);
    border-radius: 16px;
    padding: 24px 20px 22px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), border-color 0.3s ease;
}
.cx-step:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.14); }
.cx-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--cx-tint-10);
    border: 1px solid var(--cx-line);
    color: #fff;
    font-family: var(--news-font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
}
.cx-step-title {
    font-family: var(--news-font-display);
    font-size: 1.08rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
}
.cx-step-body {
    font-family: var(--news-font-body);
    font-size: 0.86rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

/* ════════════════════════════════════════════════════════
   DAW COMPATIBILITY STRIP  — [[CX:DAWS]]
   ════════════════════════════════════════════════════════ */
.cx-daws {
    margin: 2.6em 0;
    padding: 26px 22px 24px;
    background:
        radial-gradient(80% 140% at 50% 0%, var(--cx-tint-6), transparent 72%),
        var(--cx-surface-2);
    border: 1px solid var(--cx-border);
    border-radius: 18px;
}
.cx-daws-eyebrow {
    font-family: var(--news-font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 4px;
}
.cx-daws-title {
    font-family: var(--news-font-display);
    font-size: 1.3rem;
    color: #fff;
    text-align: center;
    margin: 0 0 18px;
}
.cx-daws-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.cx-daw-chip {
    font-family: var(--news-font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--cx-border);
    border-radius: 999px;
    padding: 8px 16px;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.cx-daw-chip:hover {
    color: #fff;
    border-color: var(--cx-line);
    background: var(--cx-tint-10);
    transform: translateY(-1px);
}
.cx-daws-note {
    font-family: var(--news-font-body);
    font-size: 0.74rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin: 18px auto 0;
    max-width: 52ch;
}

/* ════════════════════════════════════════════════════════
   TECHNICAL SPEC SHEET  — [[CX:SPECS]]
   ════════════════════════════════════════════════════════ */
.cx-specs {
    margin: 2.6em 0;
    background: var(--cx-surface-2);
    border: 1px solid var(--cx-border);
    border-radius: 18px;
    overflow: hidden;
}
.cx-specs-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--cx-border);
}
.cx-specs-head h3,
.article-view-body .cx-specs-head h3 {
    font-family: var(--news-font-display);
    font-size: 1.4rem;
    color: #fff;
    margin: 0;
    border: none;
    padding: 0;
    letter-spacing: -0.01em;
}
.cx-specs-ver {
    font-family: var(--news-font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 5px 12px;
    white-space: nowrap;
}
.cx-spec-row {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 16px;
    padding: 14px 22px;
    border-top: 1px solid var(--cx-border-soft);
}
.cx-spec-row:first-of-type { border-top: none; }
.cx-spec-key {
    font-family: var(--news-font-body);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}
.cx-spec-val {
    font-family: var(--news-font-body);
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.92);
}
.cx-spec-val .cx-mono {
    font-family: var(--news-font-mono);
    font-size: 0.85rem;
    color: #fff;
}

/* ════════════════════════════════════════════════════════
   AVAILABILITY CTA  — [[CX:CTA]]
   ════════════════════════════════════════════════════════ */
.cx-cta {
    margin: 2.8em 0 1.4em;
    padding: 32px 28px;
    text-align: center;
    background:
        radial-gradient(90% 160% at 50% 0%, var(--cx-tint-18), transparent 70%),
        var(--cx-surface);
    border: 1px solid var(--cx-border);
    border-radius: 20px;
}
.cx-cta-title,
.article-view-body .cx-cta-title {
    font-family: var(--news-font-display);
    font-size: 1.6rem;
    color: #fff;
    margin: 0 0 8px;
    border: none;
    padding: 0;
}
.cx-cta-sub {
    font-family: var(--news-font-body);
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 auto 20px;
    max-width: 48ch;
}
.cx-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--news-font-body);
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: var(--cx-grad);
    border-radius: 999px;
    padding: 13px 26px;
    border-bottom: none !important;
    transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 34px rgba(59, 130, 246, 0.28);
}
.cx-cta-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(59, 130, 246, 0.38);
}
.cx-cta-alt {
    font-family: var(--news-font-body);
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 16px 0 0;
}
.cx-cta-alt a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--cx-line);
    text-underline-offset: 3px;
}
.cx-cta-alt a:hover { text-decoration-color: var(--cx-cyan); }
.cx-cta-fine {
    font-family: var(--news-font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.4);
    margin: 14px 0 0;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
    .cx-stats { grid-template-columns: repeat(2, 1fr); }
    .cx-steps { grid-template-columns: 1fr; }
    .cx-stat-value { font-size: 1.7rem; }
    .cx-spec-row { grid-template-columns: 1fr; gap: 4px; }

    /* Keynote layer — scale the drama down for small screens */
    .cx-article-view .article-view-title { font-size: 2.05rem; letter-spacing: -0.03em; }
    .cx-article-view .article-view-subtitle { font-size: 1.05rem; }
    .article-view-body.cx-article h2 { font-size: 1.55rem; }
    .article-view-body.cx-article blockquote { font-size: 1.4rem; max-width: none; }
    .article-view-body.cx-article .cx-lede { font-size: 1.25rem; }
    .cx-article-view .article-featured-image img { border-radius: 16px; }
}
