/* ==========================================================================
   EGOCENTRIC HERO SECTION (Desktop 1440px Canvas, Height: 768px Inner)
   ========================================================================== */

.ego-page-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    /* padding: 12px; */
    box-sizing: border-box;
    background-color: #000000;
}

.ego-page-header {
    /* margin: 12px 12px; */
    /* padding: 12px; */
    align-items: center;
    box-sizing: border-box;
    background-color: #000000;
}

/* Hero Box (1416px x 768px @ x: 12, y: 144) */
.ego-hero-container {
    position: relative;
    width: 100%;
    height: 768px;
    margin: 0 auto;
    background: linear-gradient(180deg, #000000 0%, #1a1a1a 45%, #5A5A5A 100%);
    overflow: hidden;
    /* Contains the 2914px media within the hero bounds */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Main Content Row: Two 702px Columns, 12px Gap */
.ego-hero-content-row {
    position: center;
    width: 1416px;
    height: 492px;
    /* Centers the fixed-width row when the hero is wider than 1440px.
       Auto margins resolve to 0 when the viewport is narrower, so nothing shifts below 1440px. */
    margin: 0 auto;
    /* Top zone up to the y492 media start */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    z-index: 5;
}

/* ==========================================================================
   Left Column (702px wide, 32px inner padding, origin: x44, y176)
   ========================================================================== */

.ego-hero-left-col {
    width: 702px;
    padding: 32px 64px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
}

/* Heading: Aspekta 400, 56px / 61.6px, -0.02em, white, width: 564px */
.ego-hero-heading {
    width: 564px;
    max-width: 100%;
    font-family: 'Aspekta', sans-serif;
    font-weight: 400;
    font-size: 56px;
    line-height: 110%;
    /* 61.6px */
    letter-spacing: -0.02em;
    /* -1.12px */
    color: #FFFFFF;
    margin: 0;
    text-align: left;
}

/* Description: Inter 400, 16px / 24px, white 75%, width: 524px, 24px gap */
.ego-hero-description {
    width: 524px;
    max-width: 100%;
    margin-top: 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    /* 24px */
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.75);
    text-align: left;
}

/* CTA Pair: 185px x 48px, 48px gap after description */
.ego-hero-cta-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: 185px;
    height: 48px;
    margin-top: 48px;
    box-sizing: border-box;
}

/* Text Segment: 133px x 48px, #F3F3F3, radius 4px, padding 16px */
.ego-cta-text-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 133px;
    height: 48px;
    padding: 0 16px;
    background-color: #F3F3F3;
    border-radius: 4px;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.ego-cta-text-pill span {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    line-height: 120%;
    /* 16.8px */
    letter-spacing: 0;
    text-transform: uppercase;
    color: #2A2A2A;
    white-space: nowrap;
}

.ego-cta-text-pill:hover {
    background-color: #E2E2E2;
}

/* Arrow Segment: 48px x 48px circular, #CAED57 */
.ego-cta-arrow-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background-color: #CAED57;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.ego-cta-arrow-circle:hover {
    background-color: #bce042;
    transform: translateX(2px);
}

/* ==========================================================================
   Right Column (702px wide, 3 Right-Aligned Value/Label Stacks)
   ========================================================================== */

.ego-hero-right-col {
    width: 702px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Aligns stacks towards the bottom of top area */
    box-sizing: border-box;
}

/* Metadata Row: 3 Stacks, 245px spacing, Right-Aligned */
.ego-metadata-row {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 80px;
    box-sizing: border-box;
    margin-bottom: 144px;
}

.ego-meta-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 24px;
    /* Value-to-label gap */
    text-align: right;
}

/* Value: Aspekta 400, 36px / 39.6px, -0.02em, #FDFFF6 */
.ego-meta-val {
    font-family: 'Aspekta', sans-serif;
    font-weight: 400;
    font-size: 36px;
    line-height: 110%;
    /* 39.6px */
    letter-spacing: -0.02em;
    color: #FDFFF6;
    margin: 0;
    white-space: nowrap;
}

