/* =====================================================================
   mobile.css — phone density layer  (phones ONLY; desktop is untouched)
   ---------------------------------------------------------------------
   Loaded after style.css. Everything visual lives inside max-width media
   queries, so >= 992px renders exactly as before.

   Goal: compact. The phone landing page was 16,091px tall at 390px
   (~19 screens) because every card grid collapsed to one column, sections
   kept 64px paddings, buttons were sized for a desktop hero, and the
   featured-research PDF was an <iframe> — which iOS Safari cannot scroll
   (it shows page 1 and stops).

   Rules of the layer:
     * two- and three-up grids instead of one card per row
     * small buttons, tight line-heights, small type
     * no decorative empty space: halved section rhythm, small gaps
     * jump-to-section menu stays available on phones
   ===================================================================== */

/* Desktop/tablet: the tap-through PDF card is phone-only. */
.research-mobile-cta {
    display: none;
}

@media (max-width: 767.98px) {
    /* ---------- vertical rhythm ---------- */
    :root {
        --section-padding: 1.6rem;
    }

    .container {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
        max-width: none;
    }

    .row {
        --bs-gutter-x: 0.55rem;
        --bs-gutter-y: 0.55rem;
    }

    .section-header {
        max-width: none;
        margin-bottom: 1.05rem;
    }

    .section-label {
        font-size: 0.54rem;
        padding: 0.2rem 0.55rem;
        margin-bottom: 0.4rem;
        letter-spacing: 0.09em;
    }

    /* Headlines: keep them from eating a full line on a narrow screen. */
    .section-title {
        font-size: 1.14rem;
        line-height: 1.18;
        margin-bottom: 0.4rem;
    }

    .section-title br {
        display: none;
    }

    .section-subtitle {
        font-size: 0.82rem;
        line-height: 1.42;
    }

    /* ---------- generic buttons: small, no giant tap slabs ---------- */
    .btn {
        font-size: 0.76rem;
        padding: 0.3rem 0.6rem;
        border-radius: 8px;
    }

    .btn-sm {
        font-size: 0.7rem;
        padding: 0.22rem 0.5rem;
    }

    /* ---------- hero ---------- */
    .hero-section {
        padding: 0.9rem 0 1.1rem;
    }

    .hero-corporate {
        gap: 0.8rem;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.02;
    }

    .hero-badge {
        font-size: 0.54rem;
        padding: 0.18rem 0.5rem;
        margin-bottom: 0.4rem;
    }

    .hero-subtitle {
        font-size: 0.82rem;
        line-height: 1.38;
        margin-bottom: 0.6rem;
    }

    /* four stats on one row — they are short numbers */
    .hero-stats-row {
        gap: 0.3rem;
        padding: 0.45rem 0;
        margin: 0.5rem 0;
    }

    .hero-stat-compact {
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
    }

    .hero-stat-compact .value {
        font-size: 1.05rem;
    }

    .hero-stat-compact .label {
        font-size: 0.5rem;
        letter-spacing: 0.03em;
    }

    .hero-cta {
        gap: 0.35rem;
        margin-bottom: 0.4rem;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        max-width: none;
        width: auto;
        padding: 0.45rem 0.75rem;
        font-size: 0.78rem;
        border-radius: 9px;
    }

    .czech-note {
        font-size: 0.68rem;
        line-height: 1.35;
        padding: 0.35rem 0.5rem;
    }

    /* ---------- live performance panel ---------- */
    .performance-dashboard {
        padding: 0.7rem;
        border-radius: 12px;
    }

    .performance-header {
        padding: 0 0 0.5rem;
    }

    .performance-main {
        padding: 0.5rem 0.1rem 0.6rem;
    }

    .performance-main .return-value {
        font-size: 1.8rem;
    }

    .performance-main .return-label {
        font-size: 0.68rem;
    }

    .performance-main .return-meta {
        font-size: 0.62rem;
    }

    /* six risk tiles: 3 across, 2 rows. The panel is a hairline grid (1px gaps on
       a grey background) — adding tile gaps/radii here is what made the tiles look
       like mismatched rounded rectangles, so keep the seams and drop the radius. */
    .risk-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1px;
    }

    .risk-metric {
        padding: 0.45rem 0.3rem;
        border-radius: 0;
    }

    .risk-metric .metric-label {
        font-size: 0.5rem;
        letter-spacing: 0.02em;
        margin-bottom: 0.15rem;
        line-height: 1.15;
    }

    .risk-metric .metric-value {
        font-size: 0.9rem;
    }

    .risk-metric .metric-subtext {
        display: none;
    }

    .benchmark-comparison {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1px;
    }

    .benchmark-item {
        padding: 0.45rem 0.25rem;
        border-radius: 0;
    }

    .benchmark-item .benchmark-name {
        font-size: 0.5rem;
        line-height: 1.15;
        margin-bottom: 0.15rem;
    }

    .benchmark-item .benchmark-value {
        font-size: 0.78rem;
    }

    /* ---------- card grids: two per row, small cards ---------- */
    .feature-grid,
    .strategy-grid,
    .risk-grid,
    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .feature-card,
    .strategy-card,
    .risk-card {
        padding: 0.6rem 0.55rem;
        border-radius: 10px;
    }

    .feature-icon {
        width: 26px;
        height: 26px;
        font-size: 0.78rem;
        margin-bottom: 0.35rem;
        border-radius: 7px;
    }

    .feature-title {
        font-size: 0.76rem;
        margin-bottom: 0.2rem;
    }

    .feature-text {
        font-size: 0.69rem;
        line-height: 1.38;
    }

    .strategy-card h4 {
        font-size: 0.72rem;
        gap: 0.28rem;
        margin-bottom: 0.2rem;
    }

    .strategy-card h4 i {
        font-size: 0.8rem;
    }

    .strategy-card p {
        font-size: 0.68rem;
        line-height: 1.38;
    }

    .risk-card .risk-header {
        gap: 0.3rem;
        margin-bottom: 0.3rem;
    }

    .risk-card .risk-icon {
        width: 22px;
        height: 22px;
        font-size: 0.66rem;
    }

    .risk-card .risk-title {
        font-size: 0.72rem;
    }

    .risk-card .risk-desc {
        font-size: 0.68rem;
        line-height: 1.38;
    }

    /* ---------- bootstrap scaffolding: two-up instead of one-per-row ---------- */
    /* Bootstrap collapses .col-md-4 / .col-lg-6 to 100% below 768px, which turned
       every three-card row into three full-width cards. Only the two card rows
       that carry an explicit hook are touched: a blanket `[class*=col-]` rule
       also matched the nested rows inside cards (it squeezed the Exclusion
       Criteria column to 35px) and the strategy section's 7/5 chart pair. */
    .universe-cards > [class*="col-"],
    .perks-cards > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .perk-card {
        padding: 0.6rem 0.5rem;
        border-radius: 10px;
    }

    .perk-icon {
        width: 26px;
        height: 26px;
        font-size: 0.78rem;
        margin-bottom: 0.35rem;
        border-radius: 7px;
    }

    .perk-card h4 {
        font-size: 0.74rem;
        margin-bottom: 0.18rem;
    }

    .perk-card p {
        font-size: 0.67rem;
        line-height: 1.36;
        margin: 0;
    }

    /* ---------- investment process: 4 across in one row ---------- */
    .process-flow {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        max-width: none;
    }

    .process-step {
        flex: none;
        text-align: left;
    }

    .process-step .step-number {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.68rem;
        margin: 0 0 0.25rem;
        border-width: 1px;
    }

    .process-step .step-title {
        font-size: 0.72rem;
        margin-bottom: 0.15rem;
    }

    .process-step .step-desc {
        font-size: 0.67rem;
        line-height: 1.36;
    }

    /* ---------- stats: one dense strip ---------- */
    .stats-section {
        padding: 0.9rem 0;
    }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.3rem;
    }

    .stat-item {
        padding: 0.15rem;
    }

    .stat-number {
        font-size: 1.25rem;
        margin-bottom: 0.05rem;
    }

    .stat-label {
        font-size: 0.5rem;
        letter-spacing: 0.04em;
    }

    /* ---------- team ---------- */
    .team-grid {
        max-width: none;
    }

    .team-image-wrapper {
        height: 72px;
    }

    .team-content {
        padding: 0.5rem 0.55rem;
    }

    .team-name {
        font-size: 0.8rem;
    }

    .team-role {
        font-size: 0.62rem;
    }

    .team-edu {
        font-size: 0.62rem;
    }

    .team-quote {
        font-size: 0.66rem;
        line-height: 1.36;
        margin: 0.3rem 0;
    }

    .team-photo {
        margin-bottom: 0.7rem;
    }

    .team-photo img {
        height: 130px;
    }

    .team-photo-caption {
        font-size: 0.62rem;
        padding: 0.35rem 0.6rem;
    }

    /* ---------- featured research: no inline PDF on iOS ---------- */
    .research-viewer-frame {
        display: none;
    }

    /* the analysis list: a two-column grid so several reports are visible at once
       (the horizontal strip showed barely one and a half) */
    .research-picker {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .research-group {
        grid-column: 1 / -1;
        font-size: 0.58rem;
        letter-spacing: 0.08em;
    }

    .research-pick {
        width: 100%;
        gap: 0.35rem;
        align-items: flex-start;
        padding: 0.32rem 0.38rem;
    }

    .research-pick-thumb {
        width: 28px;
        height: 28px;
    }

    .research-pick-title {
        font-size: 0.68rem;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }

    .research-pick-meta {
        font-size: 0.54rem;
        gap: 0.25rem;
    }

    .research-viewer-bar {
        gap: 0.35rem;
        padding: 0.4rem 0.5rem;
    }

    .research-viewer-title {
        font-size: 0.7rem;
    }

    /* the tap-through card that replaces the iframe */
    .research-mobile-cta {
        display: flex;
        gap: 0.6rem;
        padding: 0.7rem;
    }

    .research-mobile-poster {
        flex: 0 0 58px;
        width: 58px;
        height: 80px;
        border-radius: 8px;
        border: 1px solid var(--color-gray-200);
        background-color: var(--color-gray-100);
        background-size: cover;
        background-position: center;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--primary-green);
        font-size: 1.3rem;
    }

    .research-mobile-body {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .research-mobile-title {
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.2;
        color: var(--color-gray-900);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .research-mobile-hint {
        margin: 0;
        font-size: 0.64rem;
        line-height: 1.35;
        color: var(--color-gray-400);
    }

    .research-mobile-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        margin-top: auto;
    }

    .research-mobile-actions .btn-hero-primary,
    .research-mobile-actions .btn-hero-secondary {
        padding: 0.38rem 0.55rem;
        font-size: 0.72rem;
        border-radius: 8px;
    }

    .research-note {
        font-size: 0.64rem;
        margin-top: 0.5rem;
    }

    /* ---------- about / prose / cards ---------- */
    /* the three "values" cards in About carry an inline one-column style */
    #about .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.45rem;
    }

    #about .feature-card.mb-3 {
        margin-bottom: 0 !important;
    }

    #about blockquote {
        padding-left: 0.6rem !important;
        margin-bottom: 0.6rem !important;
    }

    #about blockquote p,
    #about .blockquote-footer {
        font-size: 0.78rem;
        line-height: 1.4;
    }

    #about h3 {
        font-size: 1rem;
        margin-bottom: 0.4rem !important;
    }

    /* the portfolio chart in About is 200px tall in an inline style */
    #about .card-body [style*="height: 200px"] {
        height: 130px !important;
    }

    .section .text-muted,
    .section .lead {
        font-size: 0.78rem;
        line-height: 1.42;
    }

    .section .card-body {
        padding: 0.6rem !important;
    }

    .section h5,
    .section h4.mb-4 {
        font-size: 0.88rem;
    }

    .section .row.mt-3,
    .section .row.mt-4 {
        margin-top: 0.45rem !important;
    }

    /* ---------- CTA ---------- */
    .cta-section {
        padding: 1.4rem 0;
    }

    .cta-content {
        padding: 1rem 0.8rem;
        border-radius: 12px;
    }

    .cta-title {
        font-size: 1.15rem;
        margin-bottom: 0.35rem;
    }

    .cta-text {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    /* ---------- jump-to-section menu: keep it on phones ---------- */
    .secnav {
        display: flex;
        right: 0.6rem;
        bottom: 0.7rem;
    }

    .secnav-toggle {
        width: 38px;
        height: 38px;
        font-size: 0.92rem;
    }

    .secnav-panel {
        min-width: 0;
        width: min(74vw, 260px);
    }

    .secnav-list {
        max-height: 50vh;
    }

    /* ---------- floating dock navbar: a phone needs less capsule ---------- */
    .navbar {
        top: 0.4rem;
        width: calc(100% - 0.8rem);
        padding: 0.3rem 0.4rem;
        border-radius: 1rem;
    }

    .navbar.scrolled {
        padding: 0.26rem 0.4rem;
    }

    .navbar-brand {
        font-size: 0.98rem;
        gap: 0.4rem;
    }

    .navbar-brand i {
        font-size: 1.05rem;
    }

    .navbar-toggler {
        padding: 0.15rem 0.35rem;
        font-size: 0.85rem;
        border-radius: 0.6rem;
    }

    .navbar-toggler-icon {
        width: 1.15rem;
        height: 1.15rem;
    }

    /* the closing CTA: a normal button, not a slab */
    .btn-cta {
        padding: 0.6rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 10px;
        box-shadow: 0 3px 14px rgba(26, 156, 94, 0.28);
    }

    /* ---------- footer ---------- */
    .footer,
    .site-footer {
        padding: 1.2rem 0 1.4rem;
    }

    .footer-content,
    .footer-links {
        gap: 0.5rem;
    }

    .footer p,
    .footer a,
    .footer-links a {
        font-size: 0.72rem;
    }
}

/* Phones turned sideways have room for the desktop-ish hero column */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-stat-compact {
        flex: 1 1 0;
    }
}
