/* =================================================================
   LOVALTO DESIGN SYSTEM — shared stylesheet
   All rules scoped to body.lds — opt-in per page.
   Source of truth: /Lovalto Design System/README.md
   House deviations: hero H1s + .lovalto-section-headline stay in BBH;
                     no § glyph in eyebrows (see CLAUDE.md).
   ================================================================= */

/* --- Typography: hero H1s + .lovalto-section-headline stay BBH. Other display H2s JBM. -- */
body.lds .content-section h2:not(.lovalto-section-headline),
body.lds .cta-section h2:not(.lovalto-section-headline) {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: clamp(2rem, 1.5rem + 1.5vw, 3rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
@media (max-width: 768px) {
    body.lds .content-section h2:not(.lovalto-section-headline),
    body.lds .cta-section h2:not(.lovalto-section-headline),
    body.lds .lovalto-section-headline,
    body.lds .reasons-headline {
        font-size: 1.375rem !important;
        line-height: 1.25;
    }
}
/* Card / timeline / two-col H3s also JBM, smaller + bolder */
body.lds .capability-card h3,
body.lds .timeline-item h3,
body.lds .two-column-layout h3 {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* --- Kill the global oxblood gradient underline on section H2s --------- */
body.lds .content-section h2:not(.lovalto-section-headline),
body.lds .cta-section h2:not(.lovalto-section-headline) {
    padding-bottom: 0;
    margin-bottom: 1.5rem;
    display: block;
}
body.lds .content-section h2:not(.lovalto-section-headline)::after,
body.lds .cta-section h2:not(.lovalto-section-headline)::after {
    content: none;
}

/* --- Eyebrow: NN — LABEL with oxblood number + trailing hairline ------ */
body.lds .lds-eyebrow {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #000000;
    margin-bottom: 1.5rem;
}
body.lds .lds-eyebrow .sec-num,
body.lds .lds-card-eyebrow .sec-num {
    color: #980000;
    font-weight: 700;
}
body.lds .lds-eyebrow .sec-dash {
    color: #A1A1A1;
    margin: 0 0.25rem;
    font-weight: 300;
}
body.lds .capability-card:hover .lds-card-eyebrow .sec-num {
    color: #980000;
}
/* Content + CTA eyebrows read as tag strips: label left, 1px rule right */
body.lds .content-section .lds-eyebrow,
body.lds .cta-section .lds-eyebrow {
    display: flex;
    align-items: center;
    gap: 1rem;
}
body.lds .content-section .lds-eyebrow::after,
body.lds .cta-section .lds-eyebrow::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #000000;
}
/* Hero eyebrow stays inline + centered */
body.lds .hero-section .lds-eyebrow {
    display: inline-block;
    margin-bottom: 1.25rem;
}

/* --- Ledger: LDS-canonical numbered-row list pattern ------------------ */
body.lds .lds-ledger {
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
}
body.lds .lds-ledger-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #E5E5E5;
    align-items: baseline;
}
body.lds .lds-ledger-row:last-child {
    border-bottom: none;
}
body.lds .lds-ledger-num {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #980000;
}
body.lds .lds-ledger-body h3 {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #000000;
    border-bottom: none;
    padding-bottom: 0;
    margin: 0 0 0.75rem 0;
}
body.lds .lds-ledger-body .checkmark-list {
    margin: 0;
}
body.lds .lds-ledger-body .checkmark-list li {
    padding: 0.25rem 0 0.25rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 300;
    color: #5C5C5C;
    line-height: 1.55;
}
body.lds .lds-card-eyebrow {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5C5C5C;
    margin-bottom: 0.375rem;
}

/* --- Meta Bar: black strip directly under the hero -------------------- */
body.lds .lds-meta-bar {
    background: #000000;
    color: #FFFFFF;
    padding: 0.875rem 0;
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
}
body.lds .lds-meta-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #FFFFFF;
    text-align: center;
}
body.lds .lds-meta-bar .sep {
    color: #A1A1A1;
    font-weight: 300;
}
@media (max-width: 768px) {
    body.lds .lds-meta-bar {
        padding: 0.75rem 1rem;
    }
    body.lds .lds-meta-bar-inner {
        font-size: 0.6875rem;
        letter-spacing: 0.08em;
        gap: 0.25rem 0.5rem;
    }
}

