/* ───────────────────────────────────────────────────────────────────────
   project-showcase.css — the portfolio as one scrolling page.

   Each project is a row: a 16:9 screenshot on one side, its text on the
   other, sides alternating down the page.

   Language is inherited from the editorial pages and must not drift:
   radius 0, no shadows, hairlines as the only hover feedback, one easing
   curve, and the tracking ladder -0.02em display / 0.14em meta / 0.18em
   labels. Every --ed-* reference carries a non-editorial fallback so the
   component still renders off an editorial page.

   CASCADE NOTE: this sheet is echoed from the <body> by the component, so it
   loads AFTER the page stylesheet. Page-level overrides must be scoped
   `.page-portfolio--editorial .showcase__…` or they lose.
   ─────────────────────────────────────────────────────────────────────── */

.showcase {
    --sc-ease: cubic-bezier(0.22, 1, 0.36, 1);
    display: block;
}

/* ── Headline ───────────────────────────────────────────────────────── */
.showcase__head {
    margin-bottom: clamp(2.5rem, 7vw, 6rem);
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
    border-bottom: var(--ed-hair, 1px solid rgba(128, 128, 128, 0.2));
}
.showcase__heading {
    margin: 0;
    font-family: var(--ed-serif, var(--font-display));
    font-weight: 500;
    font-size: clamp(2.6rem, 8vw, 6rem);
    letter-spacing: -0.025em;
    line-height: 0.95;
    color: var(--ed-ink, var(--text-primary));
    font-feature-settings: "ss01";
}
.showcase__subhead {
    margin: 0.8rem 0 0;
    font-family: var(--ed-serif, var(--font-display));
    font-style: italic;
    font-size: clamp(0.95rem, 1.5vw, 1.3rem);
    line-height: 1.4;
    max-width: 36ch;
    color: var(--ed-ink-mute, var(--text-muted));
}

/* ── The list ───────────────────────────────────────────────────────── */
.showcase__list {
    display: flex;
    flex-direction: column;
    gap: clamp(3.5rem, 9vw, 8rem);
}

.showcase__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: center;
}

/* ── Media ──────────────────────────────────────────────────────────
   16:9 to match what script/shoot-portfolio.py captures, so a screenshot is
   never cropped to fit. Dark ground in BOTH themes (literal hexes, the same
   convention .ed-card follows): a cream page behind an arbitrary screenshot
   lets light UI dissolve into the paper, and it also covers the letterbox
   while an image is still loading. */
.showcase__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1f1e1b;
    color: #f5f1ea;
    text-decoration: none;
}
/* Hairline as the only hover feedback — no shadow, no scale. */
.showcase__media::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(245, 241, 234, 0.1);
    transition: border-color 280ms var(--sc-ease);
    pointer-events: none;
}
.showcase__item:hover .showcase__media::after,
.showcase__item:focus-within .showcase__media::after {
    border-color: rgba(245, 241, 234, 0.38);
}

.showcase__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transition: opacity 420ms var(--sc-ease);
}
.showcase__img.is-loaded { opacity: 1; }

/* ── Pending panel ──────────────────────────────────────────────────
   Shown until a screenshot exists. Deliberately NOT artwork: a quiet
   typographic plate that reads as a gap to fill rather than a design choice,
   so an unshot project never looks finished. */
.showcase__pending {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 2rem;
    text-align: center;
    /* Faint diagonal hatch — the drafting convention for "nothing here yet". */
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(245, 241, 234, 0.045) 0 1px,
        transparent 1px 11px);
}
.showcase__pending-name {
    font-family: var(--ed-serif, var(--font-display));
    font-size: clamp(1.2rem, 2.6vw, 2.2rem);
    font-weight: 500;
    line-height: 1.1;
    color: rgba(245, 241, 234, 0.34);
}
.showcase__pending-note {
    font-family: var(--ed-mono, var(--font-mono));
    font-size: 0.56rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(245, 241, 234, 0.28);
    border: 1px solid rgba(245, 241, 234, 0.18);
    padding: 0.3rem 0.6rem;
}

/* ── Text ───────────────────────────────────────────────────────────── */
.showcase__text { min-width: 0; }

.showcase__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 0 0 0.85rem;
    font-family: var(--ed-mono, var(--font-mono));
    font-size: 0.63rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-mute, var(--text-muted));
}
.showcase__status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.showcase__status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}
/* Not-yet-open work reads as an outline; shipped work is solid. No hue. */
.showcase__status[data-status="launching"] .showcase__status-dot,
.showcase__status[data-status="building"]  .showcase__status-dot {
    background: transparent;
    box-shadow: inset 0 0 0 1px currentColor;
}

