/* Explain: Styles for page layout, including header, gallery, and hero animations. */
/* The gallery opens flush under the brand bar like every other section. The
   extra offset that used to sit here stacked on top of the page's own scroll
   padding, which pushed the section — and the initials at the top of the print
   wall — down the screen whenever it was opened from the nav or on load. */
#gallery {
    scroll-margin-top: 0;
    /* The print wall opens on the very black the opening artwork dissolves into,
       then lets that black melt away down the section — so the hero and the
       gallery meet on one continuous dark field instead of a hard seam. */
    background-image: linear-gradient(180deg, #050505 0%, rgba(5, 5, 5, 0.55) 16vh, rgba(5, 5, 5, 0) 38vh);
    background-repeat: no-repeat;
}

/* Opened from the navigation on a phone or tablet, the print wall now settles a
   step higher up the screen: the landing point is drawn above the section's own
   top edge, so the whole opening block — the initials, the heading, the
   statement, and the studio logo beneath it — sits in view together instead of
   the logo falling just past the foot of the screen. Wide screens already hold
   the words and the logo side by side, so they keep their own landing. */
@media (max-width: 1023px) {
    #gallery {
        scroll-margin-top: -3rem;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5rem;
}

.gallery-caption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7.5rem 6.5rem;
    }

    .gallery-item.is-wide {
        grid-column: span 2;
    }
}

/* The brand mark is held small and quiet in the top-left corner of the bar: it
   fills that open space above the copy without ever growing into it, and keeps
   clear air around itself at every screen size. */
.header-logo-wrap {
    position: relative;
    display: block;
    width: 12rem;
    transition: width 320ms ease;
    /* Once the wordmark has been written in from left to right it simply stays
       there, solid and fully lit. The whole mark no longer dips and brightens:
       the gold light that breathes behind it belongs to the moon alone, and the
       moon keeps its own quiet glow exactly as it always did. */
    opacity: 1;
    filter: none;
}

/* The whole-mark breath that used to run here is gone: the wordmark is drawn in
   once and then holds its light. Only the moon behind the lettering keeps a slow
   glow of its own. */

.site-header.is-scrolled .header-logo-wrap {
    width: 8rem;
}

/* On phones and tablets the home page's brand mark is held 15% smaller in the
   bar, so the logo leaves a touch more clear air around itself on a narrow
   screen. The mark still takes its further step down once the page has been
   scrolled, and every other page keeps the size it holds. */
@media (max-width: 1023px) {
    body:has(.hero-intro) .header-logo-wrap {
        width: 10.2rem;
    }

    body:has(.hero-intro) .site-header.is-scrolled .header-logo-wrap {
        width: 6.8rem;
    }
}