/* Label: Aspekta 500, 12px / 16.8px, +0.01em, #FDFFF6 at 75% */
.ego-meta-lbl {
    font-family: 'Aspekta', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 140%;
    /* 16.8px */
    letter-spacing: 0.01em;
    color: rgba(253, 255, 246, 0.75);
    white-space: nowrap;
}

/* ==========================================================================
   Bottom Media (Starts y492, Dimensions: 2914.29px x 510px)
   ========================================================================== */

.ego-hero-bottom-media {
    position: absolute;
    top: 348px;
    /* y492 relative to y144 (492 - 144 = 348px) */
    left: 50%;
    transform: translateX(-50%);
    width: 2914.29px;
    height: 510px;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ego-ascii-media-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: screen;
    opacity: 0.85;
    display: block;
}

.ego-ascii-media-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.2) 0%, transparent 80%);
    pointer-events: none;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 100%; ) {

    .ego-page-wrapper,
    .ego-hero-container {
        width: 100%;
    }
}

@media (max-width: 1100px) {

    .ego-page-header {
        /* margin: 12px 12px; */
        box-sizing: border-box;
        background-color: #000000;
    }

    .ego-hero-container {
        height: auto;
    }

    .ego-hero-content-row {
        height: auto;
        flex-direction: column;
    }

    .ego-hero-left-col,
    .ego-hero-right-col {
        width: 100%;
    }

    .ego-metadata-row {
        justify-content: flex-start;
        gap: 40px;
    }

    .ego-meta-stack {
        align-items: flex-start;
        text-align: left;
    }

    .ego-hero-bottom-media {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        height: 320px;
    }
}


/* ==========================================================================
   EGOCENTRIC DATASET GALLERY SECTION (Desktop 1440px x 1920px Baseline)
   ========================================================================== */

.ego-gallery-section {
    position: relative;
    width: 100%;
    max-width: 100%;
    ;
    height: 1920px;
    background-color: #DBD5FF;
    /* Lavender section background */
    margin: 0 auto;
    padding: 96px 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
}

.ego-gallery-container {
    width: 1200px;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* ==========================================================================
   3 Columns x 3 Rows Grid (Cards: 384px x 528px, Gap: 24px on both axes)
   ========================================================================== */

.ego-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 384px);
    grid-template-rows: repeat(3, 528px);
    gap: 24px;
    width: 1200px;
    box-sizing: border-box;
}

/* Individual Card (384px x 528px, radius 4px, 20px diagonal cut at top-left) */
.ego-dataset-card {
    position: relative;
    width: 384px;
    height: 528px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: none;
    box-shadow: none;

    /* 20px diagonal cut on top-left corner */
    clip-path: polygon(20px 0%,
            100% 0%,
            100% 100%,
            0% 100%,
            0% 20px);
}

/* ==========================================================================
   Upper Information Surface (#F3F0E8, Height: 284px, Padding: 24px)
   ========================================================================== */