/* --- Capability cards: square, left-aligned, hairline, no shadow ------ */
body.lds .capability-card {
    border: 1px solid #000000;
    border-radius: 0;
    box-shadow: none;
    padding: 1.5rem;
    text-align: left;
    align-items: flex-start;
    transition: background-color 180ms cubic-bezier(0.2, 0, 0, 1);
}
body.lds .capability-card:hover {
    border-color: #000000;
    background-color: #000000;
    color: #FFFFFF;
    transform: none;
}
body.lds .capability-card:hover h3,
body.lds .capability-card:hover p,
body.lds .capability-card:hover .lds-card-eyebrow {
    color: #FFFFFF;
}
body.lds .capability-card:hover .lds-card-eyebrow {
    color: #A1A1A1;
}
body.lds .capability-icon {
    margin-bottom: 1rem;
    justify-content: flex-start;
}
body.lds .capability-icon svg {
    color: #000000;
    transition: color 180ms cubic-bezier(0.2, 0, 0, 1);
}
body.lds .capability-card:hover .capability-icon svg {
    color: #FFFFFF;
}
body.lds .capability-card h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.5rem;
    color: #000000;
    transition: color 180ms cubic-bezier(0.2, 0, 0, 1);
}
body.lds .capability-card p {
    text-align: left;
    font-weight: 300;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #5C5C5C;
    transition: color 180ms cubic-bezier(0.2, 0, 0, 1);
}

/* --- Timeline: square numbered badges, left-aligned ------------------- */
body.lds .timeline-grid {
    gap: 0;
    border-top: 1px solid #000000;
}
body.lds .timeline-item {
    text-align: left;
    padding: 1.5rem;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
}
body.lds .timeline-item:last-child {
    border-right: 1px solid #000000;
}
body.lds .timeline-grid > .timeline-item:first-child {
    border-left: 1px solid #000000;
}
body.lds .timeline-number {
    width: auto;
    height: auto;
    border-radius: 0;
    background-color: transparent;
    color: #000000;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    margin: 0 0 0.75rem 0;
    display: block;
    text-align: left;
}
body.lds .timeline-item:hover .timeline-number {
    background-color: transparent;
    color: #000000;
    transform: none;
}
body.lds .timeline-item h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.5rem;
}
body.lds .timeline-item p {
    font-weight: 300;
    font-size: 0.875rem;
    color: #5C5C5C;
}

/* --- Checkmark list → em-dash markers (LDS iconography) --------------- */
body.lds .checkmark-list li {
    padding-left: 1.5rem;
}
body.lds .checkmark-list li::before {
    content: '—';
    color: #000000;
    font-weight: 500;
}
body.lds .two-column-layout h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #000000;
    margin-bottom: 1rem;
}

/* --- Buttons: uniform 16px across all LDS CTAs ------------------------ */
body.lds .btn-primary,
body.lds .btn-secondary,
body.lds .btn-secondary-light,
body.lds .btn-black,
body.lds .btn-large {
    font-size: 1rem;
}

/* --- CTA button: LDS canonical popout — oxblood face, black plate ----- */
body.lds .btn-primary-wrap {
    position: relative;
    display: inline-grid;
    grid-template-columns: max-content;
    isolation: isolate;
    vertical-align: top;
    line-height: 0;
    width: max-content;
    max-width: 100%;
}
/* Inside forms, pin the wrap to the start so the ::before plate doesn't
   span the full form width on hover. */
