/* ============================================================
   PRACHAR THEME — capabilities.css
   Section: "What I Do" capability cards grid.

   Depends on: style.css (base reset, Inter font, .pr-main layout)
   Namespace:  .pr-capabilities / .pr-cap-*
   No JS dependencies for layout. Scroll reveal uses .pr-cap-card--visible
   added by an IntersectionObserver defined in partials/capabilities.hbs.
   ============================================================ */


/* --- Playfair Display: Google Fonts import for display heading ---
   Loaded here so capabilities.css is self-contained.
   Weights: 700 (Bold) only — avoids pulling unused variants.
   display=swap prevents FOIT. ----------------------------------- */
/* Playfair Display is loaded via hero-v2.css @font-face declarations */


/* ============================================================
   1. SECTION WRAPPER
   ============================================================ */

.pr-capabilities {
    padding: 120px 0;
    position: relative;
}

/* Constrain to the theme's standard max-width / gutter.
   Matches .pr-main (max-width: 1200px, padding: 0 32px). */
.pr-cap-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}


/* ============================================================
   2. SECTION HEADING
   ============================================================ */

.pr-cap-header {
    margin-bottom: 56px;
}

/* Override .pr-section-title defaults for this context:
   the heading here is full white (not muted) and uses
   Playfair Display as specified. */
.pr-cap-heading.pr-section-title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: clamp(2.5rem, 5vw, 3rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0;
    position: relative;
    display: inline-block;
}

/* Gradient underline accent — extends from the left edge of the text */
.pr-cap-heading.pr-section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        rgba(74, 222, 128, 0.9)   0%,
        rgba(96, 165, 250, 0.7)  50%,
        rgba(244, 114, 182, 0.0) 100%
    );
}


/* ============================================================
   3. GRID
   ============================================================ */

.pr-cap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}


/* ============================================================
   4. CAPABILITY CARD
   ============================================================ */

.pr-cap-card {
    background-color: var(--cap-bg, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    cursor: default;

    /* Hover transition */
    transition:
        transform         0.3s ease,
        box-shadow        0.3s ease,
        background-color  0.3s ease;

    /* Scroll reveal initial state — hidden until .pr-cap-card--visible is applied */
    opacity: 0;
    transform: translateY(28px);
}

/* Visible state (class added by IntersectionObserver in partial) */
.pr-cap-card.pr-cap-card--visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity           0.75s cubic-bezier(0.16, 1, 0.3, 1),
        transform         0.75s cubic-bezier(0.16, 1, 0.3, 1),
        background-color  0.3s ease,
        box-shadow        0.3s ease;
}

/* Hover: lift, shadow, brightened background */
.pr-cap-card:hover {
    transform: translateY(-8px);
    background-color: var(--cap-bg-hover, #222222);
    box-shadow:
        0 20px 48px rgba(0, 0, 0, 0.45),
        0  8px 16px rgba(0, 0, 0, 0.25),
        0  0   0 1px rgba(255, 255, 255, 0.08) inset;
}

/* When a card is both visible AND hovered, the transition on transform
   needs to respect the hover state correctly. */
.pr-cap-card.pr-cap-card--visible:hover {
    transform: translateY(-8px);
}

/* Subtle inner top highlight — adds depth without being loud */
.pr-cap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.14) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* Ambient glow spot in top-right — matches card's bg hue, very faint */
.pr-cap-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.04) 0%,
        transparent 70%
    );
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pr-cap-card:hover::after {
    opacity: 0;
}


/* ============================================================
   5. CARD INNER LAYOUT
   ============================================================ */

/* The inner wrapper is a plain block — no stacking context needed.
   The icon is a direct sibling (absolute-positioned on .pr-cap-card),
   so no z-index juggling required here. */
.pr-cap-card-inner {
    position: relative;
}


/* ============================================================
   6. ICON
   ============================================================ */

.pr-cap-icon {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.65;
    /* Prevent emoji from being selected or causing layout reflow */
    user-select: none;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pr-cap-card:hover .pr-cap-icon {
    opacity: 0.9;
    transform: scale(1.1);
}


/* ============================================================
   7. CARD TITLE
   ============================================================ */

.pr-cap-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.5rem;   /* ~24px at 16px base */
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.025em;
    line-height: 1.25;
    /* Leave room so the icon (top-right absolute) doesn't overlap long titles */
    padding-right: 48px;
    margin-bottom: 16px;
}


/* ============================================================
   8. CARD DESCRIPTION
   ============================================================ */

.pr-cap-desc {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;    /* 16px */
    font-weight: 400;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.65;
    letter-spacing: 0.005em;
    margin: 0;
}


/* ============================================================
   9. NO-JS / REDUCED-MOTION FALLBACK
   ============================================================ */

/* If JS never runs (no-js class on <html>) or if the observer
   never fires, show all cards without animation. */
.no-js .pr-cap-card,
.no-js .pr-cap-card.pr-cap-card--visible {
    opacity: 1;
    transform: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

/* Reduced motion: respect user preference — no translate, instant opacity */
@media (prefers-reduced-motion: reduce) {
    .pr-cap-card {
        opacity: 1;
        transform: none;
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }

    .pr-cap-card.pr-cap-card--visible {
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }

    .pr-cap-card:hover {
        transform: none;
    }

    .pr-cap-card.pr-cap-card--visible:hover {
        transform: none;
    }

    .pr-cap-icon {
        transition: none;
    }
}


/* ============================================================
   10. RESPONSIVE — TABLET (< 900px)
   ============================================================ */

@media (max-width: 899px) {
    .pr-capabilities {
        padding: 96px 0;
    }

    .pr-cap-card {
        padding: 32px;
    }

    .pr-cap-icon {
        top: 32px;
        right: 32px;
        font-size: 1.375rem;
    }
}


/* ============================================================
   11. RESPONSIVE — MOBILE (< 768px)
   ============================================================ */

@media (max-width: 767px) {
    .pr-capabilities {
        padding: 80px 0;
    }

    .pr-cap-inner {
        /* Tighter horizontal gutters on small screens */
        padding: 0 20px;
    }

    .pr-cap-header {
        margin-bottom: 40px;
    }

    /* Single-column stack */
    .pr-cap-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pr-cap-card {
        padding: 28px 24px;
    }

    .pr-cap-icon {
        top: 28px;
        right: 24px;
        font-size: 1.25rem;
    }

    .pr-cap-title {
        /* On mobile, icon is smaller and card is narrower — reduce title padding */
        padding-right: 40px;
        font-size: 1.25rem;
    }

    .pr-cap-desc {
        font-size: 0.95rem;
    }
}


/* ============================================================
   12. PRINT
   ============================================================ */

@media print {
    .pr-capabilities {
        padding: 40px 0;
    }

    .pr-cap-card {
        opacity: 1 !important;
        transform: none !important;
        border: 1px solid #ccc;
        background: #fff !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .pr-cap-title {
        color: #000;
    }

    .pr-cap-desc {
        color: #444;
    }
}
