/* =========================================================
   Susan Yeung — homepage
   Direction: quiet editorial, art-led, asymmetrical
   ========================================================= */

body.page-home main { overflow: clip; }

/* Hero --------------------------------------------------- */

/* NOTE: .container is intentionally NOT redefined here anymore.
   about.php (and every other page) relies on Bootstrap's default
   .container widths/padding from bootstrap.min.css — this page now
   does the same, so hero/intro line up with the rest of the site
   instead of using a bespoke 1400px width. */

/* Right-side pair, corner-touching (sm's bottom-right corner meets
   xs's top-left corner). Sizes/offsets are driven by the custom
   properties on .hero-art-right below so the whole cluster shrinks
   fluidly as the viewport narrows — same layout at every width, just
   smaller, rather than a separate mobile version. */
.hero-art-sm {
    position: absolute;
    top: var(--cluster-top);
    right: var(--cluster-xs);        /* = .hero-art-xs width, so its right edge meets xs's left edge */
    filter: grayscale();
    width: var(--cluster-sm);
    aspect-ratio: 1;
    object-fit: cover;
    opacity: .95;
    z-index: 2;
}

.hero-art-sm:hover {
    filter: grayscale(0%);
}


.hero-art-xs {
    position: absolute;
    right: 0;
    top: calc(var(--cluster-top) + var(--cluster-sm));   /* sm's top + sm's height, so its top edge meets sm's bottom edge */
    filter: grayscale();
    width: var(--cluster-xs);
    aspect-ratio: 1;
    object-fit: cover;
    opacity: .9;
    z-index: 1;
}

.hero-art-xs:hover {
    filter: grayscale(0%);
}

/* 3. Main image — fluid width instead of a fixed 280px cap, so it
   shrinks along with everything else on narrow screens rather than
   forcing the column wider than it has room for. */
.hero-art-main {
    width: 100%;
    max-width: clamp(140px, 45vw, 280px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    /* box-shadow: 0 35px 70px rgba(0,0,0,.38); */
}

/* 4. Scroll label — nudge up slightly off the very edge for breathing room */
.hero-scroll {
    position: absolute;
    right: 0;
    bottom: 70px;
    color: var(--secondaryBg);
}
.hero-scroll:hover {
    color: var(--accent-gold);
}

.hero {
    position: relative;
    height: 100svh;              /* was min-height — fixed height prevents overflow */
    /* display: flex; */
    /* flex-direction: column;
    justify-content: center; */
    /* background: #050605; */
    overflow: hidden;
    padding-top: 5rem;
}

.hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* opacity: .55; */
    z-index: 0;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* background:
        radial-gradient(55% 55% at 50% 20%, rgba(5,6,5,.5), transparent 68%),
        linear-gradient(180deg, rgba(5,6,5,.2) 0%, rgba(5,6,5,.85) 100%); */
}

