/* ==========================================================================
   PROJECT SHOWCASE
   Shared card + device-frame system used by the portfolio grid and the
   project detail page. Each project carries its own --acc colour so the
   cards read as distinct pieces of work inside one navy/gold frame.
   ========================================================================== */

/* --------------------------------------------------------------------------
   DEVICE FRAMES
   The frame tells you what kind of work it is before you read a word:
   a phone for software you hold, a browser for software you visit.
   -------------------------------------------------------------------------- */
.dev {
    flex-shrink: 0;
    position: relative;
}

.dev img {
    display: block;
    object-fit: cover;
    object-position: top center;
}

/* App shots are sized by height and keep their own proportions, so a
   screenshot from any device lands on the row's baseline uncropped. */
.dev-phone img {
    height: 100%;
    width: auto;
}

/* Site shots fill a frame of fixed proportions. */
.dev-browser img {
    width: 100%;
    height: 100%;
}

/* ---- app screenshot ----
   A phone screenshot already reads as a phone: it carries the status bar
   and the app's own chrome. Wrapping it in a drawn bezel just frames a
   frame, so it gets rounded corners and a lifted shadow instead. ---- */
.dev-phone {
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    line-height: 0;
    box-shadow: 0 2px 5px rgba(0, 20, 60, 0.07),
                0 14px 30px rgba(0, 20, 60, 0.15);
}

.dev-phone .dev-screen {
    border-radius: inherit;
    overflow: hidden;
    height: 100%;
    background: #fff;
}

/* ---- browser ----
   A site screenshot has no chrome of its own, so the frame supplies the
   context the image is missing. ---- */
.dev-browser {
    width: 202px;
    background: #E7EAF1;
    border: 1px solid #CDD4E2;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 20, 60, 0.18);
    display: flex;
    flex-direction: column;
}

.dev-bar {
    height: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    background: #DDE2EC;
}

.dev-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dev-url {
    flex: 1;
    height: 12px;
    margin-left: 5px;
    padding: 0 7px;
    background: #F4F6FA;
    border-radius: 999px;
    font-size: 7.5px;
    line-height: 12px;
    color: #7A87A3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* Sized by its own proportions wherever the frame's height is left to the
   content — the gallery and the home band. */
.dev-browser .dev-screen {
    aspect-ratio: 16 / 10.5;
    background: #fff;
    overflow: hidden;
}

/* Where the frame has a stated height, the screen takes whatever the title
   bar leaves instead. */
.pcard-shots .dev-browser .dev-screen {
    aspect-ratio: auto;
    flex: 1;
    min-height: 0;
}


/* empty state inside a frame, before screenshots are uploaded */
.dev-blank {
    height: 100%;
    background:
        repeating-linear-gradient(
            45deg,
            color-mix(in srgb, var(--acc, #001F54) 7%, #fff) 0 8px,
            color-mix(in srgb, var(--acc, #001F54) 12%, #fff) 8px 16px
        );
}

/* --------------------------------------------------------------------------
   PROJECT CARD
   -------------------------------------------------------------------------- */
.pcard {
    --acc: #001F54;
    /* A light accent is fine as a wash but fails as small text, so labels use
       a deepened version of the same hue instead of the raw colour. */
    --acc-ink: color-mix(in srgb, var(--acc) 72%, var(--blue-text));
    background: #fff;
    border: 1px solid #E2E6EE;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.34s ease;
}

.pcard:hover,
.pcard:focus-within {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--acc) 38%, #E2E6EE);
    box-shadow: 0 18px 38px rgba(0, 20, 60, 0.13);
}

.pcard-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.pcard-link:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: -3px;
    border-radius: 18px;
}

/* ---- head: icon + name + tagline ---- */
.pcard-head {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px 18px 14px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--acc) 13%, #fff) 0%,
        #fff 100%
    );
}

.pcard-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    flex-shrink: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--acc) 18%, #fff);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    display: grid;
    place-items: center;
}

.pcard-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pcard-id {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pcard-id h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--blue-text);
}

.pcard-tag {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.35;
    color: #5F6B87;
}

.pcard-meta {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 5px;
}

.pcard-chip {
    font-size: 10.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid currentColor;
    color: var(--acc-ink, var(--acc));
    white-space: nowrap;
}

