/* Projects page.
   The hero uses the site's standard banner (.rts-breadcrumb-area) from style.css.
   The only override: the title here is a full sentence, so it is sized down from
   the banner's default 100px (which suits one-word titles like "Portfolio"). */
/* main.js splits the title into single letters (no word grouping), so a line
   could break mid-word ("r / un"). Each word is wrapped in .pw to keep it whole. */
.projects-page .rts_hero__title .pw {
    display: inline-block;
    white-space: nowrap;
}

/* Intro paragraph under the banner: larger and lighter than the default grey body
   text so it reads comfortably. The line-by-line reveal comes from .rts-text-anim. */
.projects-page .title-top-service-varticle p {
    margin: 0;
    max-width: 1080px;
    font-size: clamp(18px, 1.9vw, 26px);
    line-height: 1.6;
    font-weight: 400;
    color: #c9c9c9;
}

@media (min-width: 992px) {
    .projects-page .rts-breadcrumb-area .inner .title {
        font-size: 64px;
        line-height: 1.1;
        max-width: 18ch;
        margin-left: auto;
        margin-right: auto;
        text-wrap: balance;
    }
}

/* ------------------------------------------------------------------
   Product stack: three sticky cards that pile up as you scroll.
   style.css sets overflow-x:hidden on html AND body, which turns body into a
   scroll container and breaks position:sticky. `clip` stops sideways scroll
   without creating a scroll container.
------------------------------------------------------------------- */
.projects-page {
    overflow: visible;
    overflow-x: clip;
}

.projects-stack {
    --stack-top: 120px;   /* clears the fixed header */
    --stack-step: 16px;   /* how much each earlier card peeks out above the next */
    --card-h: clamp(460px, calc(100vh - 170px), 720px);
    position: relative;
    padding: 0 0 12vh;
    background: #0e0e0e;
}

.pcard {
    position: sticky;
    top: calc(var(--stack-top) + var(--i) * var(--stack-step));
    height: var(--card-h);
    margin: 0 auto 12vh;
    max-width: 1240px;
    width: calc(100% - 48px);
    perspective: 1400px;
    transform-origin: 50% 0;
    will-change: transform;
}
.pcard:last-child { margin-bottom: 0; }

.pcard__inner {
    position: relative;
    height: 100%;
    border-radius: 22px;
    overflow: hidden;
    background: #161616;
    border: 1px solid #2b2b2b;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    transform-origin: 50% 100%;
    will-change: transform;
}

.pcard__inner {
    cursor: pointer;
}

.pcard__shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Darkens a card as the next one lands on top of it (driven by projects.js) */
.pcard__shade {
    position: absolute;
    inset: 0;
    background: #0e0e0e;
    opacity: 0;
    pointer-events: none;
}

/* Detail panel, bottom-right corner */
.pcard__panel {
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: min(390px, calc(100% - 44px));
    padding: 22px 22px 20px;
    border-radius: 18px;
    /* Solid, lighter surface + accent edge + ring + shadow, so it stands out on
       both light and dark screenshots (a dark see-through panel vanished on SkillHub). */
    background: #1f1f24;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 6px rgba(14, 14, 14, 0.55), 0 24px 60px rgba(0, 0, 0, 0.7);
    color: #fff;
}

.pcard__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

/* White tile so any logo (dark or light artwork) stays readable */
.pcard__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 8px 14px;
    border-radius: 12px;
    background: #fff;
}
/* For logos that already have their own background (SkillHub): no white tile around them */
.pcard__logo--flush {
    padding: 0;
    overflow: hidden;
    background: transparent;
}
.pcard__logo.pcard__logo--flush img {
    height: 48px;
    max-width: 160px;
}
.pcard__logo img {
    display: block;
    height: 30px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.pcard__count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #c9c9c9;
}
.pcard__count i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.pcard__name {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
}

.pcard__desc {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.55;
    color: #c9c9c9;
}

.pcard__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #fff;
    color: #0e0e0e;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.pcard__link:hover,
.pcard__link:focus-visible {
    background: #e4e4e4;
    color: #0e0e0e;
    transform: translateY(-2px);
}

@media (max-width: 767px) {
    .projects-stack { --stack-top: 96px; --stack-step: 10px; --card-h: clamp(440px, calc(100vh - 140px), 620px); }
    .pcard { width: calc(100% - 28px); margin-bottom: 9vh; }
    .pcard__inner { border-radius: 16px; }
    .pcard__panel { right: 10px; left: 10px; bottom: 10px; width: auto; padding: 16px; }
    .pcard__name { font-size: 22px; }
    .pcard__desc { font-size: 14px; margin-bottom: 14px; }
}
