/*
 * Glitch for After Effects: promo blocks and the NEW badge in the menu.
 * Loaded site-wide; uses the terminal theme tokens from matrix.css.
 * Blocks use divs/spans and a few !important rules so article typography
 * (blog, pillar guides) cannot restyle them.
 */

.glp,
.glp * {
    box-sizing: border-box;
}

.glp {
    --glp-green: var(--om-green, #5dff82);
    --glp-bright: var(--om-green-bright, #b1ffc1);
    --glp-line: var(--om-line, rgba(93, 255, 130, 0.22));
    --glp-mono: var(--om-mono, "IBM Plex Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace);
    --glp-sans: var(--om-sans, Inter, Arial, sans-serif);
    --glp-c: #5dff82;
    position: relative;
    color: #ecfff0;
    font-family: var(--glp-sans);
    text-align: left;
}

/* ---------- Band: video + copy ---------- */

.glp-band {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    width: min(100% - 40px, 1220px);
    margin: 40px auto;
    border: 1px solid var(--glp-line);
    background:
        radial-gradient(circle at 100% 0, rgba(93, 255, 130, 0.08), transparent 55%),
        rgba(7, 14, 9, 0.92);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.glp-band.glp-fluid {
    width: 100%;
    margin: 48px 0;
}

.glp-media {
    position: relative;
    display: block;
    min-height: 240px;
    overflow: hidden;
    background: #0a1015;
    border-right: 1px solid var(--glp-line);
    text-decoration: none !important;
}

.glp .glp-video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    object-fit: cover;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.glp-tag {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 6px 9px;
    border: 1px solid var(--glp-line);
    background: rgba(2, 5, 3, 0.78);
    color: var(--glp-c);
    font: 700 9px/1 var(--glp-mono);
    letter-spacing: 0.12em;
}

.glp-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: clamp(22px, 3.5vw, 42px);
}

.glp .glp-eyebrow {
    display: block;
    color: var(--glp-green) !important;
    font: 700 10px/1.4 var(--glp-mono) !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.glp .glp-title {
    display: block;
    color: #ecfff0 !important;
    font-family: var(--glp-sans) !important;
    font-size: clamp(26px, 3vw, 40px) !important;
    font-weight: 850 !important;
    line-height: 1.02 !important;
    letter-spacing: -0.05em;
}

.glp .glp-text {
    display: block;
    max-width: 34em;
    color: #b7c8bb !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
}

.glp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.glp a.glp-btn,
.glp a.glp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 50px;
    padding: 0 20px;
    font: 800 11px/1 var(--glp-mono) !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}

.glp a.glp-btn {
    color: #021507 !important;
    background: var(--glp-green) !important;
    border: 1px solid var(--glp-green);
    clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
}

.glp a.glp-btn:hover {
    color: #000 !important;
    background: var(--glp-bright) !important;
    box-shadow: 0 0 34px rgba(93, 255, 130, 0.18);
}

.glp a.glp-link {
    color: var(--glp-green) !important;
    background: transparent !important;
    border: 1px solid var(--glp-green);
}

.glp a.glp-link:hover {
    background: rgba(93, 255, 130, 0.08) !important;
}

.glp-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 6px;
}

.glp-proof span {
    color: #829488;
    font: 600 10px/1.6 var(--glp-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.glp-proof span::before {
    content: "// ";
    color: rgba(93, 255, 130, 0.45);
}

/* ---------- Inline: compact card inside articles ---------- */

.glp-inline {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
    padding: 14px 18px 14px 14px;
    border: 1px solid var(--glp-line);
    border-left: 3px solid var(--glp-green);
    background: rgba(7, 14, 9, 0.92);
}

.glp-inline .glp-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--glp-line);
}

.glp-inline .glp-body {
    padding: 0;
    gap: 5px;
}

.glp-inline .glp-title {
    font-size: 19px !important;
    line-height: 1.2 !important;
    letter-spacing: -0.03em;
}

.glp-inline .glp-text {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
}

.glp-inline a.glp-btn {
    min-height: 44px;
}

/* ---------- Downgrader: offer shown after a successful conversion ---------- */

.downgrade-result-offer.downgrade-result-glitch {
    border-color: rgba(93, 255, 130, 0.42);
    border-left: 3px solid var(--om-green, #5dff82);
    background: radial-gradient(circle at 100% 0, rgba(93, 255, 130, 0.09), transparent 60%);
}

.downgrade-result-glitch .pillar-eyebrow {
    margin: 0 0 8px;
}

.downgrade-result-glitch p:not(.pillar-eyebrow) {
    color: #b7c8bb;
    font-size: 14px;
    line-height: 1.7;
}

.downgrade-result-glitch a:first-of-type {
    padding: 12px 16px;
    color: #021507 !important;
    background: var(--om-green, #5dff82);
    font: 800 11px/1 var(--om-mono, monospace);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

/* ---------- Header: "Glitch plugin" button next to Sign in / Dashboard ---------- */
/* The button itself is .btn.btn-primary, styled by matrix.css like Dashboard. */

.header-actions .header-glitch-btn {
    gap: 8px;
    white-space: nowrap;
}

.header-glitch-new {
    display: inline-block;
    padding: 3px 5px 2px;
    background: #021507;
    color: var(--om-green, #5dff82) !important;
    font: 800 8px/1 var(--om-mono, monospace);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Narrow desktops: the menu has no room for a second button. Glitch stays in
   the Presets dropdown, and in the mobile menu on phones. */
@media (max-width: 1180px) {
    .header-actions .header-glitch-btn {
        display: none !important;
    }
}

.mobile-nav a.mobile-nav-glitch {
    color: var(--om-green, #5dff82) !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .glp-band {
        grid-template-columns: 1fr;
    }
    .glp-band .glp-media {
        aspect-ratio: 16 / 9;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--glp-line);
    }
}

@media (max-width: 640px) {
    .glp-band {
        width: min(100% - 32px, 1220px);
    }
    .glp-band.glp-fluid {
        width: 100%;
    }
    .glp-inline {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    .glp a.glp-btn,
    .glp a.glp-link {
        width: 100%;
    }
}