.header-logo-mark {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    /* The wordmark is written in rather than simply placed: the mark is held
       behind a soft-edged mask that starts off to the right of the drawing and
       travels leftward, so the letters are laid down from the first stroke on
       the left to the last on the right — the leading edge of the mask reads as
       the tip of a brush moving across the page. Once the mark is complete the
       mask rests fully open, so the logo sits exactly as it always did. */
    -webkit-mask-image: linear-gradient(90deg, #000 0 50%, rgba(0, 0, 0, 0) 56% 100%);
    -webkit-mask-size: 200% 100%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: 130% 0;
    mask-image: linear-gradient(90deg, #000 0 50%, rgba(0, 0, 0, 0) 56% 100%);
    mask-size: 200% 100%;
    mask-repeat: no-repeat;
    mask-position: 130% 0;
    animation: nd-header-logo-draw 1500ms cubic-bezier(0.55, 0.05, 0.25, 1) 200ms both;
    will-change: -webkit-mask-position, mask-position;
}

/* The drawing of the mark: the mask begins with the whole word still hidden to
   the right, then travels steadily leftward so the lettering appears stroke by
   stroke from the left edge to the right, and settles fully open. */
@keyframes nd-header-logo-draw {
    from {
        -webkit-mask-position: 130% 0;
        mask-position: 130% 0;
    }
    to {
        -webkit-mask-position: 0% 0;
        mask-position: 0% 0;
    }
}

/* A visitor who prefers reduced motion meets the mark already written, with no
   sweep across it. */
@media (prefers-reduced-motion: reduce) {
    .header-logo-mark {
        animation: none;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .header-logo-wrap {
        animation: none;
        opacity: 1;
        filter: none;
    }
}

.hero-logo-mark {
    width: 100%;
    max-width: 20rem;
    height: auto;
    object-fit: contain;
    filter: saturate(2.8) contrast(1.08);
    mix-blend-mode: screen;
    -webkit-mask-image: radial-gradient(ellipse 64% 64% at 50% 50%, #000 10%, rgba(0, 0, 0, 0.7) 42%, rgba(0, 0, 0, 0.32) 64%, rgba(0, 0, 0, 0.08) 84%, transparent 100%);
    mask-image: radial-gradient(ellipse 64% 64% at 50% 50%, #000 10%, rgba(0, 0, 0, 0.7) 42%, rgba(0, 0, 0, 0.32) 64%, rgba(0, 0, 0, 0.08) 84%, transparent 100%);
}

@media (min-width: 640px) {
    .hero-logo-mark {
        max-width: 36rem;
    }
}

@media (min-width: 1024px) {
    .hero-logo-mark {
        max-width: 52rem;
    }
}

.scroll-cue {
    display: inline-grid;
    height: 44px;
    width: 44px;
    place-items: center;
    color: var(--accent-color);
    transition: color 220ms ease, transform 220ms ease;
}

.scroll-cue:hover,
.scroll-cue:focus {
    color: var(--accent-hover);
    transform: translateY(2px);
}

/* The scroll cue arrow is a hollow two-stroke chevron pointing down — just two
   hairline lines meeting at an angle — breathing with a soft, slow fade. */
.scroll-cue-arrow {
    display: block;
    width: 1.37rem;
    height: 1.37rem;
    color: var(--accent-color);
    opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(255, 220, 130, 0.9)) drop-shadow(0 0 18px rgba(242, 190, 78, 0.68)) drop-shadow(0 0 34px rgba(228, 160, 20, 0.36));
    animation: nd-cue-fade 2.4s ease-in-out infinite;
    will-change: opacity, filter, transform;
}

@keyframes nd-cue-fade {
    0%,
    100% {
        opacity: 0.55;
        transform: translateY(-2px);
        filter: drop-shadow(0 0 4px rgba(242, 190, 78, 0.6)) drop-shadow(0 0 12px rgba(242, 190, 78, 0.32));
    }
    50% {
        opacity: 1;
        transform: translateY(2px);
        filter: drop-shadow(0 0 9px rgba(255, 214, 90, 0.95)) drop-shadow(0 0 26px rgba(242, 190, 78, 0.75)) drop-shadow(0 0 44px rgba(242, 190, 78, 0.45));
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-cue-arrow {
        animation: none;
        opacity: 0.95;
    }
}

.hero-clouds {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-cloud {
    position: absolute;
    display: block;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.6;
    filter: blur(30px) sepia(1) hue-rotate(178deg) saturate(2.4) contrast(1.4) brightness(0.4);
    -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 42%, transparent 74%);
    mask-image: radial-gradient(70% 70% at 50% 50%, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 42%, transparent 74%);
    transform: translate3d(0, 0, 0) scale(1.04);
    animation: nd-mist-a 9s ease-in-out infinite alternate;
    will-change: transform;
}

.hero-cloud-1 {
    top: -14%;
    left: -20%;
    width: 90%;
    height: 74%;
    opacity: 0.46;
}

.hero-cloud-2 {
    right: -22%;
    bottom: -16%;
    width: 96%;
    height: 78%;
    animation-name: nd-mist-b;
    animation-duration: 12s;
    animation-direction: alternate-reverse;
}

.hero-cloud-3 {
    top: 20%;
    left: 8%;
    width: 82%;
    height: 66%;
    opacity: 0.3;
    animation-name: nd-mist-c;
    animation-duration: 10s;
}

.hero-clouds-front {
    z-index: 20;
}

.hero-clouds-front .hero-cloud {
    opacity: 0.34;
    filter: blur(34px) sepia(1) hue-rotate(178deg) saturate(2.4) contrast(1.4) brightness(0.46);
    -webkit-mask-image: radial-gradient(66% 66% at 50% 50%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.42) 40%, transparent 72%);
    mask-image: radial-gradient(66% 66% at 50% 50%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.42) 40%, transparent 72%);
}

.hero-cloud-4 {
    top: 6%;
    left: -34%;
    width: 92%;
    height: 72%;
    opacity: 0.4;
    animation-name: nd-front-drift-a;
    animation-duration: 28s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: normal;
}

.hero-cloud-5 {
    top: 24%;
    right: -40%;
    width: 86%;
    height: 68%;
    opacity: 0.3;
    animation-name: nd-front-drift-b;
    animation-duration: 36s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: normal;
}

.hero-clouds::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(58% 58% at 50% 50%, rgba(46, 107, 230, 0.08) 0%, transparent 70%),
        radial-gradient(74% 74% at 50% 50%, transparent 22%, rgba(0, 0, 0, 0.92) 100%);
}

.hero-clouds-front::after {
    display: none;
}

@keyframes nd-mist-a {
    0% {
        transform: translate3d(-8%, 5%, 0) scale(1.02) rotate(-2deg);
    }
    50% {
        transform: translate3d(4%, -4%, 0) scale(1.26) rotate(1.2deg);
    }
    100% {
        transform: translate3d(11%, 5.5%, 0) scale(1.1) rotate(-0.8deg);
    }
}

@keyframes nd-mist-b {
    0% {
        transform: translate3d(9%, -5%, 0) scale(1.16) rotate(1.8deg);
    }
    50% {
        transform: translate3d(-4%, 3%, 0) scale(1.02) rotate(-1deg);
    }
    100% {
        transform: translate3d(-11%, -6%, 0) scale(1.22) rotate(0.9deg);
    }
}

@keyframes nd-mist-c {
    0% {
        transform: translate3d(-7%, -6%, 0) scale(1.04) rotate(-1.4deg);
    }
    50% {
        transform: translate3d(5%, 2.5%, 0) scale(1.22) rotate(1.4deg);
    }
    100% {
        transform: translate3d(10%, -5%, 0) scale(1.08) rotate(-0.7deg);
    }
}

@keyframes nd-front-drift-a {
    0% {
        transform: translate3d(0, 0, 0) scale(1.05) rotate(-1.5deg);
        opacity: 0;
    }
    14% {
        opacity: 0.42;
    }
    50% {
        transform: translate3d(84%, 4%, 0) scale(1.24) rotate(1.2deg);
        opacity: 0.4;
    }
    86% {
        opacity: 0.28;
    }
    100% {
        transform: translate3d(168%, -3%, 0) scale(1.1) rotate(-0.6deg);
        opacity: 0;
    }
}

@keyframes nd-front-drift-b {
    0% {
        transform: translate3d(0, 0, 0) scale(1.02) rotate(1.6deg);
        opacity: 0;
    }
    14% {
        opacity: 0.34;
    }
    50% {
        transform: translate3d(-72%, -3%, 0) scale(1.2) rotate(-1.2deg);
        opacity: 0.32;
    }
    86% {
        opacity: 0.2;
    }
    100% {
        transform: translate3d(-152%, 4%, 0) scale(1.08) rotate(0.8deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-cloud {
        animation: none;
    }
}

/* The reel lands clear of the fixed brand bar.

   The section used to be pulled up past the top of the screen when it was
   opened from the navigation, so the small "Studio reel" line that sits above
   the headline ended up tucked behind the bar — half of it cut away and the
   rest showing as a stray scrap at the very top of the view. The section is now
   landed a step lower down the page instead, so that little line is met in
   full, with open air under the bar, and the headline follows beneath it. */
.reel-anchor {
    scroll-margin-top: 2rem;
}

/* The gallery's gold brand line stays hidden on phones so it never crowds the
   gallery heading; it returns from the md breakpoint up. The hero's gold brand
   line above the headline is shown at every screen size. */
.gallery-eyebrow {
    display: none;
}

@media (min-width: 768px) {
    .gallery-eyebrow {
        display: block;
    }
}