.ego-card-info-surface {
    position: relative;
    width: 384px;
    height: 284px;
    background-color: #F3F0E8;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Index (x24, y24 relative to card -> DM Mono 500, 14px/21px, #9180FF) */
.ego-card-index {
    position: absolute;
    top: 24px;
    left: 24px;
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    line-height: 21px;
    color: #9180FF;
    letter-spacing: 0;
}

/* Title (x24, y113 relative to card -> Aspekta 400, 28px/30.8px, tracking -0.02em, #111111) */
.ego-card-title {
    position: absolute;
    top: 113px;
    left: 24px;
    right: 24px;
    font-family: 'Aspekta', sans-serif;
    font-weight: 400;
    font-size: 28px;
    line-height: 110%;
    /* 30.8px */
    letter-spacing: -0.02em;
    /* -0.56px */
    color: #111111;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Metadata Stack (x24, rows at y164 and y194, label/value gap: 8px) */
.ego-card-meta-group {
    position: absolute;
    top: 164px;
    left: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Positions second row at y194 */
    box-sizing: border-box;
}

.ego-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 20px;
}

.ego-meta-label {
    font-family: 'Aspekta', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    /* 19.6px */
    letter-spacing: 0.01em;
    color: rgba(17, 17, 17, 0.5);
    /* #111111 at 50% */
}

.ego-meta-value {
    font-family: 'Aspekta', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    /* 19.6px */
    letter-spacing: 0.01em;
    color: #111111;
}

/* Format Badges (x24, y228 relative to card, height: 32px, gap: 12px) */
.ego-card-badges-row {
    position: absolute;
    top: 228px;
    left: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    height: 32px;
}

.ego-badge {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(145, 128, 255, 0.25);
    /* #9180FF at 25% */
    border-radius: 4px;
    padding: 0 12px;
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    line-height: 120%;
    /* 16.8px */
    letter-spacing: 0;
    text-transform: uppercase;
    color: #2A2A2A;
    box-sizing: border-box;
    white-space: nowrap;
}

/* min-width keeps the design size for the default text and lets longer ACF values grow the badge */
.ego-badge.badge-format {
    min-width: 117px;
}

.ego-badge.badge-fps {
    min-width: 100px;
}

/* ==========================================================================
   Lower Thumbnail Media Container (384px x 244px, Cover Crop)
   ========================================================================== */

.ego-card-thumb-wrap {
    position: relative;
    width: 384px;
    height: 244px;
    overflow: hidden;
    background-color: #111111;
}

.ego-card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Centered White Circular Play Overlay (60px circle inside 72px icon area) */
.ego-play-btn-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ego-play-circle {
    width: 60px;
    height: 60px;
    border-radius: 9999px;
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.ego-play-circle svg {
    margin-left: 3px;
    /* Optically centers the triangle */
}

/* ==========================================================================
   Bottom CTA Row (Centered @ x602 y1776, Total: 236px x 48px, 48px below grid)
   ========================================================================== */

.ego-gallery-cta-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 236px;
    height: 48px;
    margin-top: 48px;
    box-sizing: border-box;
}

/* Text Segment (184px x 48px, white, radius 4px, padding 16px) */
.ego-gallery-cta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 184px;
    height: 48px;
    padding: 0 16px;
    background-color: #FFFFFF;
    border-radius: 4px;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.ego-gallery-cta-pill span {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    line-height: 120%;
    /* 16.8px */
    letter-spacing: 0;
    text-transform: uppercase;
    color: #2A2A2A;
    white-space: nowrap;
}

.ego-gallery-cta-pill:hover {
    background-color: #F3F3F3;
}

/* Arrow Button (48px x 48px circular, white) */
.ego-gallery-cta-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background-color: #FFFFFF;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.ego-gallery-cta-arrow:hover {
    background-color: #F3F3F3;
    transform: translateX(2px);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1240px) {
    .ego-gallery-section {
        height: auto;
        padding: 64px 24px;
    }

    .ego-gallery-container {
        width: 100%;
    }

    .ego-gallery-grid {
        grid-template-columns: repeat(2, 384px);
        grid-template-rows: auto;
        width: auto;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .ego-gallery-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .ego-dataset-card,
    .ego-card-info-surface,
    .ego-card-thumb-wrap {
        width: 100%;
        max-width: 384px;
    }
}

/* ==========================================================================
   Egocentric hero: tablet (design 768px) and mobile (design 390px).
   The base hero is a fixed 1500px box, and the media query meant to reset it ("max-width: 100%;") is invalid CSS.
   ========================================================================== */
@media (max-width: 1023px) {

    /* Same pattern as the other hero pages (e.g. Data Collection): the wrapper has no padding, so the header spans the full width,
       and the hero box carries its own 12px side and bottom gutter. */
    .ego-page-wrapper {
        padding: 0;
        overflow-x: hidden;
    }
    .ego-hero-container {
        width: auto;
        /* margin: 0 12px 12px; */
        height: auto;
        justify-content: flex-start;
    }

    .ego-hero-content-row {
        width: 100%;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
    }

    .ego-hero-left-col {
        width: 100%;
        padding: 32px;
        border-radius: 16px;
    }

    .ego-hero-heading {
        width: 100%;
        font-size: 48px;
        line-height: 52.8px;
        letter-spacing: -0.96px;
    }

    .ego-hero-heading br {
        display: none;
    }

    .ego-hero-description {
        width: min(467px, 100%);
        margin-top: 20px;
    }

    .ego-hero-cta-group {
        width: auto;
        margin-top: 36px;
    }

    .ego-cta-text-pill {
        width: auto;
        padding: 0 16px;
    }

    .ego-hero-right-col {
        width: 100%;
        height: 480px;
        padding: 32px;
        justify-content: flex-start;
    }

    .ego-metadata-row {
        justify-content: flex-start;
        gap: 48px;
        margin-bottom: 0;
    }

    .ego-meta-stack {
        align-items: flex-start;
        text-align: left;
        gap: 24px;
    }

    .ego-meta-val {
        font-size: 32px;
        line-height: 35.2px;
        letter-spacing: -0.64px;
    }

    .ego-meta-lbl {
        font-size: 14px;
        line-height: 19.6px;
        letter-spacing: 0.14px;
    }

    /* Media band sits at the bottom of the metadata box and is clipped by the hero edge */
    .ego-hero-bottom-media {
        position: absolute;
        top: auto;
        bottom: -177px;
        left: -319px;
        transform: none;
        width: 2914px;
        height: 510px;
    }
}

@media (max-width: 767px) {
    .ego-hero-content-row {
        gap: 40px;
    }

    .ego-hero-left-col {
        padding: 12px 8px;
    }

    .ego-hero-heading {
        font-size: 40px;
        line-height: 44px;
        letter-spacing: -0.8px;
    }

    .ego-hero-description {
        margin-top: 24px;
    }

    .ego-hero-cta-group {
        margin-top: 36px;
    }

    .ego-hero-right-col {
        height: 450px;
        padding: 24px 8px;
    }

    .ego-metadata-row {
        gap: 24px;
    }

    .ego-meta-val {
        font-size: 24px;
        line-height: 26.4px;
        letter-spacing: -0.48px;
    }

    .ego-hero-bottom-media {
        bottom: -54px;
        left: -249px;
        width: 2186px;
        height: 382px;
    }
}
/* ==========================================================================
   Egocentric dataset gallery: carousel on tablet (design 768px) and mobile (design 390px).
   Cards scroll sideways; the "Need more datasets" button sits bottom left and the arrows bottom right.
   ========================================================================== */
.ego-gallery-nav {
    display: none;
}

@media (max-width: 1023px) {
    .ego-gallery-section {
        height: auto;
        padding: 36px 36px 56px;
    }

    .ego-gallery-container {
        width: 100%;
        max-width: 1200px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .ego-gallery-grid {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        justify-items: initial;
        gap: 24px;
        width: 100%;
        flex: 0 0 100%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .ego-gallery-grid::-webkit-scrollbar {
        display: none;
    }

    .ego-dataset-card {
        flex: 0 0 384px;
        width: 384px;
        height: 528px;
        scroll-snap-align: start;
    }

    .ego-card-info-surface,
    .ego-card-thumb-wrap {
        width: 100%;
        max-width: none;
    }

    .ego-gallery-cta-row {
        margin-top: 48px;
        justify-content: flex-start;
    }

    .ego-gallery-nav {
        display: flex;
        gap: 4px;
        margin-top: 48px;
    }

    .ego-gallery-nav-btn {
        width: 48px;
        height: 48px;
        border-radius: 9999px;
        background-color: #111111;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: background-color 0.2s ease;
    }

    .ego-gallery-nav-btn:hover {
        background-color: #2a2a2a;
    }

    .ego-gallery-nav-icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .ego-gallery-section {
        padding: 24px 16px;
    }

    .ego-dataset-card {
        flex-basis: 358px;
        width: 358px;
    }

    /* Mobile: arrows and the CTA button each get their own row */
    .ego-gallery-container {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .ego-gallery-grid {
        flex: 0 0 auto;
    }

    .ego-gallery-nav {
        order: 1;
        justify-content: flex-end;
        margin-top: 36px;
    }

    .ego-gallery-cta-row {
        order: 2;
        margin-top: 24px;
        justify-content: flex-start;
    }
}
