/*
 * Panarina Marketing: "Selected Projects" cards (Website Design page)
 * Compact project cards under the animated portfolio field.
 * Desktop: 3 columns (2 rows of 3), square cards that grow when content needs more room.
 * Tablet: 2 columns. Mobile: 1 column. Colours follow the existing page variables.
 */

.sp-section {
    /* override the global `section { max-width:1200px; padding:100px 40px }` rule */
    max-width: none;
    margin: 0;
    padding: 90px 40px 100px;
    background: linear-gradient(180deg, var(--darker-blue, #04060b) 0%, var(--deep-blue, #07101a) 50%, var(--darker-blue, #04060b) 100%);
}

.sp-header {
    max-width: 1200px;
    margin: 0 auto 44px;
    text-align: center;
}

.sp-eyebrow {
    color: var(--neon-cyan, #00e5ff);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.sp-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1.2;
}

.sp-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* ------------------------------------------------------------------ Card */
.sp-card {
    display: flex;
    flex-direction: column;
    /* square on desktop; aspect-ratio lets the card grow if the content needs more height (no clipping) */
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 30px 28px 28px;
    background: rgba(10, 16, 26, 0.6);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 20px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

/* restrained neon glow: hover (mouse) and keyboard focus get the same treatment */
.sp-card:hover,
.sp-card:focus-within {
    border-color: rgba(204, 255, 0, 0.5);
    box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.12), 0 0 26px rgba(204, 255, 0, 0.14);
    transform: translateY(-3px);
}

.sp-type {
    color: var(--neon-cyan, #00e5ff);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.sp-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 14px;
}

.sp-text {
    color: var(--text-gray, #a0a0a0);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 18px;
}

.sp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    margin-bottom: 18px;
}

.sp-stats div {
    display: flex;
    flex-direction: column-reverse;   /* number above its label, while dt stays first in the markup */
}

.sp-stats dd {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--neon-green, #CCFF00);
    line-height: 1.1;
}

.sp-stats dt {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim, #8a9aa3);
    margin-top: 4px;
}

.sp-link {
    margin-top: auto;                 /* links line up at the bottom of each card */
    align-self: flex-start;
    color: var(--neon-cyan, #00e5ff);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 0;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.sp-link:hover {
    color: var(--neon-green, #CCFF00);
}

.sp-link:focus-visible {
    outline: 2px solid var(--neon-green, #CCFF00);
    outline-offset: 4px;
    color: var(--neon-green, #CCFF00);
}

/* touch screens: no hover, so links are underlined to read clearly as tappable */
@media (hover: none) {
    .sp-card:hover { transform: none; }
    .sp-link {
        text-decoration: underline;
        text-underline-offset: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-card { transition: none; }
    .sp-card:hover,
    .sp-card:focus-within { transform: none; }
}

/* ------------------------------------------------------------------ Breakpoints */
@media (max-width: 1023px) {
    .sp-section { padding: 70px 24px 80px; }
    .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .sp-card { aspect-ratio: auto; }
}

@media (max-width: 640px) {
    .sp-section { padding: 56px 16px 64px; }
    .sp-title { font-size: 1.7rem; }
    .sp-grid { grid-template-columns: 1fr; gap: 16px; }
    .sp-card { padding: 26px 22px 22px; }
}