.pcard-yr {
    font-size: 11px;
    color: #7A87A3;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---- screenshot strip ---- */
.pcard-shots {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 18px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pcard-shots::-webkit-scrollbar {
    display: none;
}

/* The height is stated on the frames themselves rather than left to
   align-items: stretch. A stretch-derived height is indefinite, so Safari
   refuses to resolve the image's height:100% against it and falls back to
   the screenshot's natural width — which blows the strip out into blank
   1320px-wide boxes. */
.pcard-shots .dev {
    height: 186px;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.pcard:hover .pcard-shots .dev {
    transform: translateY(-3px);
}

.pcard:hover .pcard-shots .dev:nth-child(2) {
    transition-delay: 0.04s;
}

.pcard:hover .pcard-shots .dev:nth-child(3) {
    transition-delay: 0.08s;
}

/* ---- foot ---- */
.pcard-foot {
    margin-top: auto;
    padding: 13px 18px;
    border-top: 1px solid #E9EDF4;
    background: #FCFDFE;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pcard-go {
    font-weight: 700;
    font-size: 14px;
    color: var(--acc-ink, var(--acc));
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pcard-go .arw {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.pcard:hover .pcard-go .arw {
    transform: translateX(4px);
}

.pcard-cnt {
    font-size: 11px;
    color: #8B96AE;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* --------------------------------------------------------------------------
   FILTERS
   -------------------------------------------------------------------------- */
.pf-filters {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.pf-filter {
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 17px;
    border-radius: 999px;
    border: 1.5px solid #E2E6EE;
    background: #fff;
    color: #5F6B87;
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease,
                border-color 0.22s ease, transform 0.22s ease;
}

.pf-filter:hover {
    border-color: var(--gold);
    color: var(--blue-text);
    transform: translateY(-1px);
}

.pf-filter:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.pf-filter[aria-pressed="true"] {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: #fff;
}

.pf-filter .num {
    opacity: 0.55;
    margin-left: 4px;
}

/* --------------------------------------------------------------------------
   GRID
   -------------------------------------------------------------------------- */
.pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

/* One or two projects stretched across a three-column grid look stranded.
   Cap the track and centre the row until there is enough work to fill it. */
.pf-grid--few {
    /* auto-fit collapses the tracks nothing landed in, so one card centres
       instead of sitting in the first slot of an empty row. */
    grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
    justify-content: center;
}

/* --------------------------------------------------------------------------
   MOTION
   Cards rise into place as they scroll in, and settle again after filtering,
   so the grid feels handled rather than redrawn.
   -------------------------------------------------------------------------- */
/* Guarded by .js: only hide what a script is around to reveal again, so the
   work is still readable if the script never runs. */
.js .reveal {
    opacity: 0;
    transform: translateY(22px);
}

.js .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.pcard.is-out {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: opacity 0.24s ease, transform 0.24s ease;
    pointer-events: none;
}

.pcard.is-gone {
    display: none;
}

/* --------------------------------------------------------------------------
   DETAIL PAGE
   -------------------------------------------------------------------------- */
.pd-hero {
    --acc: #001F54;
    padding: 46px 0;
    color: #fff;
    background:
        radial-gradient(
            120% 150% at 12% 0%,
            color-mix(in srgb, var(--acc) 42%, var(--blue-dark)) 0%,
            var(--blue-dark) 62%
        );
}

.pd-hero-inner {
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
}

.pd-icon {
    width: 82px;
    height: 82px;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.pd-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pd-id {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pd-id h1 {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.pd-id .pd-tag {
    margin: 0;
    color: #A9B6D4;
    font-size: 16px;
    line-height: 1.5;
}

.pd-meta {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.pd-meta .pcard-chip {
    color: var(--gold);
}

.pd-meta .pd-sub {
    font-size: 12px;
    color: #8494BE;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.pd-cta {
    margin-left: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* --------------------------------------------------------------------------
   STORE BUTTONS
   An app ships to two platforms, so it gets two doors. The one matching the
   visitor's device is moved first by projects.js — both stay reachable.
   -------------------------------------------------------------------------- */
.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 17px 9px 14px;
    border-radius: 12px;
    background: #0B1220;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    text-decoration: none;
    line-height: 1.1;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.28s ease, background 0.28s ease;
}

.store-btn:hover {
    transform: translateY(-2px);
    background: #111A2C;
    border-color: var(--gold);
}

.store-btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.store-mark {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

.store-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.store-txt small {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.72;
}

.store-txt strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* the visitor's own platform leads */
.store-btn.is-preferred {
    order: -1;
    border-color: var(--gold);
    background: #131E33;
}

/* ---- gallery ---- */
.pd-gallery-sec {
    background: var(--gray-light);
    border-bottom: 1px solid #E2E6EE;
    padding: 30px 0;
}

.pd-gallery {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.pd-gallery .dev {
    scroll-snap-align: center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease;
}

.pd-gallery .dev:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 34px rgba(0, 20, 60, 0.2);
}

.pd-gallery .dev-phone {
    height: 460px;
}

.pd-gallery .dev-browser {
    width: 400px;
}

.pd-shot {
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex-shrink: 0;
}

.pd-cap {
    font-size: 12.5px;
    color: #6B7896;
    text-align: center;
    max-width: 400px;
}

/* ---- body ---- */
/* This element also carries .container, so only the vertical padding is set
   here — a padding shorthand would wipe out the container's side gutters and
   run the text into the screen edge on narrow viewports. */
.pd-body {
    padding-top: 40px;
    padding-bottom: 48px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
}

.pd-body h2 {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7A87A3;
    margin: 0 0 12px;
    font-weight: 700;
}

/* Descriptions run long, and the full column width puts ~93 characters on a
   line — far past where the eye loses its place returning to the left. */
.pd-text {
    max-width: 58ch;
}

.pd-text p {
    color: #3A465F;
    font-size: 16px;
    line-height: 1.75;
    margin: 0 0 14px;
}

.pd-spec {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #E9EDF4;
    font-size: 14.5px;
    margin: 0;
}

.pd-spec dt {
    color: #7A87A3;
}

.pd-spec dd {
    margin: 0;
    font-weight: 600;
    color: var(--blue-text);
    text-align: right;
}

.pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.pd-tags span {
    font-size: 11.5px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid #E2E6EE;
    color: #5F6B87;
    background: #fff;
}

/* ---- next project ---- */
.pd-next {
    border-top: 1px solid #E9EDF4;
    padding: 28px 0 44px;
}

.pd-next a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
    padding: 16px 18px;
    border: 1px solid #E2E6EE;
    border-radius: 14px;
    background: #fff;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s ease, border-color 0.3s ease;
}

.pd-next a:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 12px 26px rgba(0, 20, 60, 0.1);
}

.pd-next .lbl {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8B96AE;
    display: block;
    margin-bottom: 3px;
}

.pd-next .nm {
    font-weight: 700;
    font-size: 17px;
    color: var(--blue-text);
}

.pd-next .arw {
    margin-left: auto;
    color: var(--gold);
    font-size: 20px;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.pd-next a:hover .arw {
    transform: translateX(5px);
}

/* --------------------------------------------------------------------------
   EMPTY STATE
   -------------------------------------------------------------------------- */
.pf-empty {
    border: 1px dashed #CFD7E6;
    border-radius: 16px;
    padding: 40px 26px;
    text-align: center;
    color: #5F6B87;
    background: #fff;
}

.pf-empty strong {
    display: block;
    font-size: 18px;
    color: var(--blue-text);
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .pd-body {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .pd-cta {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .pf-grid {
        grid-template-columns: 1fr;
    }

    .pd-gallery .dev-browser {
        width: 300px;
    }

    .pd-gallery .dev-phone {
        height: 340px;
    }
}

/* --------------------------------------------------------------------------
   REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    /* Matches the specificity of the .js guard above so the content shows
       straight away rather than waiting to be animated in. */
    .js .reveal,
    .js .reveal.is-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .pcard,
    .pcard-shots .dev,
    .pd-gallery .dev,
    .pd-next a,
    .pf-filter,
    .pcard-go .arw,
    .pd-next .arw {
        transition: none !important;
    }

    .pcard:hover,
    .pd-gallery .dev:hover,
    .pd-next a:hover {
        transform: none;
    }
}