.hero-inner {
    position: relative;
    z-index: 2;
    flex: 1;                     /* NEW — fills remaining space above the title bar exactly */
    min-height: 0;                /* NEW — required for flex+overflow to actually clip correctly */
    display: grid;

    grid-template-columns:
        minmax(clamp(120px, 25vw, 220px), .3fr)
        minmax(clamp(150px, 40vw, 300px), .6fr)
        minmax(clamp(70px, 14vw, 160px), .3fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: start;
    padding-top: 3rem;
    overflow: hidden;
}

.hero-copy { max-width: 280px; display: flex; flex-direction: column; }
.hero-copy .eyebrow { margin-bottom: 1.4rem; }
.hero-intro { font-size: .88rem; line-height: 1.8; max-width: 30ch; margin: 0 0 1.8rem; }

.hero-art-bl {
    width: clamp(80px, 24vw, 11.6875rem);
    aspect-ratio: 1;
    filter: grayscale(); 
    object-fit: cover; 
    display: block;
    opacity: .85;
}
.hero-art-bl:hover {
    filter: grayscale(0%); 
}

.hero-art { position: relative; text-align: center;}


.hero-art-right {
    position: relative;
    height: 100%;
    /* Feeds .hero-art-sm/.hero-art-xs above. Each maxes out at
       exactly the original desktop value (7.8125rem/8.625rem = 125px/
       138px) and shrinks toward the lower bound as the viewport
       narrows — same corner-touching cluster at every width, not a
       different layout below some breakpoint. */
    --cluster-top: clamp(1rem, 2.5vw, 2rem);
    --cluster-sm: clamp(60px, 15vw, 7.8125rem);
    --cluster-xs: clamp(68px, 17vw, 8.625rem);
}
.hero-title-wrap {
    position: relative;
    z-index: 3;
    background: transparent;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: -6.5rem;
    pointer-events: none;
}

.hero-title-wrap a {
    pointer-events: auto;
}

.hero-title-row {
     transition-delay: 90ms;
    display: block;
    justify-content: center;
    text-align: center;
    background-color: transparent;
    margin: 0 3rem 0 3rem;
    width: auto;
    position: relative;
    min-height: clamp(110px, 14vw, 165px);
    align-items: flex-end;
    padding-top: 0;        /* was 1rem — removes the counter-push so the h1 sits at the top of the band */
    max-width: 100%;
    overflow: hidden;
}

.hero-title-zh {
    position: absolute;
    right: 25%;
    top: 2px;
    font-family: var(--font-zh-display, inherit);
    font-size: clamp(1rem, 1.8vw, 1.6rem);
    color: var(--secondaryBg);
    white-space: nowrap;
}
.hero-title {
    font-size: clamp(5rem, 10vw, 9rem);
    line-height: .82;
    letter-spacing: -.05em;
    white-space: nowrap;
    min-width: 0;
    color: var(--secondaryBg);
}
.hero-title em { 
    font-style: italic; 
    color: var(--secondaryBg); }

.hero { 
    /* max-width: 100%; 
    overflow-x: hidden;  */
    min-height: 100svh;
    padding-bottom: 2rem;
}

/* Superseded — see the active @media (max-width: 900px) block below,
   which now keeps the main image and the sm/xs thumbnail cluster
   side-by-side instead of hiding the cluster. */

@media (max-width: 900px) {
    /* Everything above this point (grid columns, main image, the
       sm/xs cluster) is now fluid via clamp() in the base rules, so
       it no longer needs a separate override here — same layout at
       every width, just smaller. Only the title band still needs an
       explicit switch below, since wrapping text is a discrete
       on/off behaviour clamp() can't express, and the band's
       positioning was tuned specifically for the mobile stack. */
    .hero-copy {
        max-width: 100%;
        text-align: left;
    }

    /* Title band: left-aligned, no background, overlapping bottom of the artwork like the reference */
    .hero-title-wrap {
        margin-top: -3rem;      /* pulls it up to overlap the image edge, not sit in its own strip */
    }

    .hero-title-row {
        margin: 0 1.25rem;
        text-align: left;
        justify-content: flex-start;
        background-color: transparent;
        padding-top: 1rem;
        min-height: auto;
    }

    .hero-title {
        font-size: clamp(3rem, 13vw, 5rem);
        white-space: normal;     /* allow it to wrap/scale instead of forcing nowrap at narrow widths */
    }

    .hero-title-zh {
        position: static;        /* drop out of absolute top-right so it doesn't collide with the big title */
        display: block;
        margin-top: .4rem;
        text-align: left;
    }
}

@media (max-width: 420px) {
   .hero-title-row {
        margin: 0 1rem;
   }
}

/* Intro — "A Journey Through Time" editorial layout ------ */
.intro-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(150px, 260px) minmax(260px, 2fr) minmax(320px, 1.05fr);

    grid-template-areas:
        "heading  heading image"
        "imgsmall copy    image"
        "imgsmall bottom  image";
    column-gap: clamp(1.5rem, 3.4vw, 3.6rem);
    row-gap: clamp(2.2rem, 5vw, 3.6rem);
    align-items: start;
}

.intro-heading { grid-area: heading; }
.intro-heading-left-margin { margin-left: 155px; }
.intro-title { font-size: clamp(2.5rem, 5.2vw, 4.5rem); line-height: .98; letter-spacing: -.03em; }
.intro-title em { font-style: italic; }

.intro-img-small {
    grid-area: imgsmall;
    align-self: start;
    width: 100%;
    max-width: 230px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.intro-copy {
    grid-area: copy;
    align-self: start;
    max-width: 420px;
    padding-top: .4rem;
    text-align: left;
}

.intro-copy p {
    color: var(--ink);
    font-size: .86rem;
    line-height: 1.95;
    margin: 0 0 1.9rem;
}

.intro-img-bottom {
    grid-area: bottom;
    align-self: start;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1.2 / 1;
    object-fit: cover;
    display: block;
    margin-top: 3.5rem;
    margin-left: 30px;
}

.intro-img-large {
    grid-area: image;
    width: 100%;
    height: 100%;
    min-height: clamp(140px, 15vw, 210px);
    max-height: 450px;
    aspect-ratio: .7 / 1;
    object-fit: cover;
    display: block;
    align-self: start;
}

.clip-reveal {
    clip-path: inset(0% 100% 0% 0%);
    transition: clip-path .9s cubic-bezier(.16, 1, .3, 1);
}

.clip-reveal.is-visible { clip-path: inset(0% 0% 0% 0%); }

@media (max-width: 900px) {
    .intro-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "heading" "imgsmall" "copy" "bottom" "image";
    }

    .intro-heading-left-margin { margin-left: 0; }
    .intro-img-small,
    .intro-img-bottom { max-width: 100%; margin-top: 1.5rem; }
}