.showcase__title {
    margin: 0 0 0.85rem;
    font-family: var(--ed-serif, var(--font-display));
    font-weight: 500;
    font-size: clamp(1.75rem, 3.4vw, 3rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
}
.showcase__title a,
.showcase__title > span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--ed-ink, var(--text-primary));
    text-decoration: none;
    /* Underline drawn on the box, not the glyphs, so it can animate in. */
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1px;
    transition: background-size 380ms var(--sc-ease);
}
.showcase__item:hover .showcase__title a,
.showcase__title a:focus-visible { background-size: 100% 1px; }
.showcase__title i {
    font-size: 0.55em;
    transition: transform 280ms var(--sc-ease);
}
.showcase__item:hover .showcase__title i { transform: translate(3px, -3px); }
.showcase__item:hover .showcase__title .ri-arrow-right-line { transform: translateX(4px); }

.showcase__desc {
    margin: 0 0 1.1rem;
    font-family: var(--ed-sans, var(--font-body));
    font-size: clamp(0.88rem, 1.02vw, 1rem);
    line-height: 1.65;
    max-width: 48ch;
    color: var(--ed-ink-soft, var(--text-secondary));
}

.showcase__stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.showcase__stack li {
    font-family: var(--ed-mono, var(--font-mono));
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-soft, var(--text-secondary));
    border: 1px solid color-mix(in srgb, var(--ed-ink, #808080) 20%, transparent);
    padding: 0.3rem 0.52rem;
}

/* ── Closing CTA ────────────────────────────────────────────────────── */
.showcase__cta {
    margin-top: clamp(3.5rem, 9vw, 8rem);
    padding-top: clamp(1.5rem, 3vw, 2.5rem);
    border-top: var(--ed-hair, 1px solid rgba(128, 128, 128, 0.2));
}
.showcase__cta-text {
    margin: 0 0 1rem;
    font-family: var(--ed-serif, var(--font-display));
    font-style: italic;
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    line-height: 1.45;
    max-width: 40ch;
    color: var(--ed-ink-mute, var(--text-muted));
}
.showcase__cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--ed-mono, var(--font-mono));
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ed-ink, var(--text-primary));
    border-bottom: 1px solid color-mix(in srgb, var(--ed-ink, #808080) 30%, transparent);
    padding-bottom: 0.25rem;
    transition: border-color 280ms var(--sc-ease);
}
.showcase__cta-link:hover { border-bottom-color: var(--ed-ink, var(--text-primary)); }
.showcase__cta-link i { transition: transform 280ms var(--sc-ease); }
.showcase__cta-link:hover i { transform: translateX(4px); }

/* ── Two columns, alternating sides ─────────────────────────────────
   Explicit grid placement rather than row-reverse: it keeps the DOM order
   (screenshot then text) identical for every project, so the reading order a
   screen reader and the keyboard follow never depends on which side the
   picture happens to be on. */
@media (min-width: 900px) {
    .showcase__item {
        /* The screenshot is the presentation — give it the larger share. Much
           past this and the description column starts squeezing its measure. */
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: clamp(1.75rem, 4vw, 4rem);
    }
    /* Flipping which COLUMN each element sits in is only half the job — the
       track sizes have to flip with it. Without this rule the wide 1.5fr track
       stayed on the left for every row, so every right-hand screenshot rendered
       570x320 against 854x481 on the left, and its text column got the extra
       width it did not need. The screenshot always takes the larger track. */
    .showcase__item:nth-child(even) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    }
    .showcase__item:nth-child(even) .showcase__media {
        grid-column: 2;
        grid-row: 1;
    }
    .showcase__item:nth-child(even) .showcase__text {
        grid-column: 1;
        grid-row: 1;
    }
}

/* ── Scroll reveal ──────────────────────────────────────────────────
   Gated on `.has-js` (set by a one-line inline script in the page head) so a
   visitor without JS is never left staring at opacity:0 content — the reveal
   only ever runs from script/portfolio.js. */
@media (prefers-reduced-motion: no-preference) {
    .has-js .showcase__item[data-showcase-item],
    .has-js .showcase__cta[data-showcase-item] {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 700ms var(--sc-ease), transform 700ms var(--sc-ease);
    }
    .has-js .showcase__item.is-in,
    .has-js .showcase__cta.is-in {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showcase__item,
    .showcase__cta,
    .showcase__img,
    .showcase__media::after,
    .showcase__title a,
    .showcase__title i { transition: none !important; }
    .showcase__item,
    .showcase__cta { opacity: 1 !important; transform: none !important; }
    .showcase__img { opacity: 1 !important; }
}