body.lds form .btn-primary-wrap,
body.lds .contact-form .btn-primary-wrap {
    align-self: flex-start;
    justify-self: flex-start;
}
body.lds .btn-primary-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #000000;
    z-index: 0;
    opacity: 0;
    transition: transform 180ms cubic-bezier(0.2, 0, 0, 1),
                opacity 120ms cubic-bezier(0.2, 0, 0, 1);
}
body.lds .btn-primary-wrap:hover::before {
    opacity: 1;
}
body.lds .btn-primary-wrap .btn-primary {
    position: relative;
    z-index: 2;
    background-color: #980000 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 0;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: 0.06em;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.2;
    padding: 0.875rem 1.5rem;
    margin: 0;
    box-shadow: none;
    transform: none;
    transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
    will-change: transform;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
body.lds .btn-primary-wrap button.btn-primary {
    font: inherit;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 1rem;
    font-weight: 500;
}
body.lds .btn-primary-wrap:hover .btn-primary {
    background-color: #980000 !important;
    color: #FFFFFF !important;
    transform: translate(-4px, -4px);
    box-shadow: none;
}
body.lds .btn-primary-wrap:hover::before {
    transform: translate(4px, 4px);
}
body.lds .btn-primary-wrap:active .btn-primary {
    transform: translate(-2px, -2px);
}
body.lds .btn-primary-wrap:active::before {
    transform: translate(2px, 2px);
}

/* Nav variant: white plate instead of black (black navbar needs light reveal) */
body.lds .nav-menu .btn-primary-wrap::before {
    background: #FFFFFF;
}

/* --- Secondary CTA: black face, oxblood plate popout ---------------- */
body.lds .btn-black-wrap {
    position: relative;
    display: inline-grid;
    grid-template-columns: max-content;
    isolation: isolate;
    vertical-align: top;
    line-height: 0;
    width: max-content;
    max-width: 100%;
}
body.lds form .btn-black-wrap,
body.lds .contact-form .btn-black-wrap {
    align-self: flex-start;
    justify-self: flex-start;
}
body.lds .btn-black-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #980000;
    z-index: 0;
    opacity: 0;
    transition: transform 180ms cubic-bezier(0.2, 0, 0, 1),
                opacity 120ms cubic-bezier(0.2, 0, 0, 1);
}
body.lds .btn-black-wrap:hover::before {
    opacity: 1;
}
body.lds .btn-black-wrap .btn-black {
    position: relative;
    z-index: 2;
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 0;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: 0.06em;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    box-shadow: none;
    transform: none;
    transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
    will-change: transform;
}
body.lds .btn-black-wrap:hover .btn-black {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    transform: translate(-4px, -4px);
    box-shadow: none;
}
body.lds .btn-black-wrap:hover::before {
    transform: translate(4px, 4px);
}
body.lds .btn-black-wrap:active .btn-black {
    transform: translate(-2px, -2px);
}
body.lds .btn-black-wrap:active::before {
    transform: translate(2px, 2px);
}

/* --- Mobile adjustments --------------------------------------------- */
@media (max-width: 768px) {
    body.lds .timeline-item:not(:last-child)::after {
        content: none;
    }
    body.lds .timeline-grid {
        border-top: 1px solid #000000;
    }
    body.lds .timeline-item {
        border-right: 1px solid #000000;
        border-left: 1px solid #000000;
        border-bottom: 1px solid #000000;
    }
}
@media (max-width: 1024px) {
    body.lds .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    body.lds .capabilities-grid {
        grid-template-columns: 1fr;
    }
}

/* 2-column variant — responsive: 2 cols desktop/tablet, 1 col mobile. */
body.lds .capabilities-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) {
    body.lds .capabilities-grid.grid-2 { grid-template-columns: 1fr; }
}

