/* The existing foreground carries each template's light/dark surface decision.
   Use its green channel to interpolate between bronze on paper and logo gold
   on navy. Explicit bounds keep both ends of each ramp readable. */
@layer artstria-title-ink {
  @media screen and (forced-colors: none) {
    :root {
      --title-shadow: #62441f;
      --title-gold: #805d29;
      --title-light: #86662e;
      --copy-on-navy: #f8f7f4;
    }

    /* Fallback palette for browsers without relative colour support. */
    @supports not (color: rgb(from currentColor r g b)) {
      :where(.as-showcase-copy, .as-slide-copy, .as-about, .as-home-contact,
        .gl-hero, .gl-live, .gl-final, .aj-hotel-card--navy, .gallery-showcase,
        .r76-signature, .r75-trust, .r75-day, .r84-method, .work26-contact,
        .artstria-site-footer, .as-en-dark, .ct-card.navy, [data-r64-tone="dark"]) {
        --title-shadow: #bb935f;
        --title-gold: #cda56a;
        --title-light: #f5dfb1;
      }
    }

    /* Apply the ink to text runs as well as their heading. Animated words
       may paint in their own compositing layer during the existing reveal. */
    :is(h1,h2,h3,h4,h5,h6,[role="heading"],.uni-name),
    :is(h1,h2,h3,h4,h5,h6,[role="heading"],.uni-name) :where(span,em,strong,b,i,a) {
      &:not(:where(.r103-preview *, [contenteditable="true"], [contenteditable="true"] *,
        button *, [role="button"] *, [aria-hidden="true"].icon)) {
        -webkit-text-fill-color: var(--title-gold) !important;
        @supports ((background-clip: text) or (-webkit-background-clip: text)) {
          background-image: linear-gradient(110deg, var(--title-shadow), var(--title-gold) 34%, var(--title-light) 57%, var(--title-gold) 84%) !important;
          background-clip: text !important;
          -webkit-background-clip: text !important;
          -webkit-text-fill-color: transparent !important;
        }
      }
    }

    @supports (color: rgb(from currentColor r g b)) {
      :root {
        --title-shadow: rgb(from currentColor clamp(98, calc((g - 100) * 2 + 98), 187) clamp(68, calc((g - 100) * 2 + 68), 147) clamp(31, calc((g - 100) * 2 + 31), 95));
        --title-gold: rgb(from currentColor clamp(128, calc((g - 100) * 2 + 128), 205) clamp(93, calc((g - 100) * 2 + 93), 165) clamp(41, calc((g - 100) * 2 + 41), 106));
        --title-light: rgb(from currentColor clamp(134, calc((g - 100) * 2 + 134), 245) clamp(102, calc((g - 100) * 2 + 102), 223) clamp(46, calc((g - 100) * 2 + 46), 177));
      }
    }

    /* These copy blocks sit directly on a navy panel. Nested product cards
       and checkout controls keep their own surface colours. */
    :where(.as-showcase-copy, .as-slide-copy, .gl-copy, .gl-live-copy, .gl-final,
      .work26-contact, .r75-trust-top > div, .r75-day-grid > div, .r76-signature .r76-shell,
      .gallery-showcase-header > div, .as-about .wrap, .as-home-contact, .ct-card.navy) > p,
    :where(.as-showcase-copy, .gl-copy, .gl-live-copy) > p > :where(span,em,strong),
    .artstria-site-footer p {
      color: var(--copy-on-navy) !important;
      -webkit-text-fill-color: currentColor !important;
    }
  }
}

@layer artstria-title-ink {
  @media screen and (forced-colors:none) {
    :is(.premium-primary,.as-showcase-primary,.btn-gold,.gallery-showcase-all,
      .gl-primary,.gl-final .r81-cta,.aj-tier .r89-tier-actions .r81-cta,.mq-launch > div > a,.aj-hotel-subscribe,.menu-button:not(.secondary),
      .ck-acc,.work26-contact > a,.r90-hero.r107-dark .r90-primary,
      [data-as-hero=image] .r90-primary,.gl-motion-choices [aria-pressed=true],
      [data-gl-motion-play],.menu-final > a):is(a,button,input,[role=button]) {
      background-color:#cda56a !important;
      background-image:linear-gradient(115deg,#b39a70,#cda56a 32%,#d6b174 60%,#cda56a) !important;
      color:#061f60 !important;
      -webkit-text-fill-color:currentColor !important;
      text-shadow:none;
    }
  }
}

/* Keep the incoming page opaque while the old snapshot dissolves. Native
   history, scrolling and focus continue to work without a navigation script. */
@media (prefers-reduced-motion:no-preference) {
  @view-transition {navigation:auto;}
  ::view-transition-new(root) {animation:none;mix-blend-mode:normal;}
  ::view-transition-old(root) {z-index:1;mix-blend-mode:normal;animation:maison-page-out 160ms ease-out both;}
  @keyframes maison-page-out {to {opacity:0;}}
  html:is(.a63-reduced,.r62-solid)::view-transition-old(root),
  html:has([data-r107-page="checkout"])::view-transition-old(root) {animation:none;opacity:0;}
}