.intro-heading.reveal,
.intro-copy.reveal {
    opacity: 0;
    transform: translate3d(0, 1.4rem, 0);
    transition: opacity .9s ease, transform .9s ease;
}

.intro-img-small.reveal,
.intro-img-large.reveal {
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
}

.intro-img-small.reveal { transform: translate3d(-2.2rem, 0, 0); }
.intro-img-large.reveal { transform: translate3d(2.2rem, 0, 0); }

.intro-heading.reveal.is-visible,
.intro-copy.reveal.is-visible,
.intro-img-small.reveal.is-visible,
.intro-img-large.reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.intro-copy.reveal { transition-delay: 120ms; }
.intro-img-large.reveal { transition-delay: 90ms; }

/* Reflection of Art -------------------------------------- */
.gallery-preview {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.reflection-heading {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: 0 clamp(1.5rem, 6vw, 6rem);
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
    font-family: var(--font-display);
    font-size: clamp(5.6rem, 10vw, 9.25rem);
    line-height: 1;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.reflection-heading em { font-style: italic; color: var(--accent-gold); }
.reflection-rule {
    flex: 0 1 clamp(2.5rem, 6vw, 6rem);
    min-width: 40px;
    height: 1px;
    background: var(--secondaryBg);
}

/* Auto-playing marquee track: content is rendered twice back-to-back
   in the PHP loop, and the animation slides exactly -50% so the loop
   is seamless — runs continuously, independent of user scroll. */
.reflection-marquee {
    position: relative;
    z-index: 2;
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.reflection-track {
    display: flex;
    align-items: flex-start;
    width: max-content;
    gap: clamp(3rem, 7vw, 6rem);
    animation: reflection-scroll 46s linear infinite;
}
/* Marquee keeps scrolling continuously — hover does NOT pause it,
   it only triggers the background water-ripple effect below. */
@keyframes reflection-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

.reflection-card {
    position: relative;
    flex: 0 0 clamp(210px, 19vw, 300px);
    width: clamp(210px, 19vw, 300px);
    margin-top: var(--card-offset);
}
.reflection-card:nth-child(4n+2) { margin-top: calc(var(--card-offset) * -1); }
.reflection-link { display: block; }
.reflection-card--caption-above .reflection-link {
    display: flex;
    flex-direction: column-reverse;
}
.reflection-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    /* background: #171b17;
    box-shadow: 0 22px 55px rgba(0,0,0,.34); */
}
.reflection-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.10), transparent 35%, rgba(0,0,0,.15));
    pointer-events: none;
}
.reflection-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 1s cubic-bezier(.2,.7,.2,1), filter 1s ease;
}
.reflection-link:hover .reflection-image img { transform: scale(1.045); filter: saturate(1.05); }
.reflection-caption { padding-top: 1rem; }
.reflection-card--caption-above .reflection-caption {
    padding-top: 0;
    padding-bottom: 1rem;
}
.reflection-caption h3 { font-family: var(--font-display); font-size: clamp(1rem,1.35vw,1.2rem); font-weight: 400; line-height: 1.05; margin: 0 0 .45rem; }
.reflection-caption .zh { font-family: var(--font-zh-display); font-size: .82em; color: var(--ink); }
.reflection-caption p { 
    margin: 0; 
    font-size: .62rem; 
    letter-spacing: .055em; 
    line-height: 1.55; 
    color: var(--ink); }

@media (max-width: 991px) {
    .reflection-heading { font-size: clamp(2.4rem, 10vw, 4rem); gap: 1rem; }
    .reflection-track { animation-duration: 34s; gap: 2.5rem; }
    .reflection-card { flex-basis: 58vw; width: 58vw; }
}

@media (max-width: 575px) {
    .reflection-heading { padding: 0 1.25rem; }
    .reflection-card { flex-basis: 72vw; width: 72vw; margin-top: 0 !important; }
    .reflection-track { animation-duration: 26s; }
}