/* --- 4-up variant for the services landing grid --------------------- */
body.lds .capabilities-grid.services-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}
@media (max-width: 1024px) {
    body.lds .capabilities-grid.services-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    body.lds .capabilities-grid.services-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* --- Card variant: link-card with a visible CTA at the bottom ------- */
body.lds .capability-card-cta {
    justify-content: flex-start;
}
/* Stay static on hover — the CTA button carries the affordance */
body.lds .capability-card-cta:hover {
    border-color: #000000;
    background-color: #FFFFFF;
    color: inherit;
}
body.lds .capability-card-cta:hover h3,
body.lds .capability-card-cta:hover .lds-card-eyebrow {
    color: #000000;
}
body.lds .capability-card-cta:hover p {
    color: #5C5C5C;
}
body.lds .capability-card-cta:hover .capability-icon svg {
    color: #000000;
}
/* Push the CTA to the bottom of the card without inflating the wrap's
   bounding box (padding here would let the ::before plate show above the
   button as a black bar). */
body.lds .capability-card-cta .card-cta {
    margin-top: auto;
}
body.lds .capability-card-cta p {
    margin-bottom: var(--spacing-sm);
}

/* =================================================================
   LDS GRAPHIC PRIMITIVES — terminal-styled section visuals
   Reusable components: panel, funnel, stream, stages, records.
   Palette-strict. No gradients. No shadows. JBM only.
   ================================================================= */

/* --- Split layout: graphic left / content right (or vice versa) ------- */
body.lds .lds-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}
@media (max-width: 768px) {
    body.lds .lds-split {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* --- Panel: terminal-style container ---------------------------------- */
body.lds .lds-panel {
    background: #FFFFFF;
    border: 1px solid #000000;
    overflow: hidden;
}
body.lds .lds-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #000000;
    color: #FFFFFF;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
body.lds .lds-panel-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #FFFFFF;
    animation: ldsPulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes ldsPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.3); }
}
body.lds .lds-panel-title { flex: 1; font-weight: 700; }
body.lds .lds-panel-meta  { font-weight: 700; color: #A1A1A1; }
body.lds .lds-panel-body  { padding: 1.25rem; }

/* --- Funnel: horizontal bar chart ------------------------------------- */
body.lds .lds-funnel {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
body.lds .lds-funnel-row {
    display: grid;
    grid-template-columns: 100px 1fr 44px;
    align-items: center;
    gap: 0.75rem;
}
body.lds .lds-funnel-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    color: #5C5C5C;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
body.lds .lds-funnel-track {
    height: 22px;
    background: #F5F5F5;
    position: relative;
    overflow: hidden;
}
body.lds .lds-funnel-bar {
    position: absolute; inset: 0 auto 0 0;
    width: var(--w, 100%);
    background: #980000;
    transform-origin: left;
    transform: scaleX(0);
    animation: ldsBarGrow 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
body.lds .lds-funnel-row:nth-child(1) .lds-funnel-bar { animation-delay: 0.05s; }
body.lds .lds-funnel-row:nth-child(2) .lds-funnel-bar { animation-delay: 0.15s; }
body.lds .lds-funnel-row:nth-child(3) .lds-funnel-bar { animation-delay: 0.25s; }
body.lds .lds-funnel-row:nth-child(4) .lds-funnel-bar { animation-delay: 0.35s; }
body.lds .lds-funnel-row:nth-child(5) .lds-funnel-bar { animation-delay: 0.45s; }
body.lds .lds-funnel-row:nth-child(6) .lds-funnel-bar { animation-delay: 0.55s; }
@keyframes ldsBarGrow { to { transform: scaleX(1); } }
body.lds .lds-funnel-count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: right;
    color: #000000;
}

/* --- Stream: animated data packets between monospace nodes ------------ */
body.lds .lds-stream {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
body.lds .lds-stream-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
body.lds .lds-stream-node {
    padding: 0.35rem 0.65rem;
    border: 1px solid #000000;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
    background: #FFFFFF;
    white-space: nowrap;
    letter-spacing: 0.04em;
    color: #000000;
}
body.lds .lds-stream-flow {
    flex: 1;
    height: 1px;
    background: #000000;
    position: relative;
    overflow: hidden;
}
body.lds .lds-stream-packet {
    position: absolute;
    top: -2px; left: 0;
    width: 14px; height: 5px;
    background: #980000;
    animation: ldsStreamMove 2.2s linear infinite;
}
@keyframes ldsStreamMove {
    0%   { left: -14px; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { left: calc(100% + 14px); opacity: 0; }
}

/* --- Stages: numbered progress bars with mono labels ------------------ */
body.lds .lds-stages {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
body.lds .lds-stage {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 0.75rem;
    align-items: center;
}
body.lds .lds-stage-num {
    width: 34px; height: 34px;
    border: 1px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 700;
    font-size: 0.8rem;
    background: #FFFFFF;
    color: #000000;
}
body.lds .lds-stage-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
body.lds .lds-stage-name {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5C5C5C;
}
body.lds .lds-stage-bar {
    height: 6px;
    background: #F5F5F5;
    position: relative;
    overflow: hidden;
}
body.lds .lds-stage-fill {
    position: absolute; inset: 0 auto 0 0;
    width: var(--fill, 80%);
    background: #980000;
    transform-origin: left;
    transform: scaleX(0);
    animation: ldsBarGrow 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
body.lds .lds-stage:nth-child(1) .lds-stage-fill { animation-delay: 0.10s; }
body.lds .lds-stage:nth-child(2) .lds-stage-fill { animation-delay: 0.25s; }
body.lds .lds-stage:nth-child(3) .lds-stage-fill { animation-delay: 0.40s; }
body.lds .lds-stage:nth-child(4) .lds-stage-fill { animation-delay: 0.55s; }
body.lds .lds-stage:nth-child(5) .lds-stage-fill { animation-delay: 0.70s; }
body.lds .lds-stage:nth-child(6) .lds-stage-fill { animation-delay: 0.85s; }

/* --- Records: CODE/NAME list with staggered fade-in ------------------- */
body.lds .lds-records {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
body.lds .lds-record {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border: 1px solid #000000;
    background: #FFFFFF;
    animation: ldsRecordIn 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    opacity: 0;
    transform: translateY(4px);
}
body.lds .lds-record:nth-child(1) { animation-delay: 0.08s; }
body.lds .lds-record:nth-child(2) { animation-delay: 0.16s; }
body.lds .lds-record:nth-child(3) { animation-delay: 0.24s; }
body.lds .lds-record:nth-child(4) { animation-delay: 0.32s; }
body.lds .lds-record:nth-child(5) { animation-delay: 0.40s; }
body.lds .lds-record:nth-child(6) { animation-delay: 0.48s; }
@keyframes ldsRecordIn {
    to { opacity: 1; transform: translateY(0); }
}
body.lds .lds-record-code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #980000;
    text-align: center;
}
body.lds .lds-record-name {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: #000000;
}

/* --- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    body.lds .lds-panel-dot,
    body.lds .lds-funnel-bar,
    body.lds .lds-stream-packet,
    body.lds .lds-stage-fill,
    body.lds .lds-record {
        animation: none !important;
    }
    body.lds .lds-funnel-bar,
    body.lds .lds-stage-fill {
        transform: scaleX(1) !important;
    }
    body.lds .lds-record {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* --- Mobile ----------------------------------------------------------- */
@media (max-width: 768px) {
    body.lds .lds-funnel-row { grid-template-columns: 80px 1fr 36px; }
    body.lds .lds-stream-node { font-size: 0.6rem; padding: 0.3rem 0.5rem; }
}

/* ================================================================
   UI optimization pass
   ================================================================ */

/* Stat-strip captions: bump legibility (was too light/small) */
body.lds .stat-item .stat-label {
    font-size: 0.8125rem;
    color: #5C5C5C;
    letter-spacing: 0.04em;
}

/* Content section H3: smooth the jump from big H2 to tiny H3 body */
body.lds .content-section h3 {
    font-size: 1.125rem;
}
body.lds .two-column-layout h3 {
    font-size: 1rem;
}

/* Hero scroll cue — sits in flow under the CTA buttons */
.hero-scroll-cue {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    text-decoration: none;
    opacity: 0;
    animation: heroCueFade 1.2s ease-out 2.8s forwards,
               heroCueBob 2.4s ease-in-out 4s infinite;
}
.hero-scroll-cue-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #000000;
}
.hero-scroll-cue-chevron {
    width: 16px;
    height: 16px;
    border-right: 1.5px solid #000000;
    border-bottom: 1.5px solid #000000;
    transform: rotate(45deg);
    margin-top: -4px;
}
@keyframes heroCueFade {
    to { opacity: 0.8; }
}
@keyframes heroCueBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}
@media (max-width: 768px) {
    .hero-scroll-cue { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-scroll-cue {
        opacity: 0.7;
        animation: none;
    }
}

/* Blog hero: compact — don't eat the whole viewport */
body.lds .blog-hero-compact {
    min-height: 0 !important;
    padding: 3rem 0 2rem !important;
}
@media (max-width: 768px) {
    body.lds .blog-hero-compact {
        padding: 2rem 0 1.5rem !important;
    }
}

/* ================================================================
   Mobile density pass — tighten everything that's too airy on phones.
   No content removed; just tighter padding, line-height, and grid.
   ================================================================ */
@media (max-width: 768px) {
    /* Section padding: roomy desktop spacing → utility mobile spacing */
    body.lds .content-section,
    body.lds .cta-section {
        padding: 2.25rem 0;
    }

    /* Body line-height — 1.7 globally is too airy on a phone */
    body.lds {
        line-height: 1.55;
    }
    body.lds p {
        margin-bottom: 0.75rem;
    }
    body.lds .intro-text {
        font-size: 1rem;
        line-height: 1.55;
        margin-bottom: 1rem;
    }

    /* Headings — tighter top/bottom margin around section H2/H3 */
    body.lds h2 {
        margin-bottom: 1rem !important;
    }
    body.lds h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        margin-top: 1.25rem;
    }
    body.lds .two-column-layout > div + div h3 {
        margin-top: 1.5rem;
    }

    /* Stat strip — 2x2 grid on phones (not auto-fit which can produce 1xN) */
    body.lds .stat-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.25rem 0;
        margin: 1.25rem 0;
    }
    body.lds .stat-number { font-size: 1.625rem; }
    body.lds .stat-label  { font-size: 0.75rem; }

    /* Capability/feature cards — tighter padding */
    body.lds .capability-card {
        padding: 1rem;
    }

    /* Checkmark / checklist lists — tighter rhythm */
    body.lds .checkmark-list li {
        margin-bottom: 0.5rem;
        line-height: 1.5;
    }

    /* Two-column layout reduces gap when stacked */
    body.lds .two-column-layout {
        gap: 1.25rem;
    }

    /* Highlight-box / cta-box callouts trimmed */
    body.lds .highlight-box,
    body.lds .cta-box {
        padding: 1.25rem;
        margin-top: 1.25rem;
    }

    /* Timeline grid — compact rows on mobile */
    body.lds .timeline-item {
        padding: 1rem;
    }
    body.lds .timeline-number {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }

    /* Hero subtitle — compress to one line where possible */
    body.lds .hero-section .hero-subtitle {
        font-size: 0.9375rem;
        line-height: 1.5;
        max-width: 100%;
    }

    /* Footer — denser on mobile */
    body.lds .footer-content {
        gap: 1.5rem;
    }
    body.lds .footer-column ul { gap: 0; }
    body.lds .footer-column a { padding: 0.6rem 0; }
}

/* ================================================================
   Mobile audit polish — site-wide
   ================================================================ */

/* 1. Minimum legible text: bump sub-12px labels to 12px on mobile. */
@media (max-width: 768px) {
    body.lds .sep,
    body.lds .sec-num,
    body.lds .sec-dash,
    body.lds .stat-label,
    body.lds .cta-team-title,
    body.lds .lds-stage-name,
    body.lds .lds-panel-title,
    body.lds .lds-panel-meta,
    body.lds .stage-label,
    body.lds .stage-time,
    body.lds .rs-catalog-label,
    body.lds .rs-catalog-rate,
    body.lds .pm-col-label,
    body.lds .pm-overlap-tag,
    body.lds .pm-footer-label,
    body.lds .lds-record-code,
    body.lds .lds-stream-node,
    body.lds .record-code,
    body.lds .ss-tag,
    body.lds .ac-bubble-label,
    body.lds .ac-action,
    body.lds .me-card-badge,
    body.lds .rt-label {
        font-size: 0.75rem !important;
    }
    body.lds .lds-meta-bar-inner { font-size: 0.8125rem !important; }
}

/* 2. CTA buttons: ensure a 44px touch target minimum, and allow long CTA
   text to wrap on narrow screens instead of overflowing. */
body.lds .btn-primary,
body.lds .btn-black,
body.lds .btn-secondary,
body.lds .btn-secondary-light {
    min-height: 44px;
}

/* Match the secondary-light (ghost) metrics exactly to the wrapped primary
   so that side-by-side hero CTAs render at identical pixel sizes. */
body.lds .btn-secondary-light {
    padding: 0.875rem 1.5rem !important;
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.06em !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
    border: 1px solid #000000 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
}
body.lds .btn-secondary-light:hover {
    border-color: var(--accent-red) !important;
    color: var(--accent-red) !important;
    background: transparent !important;
}
/* Primary-wrap also gets a 1px transparent border so total box height
   matches the secondary's 1px-border box exactly. */
body.lds .btn-primary-wrap .btn-primary {
    border: 1px solid transparent !important;
    box-sizing: border-box;
}
@media (max-width: 480px) {
    body.lds .btn-primary-wrap,
    body.lds .btn-black-wrap {
        max-width: 100%;
    }
    body.lds .btn-primary-wrap .btn-primary,
    body.lds .btn-black-wrap .btn-black {
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
}

/* 3. Industries / Technology tabs: horizontal scroll with a visible fade
   hint so users know more tabs exist off-screen. */
@media (max-width: 1024px) {
    body.lds .ind-tabs {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        position: relative;
        flex-wrap: nowrap;
    }
    body.lds .ind-tabs::-webkit-scrollbar { display: none; }
    body.lds .ind-tabs > * {
        scroll-snap-align: start;
        flex: 0 0 auto;
    }
}

/* 4. Nav menu links: restore 44px touch targets when the mobile menu opens. */
@media (max-width: 1024px) {
    .nav-menu.active a,
    .nav-menu.active .dropdown a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}
