/* Home-page desktop composition. Mobile artwork and controls retain their styles. */
@media (min-width: 769px) {
    :root {
        --header-logo-desktop-size: 146px;
        --header-logo-zone: 180px;
        --header-logo-overhang: 25px;
        --header-container-width: 1440px;
        --header-side-padding: 32px;
        --header-column-gap: 16px;
        --header-nav-gap: 8px;
        --header-nav-padding: 14px;
        --header-nav-height: 40px;
        --nav-btn-h: clamp(36.4px, calc(36.4px + (100vw - 1280px) * 0.03), 41.2px);
        --cta-btn-h: 44px;
        --nav-left-optical-scale: 1.10;
        --nav-right-optical-scale: 0.99;
        --header-logo-hover-scale: 1.045;
        --header-hover-duration: 280ms;
        --header-glare-duration: 320ms;
        --header-nav-font-size: 11.5px;
        --msg-btn-size: 44px;
    }

    body > header:not(.mobile-header),
    html.pm-page-scrolled body > header:not(.mobile-header).pm-site-header {
        padding: 12px 0 !important;
        position: relative;
        z-index: 60;
        overflow: visible;
    }
    body > header:not(.mobile-header) .header-inner,
    .clay-site-nav > div {
        width: 100%;
        max-width: var(--header-container-width);
        margin-inline: auto;
        padding-inline: var(--header-side-padding);
        box-sizing: border-box;
    }
    body > header:not(.mobile-header) .header-inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) var(--header-logo-zone) minmax(0, 1fr);
        align-items: center;
        gap: 0 var(--header-column-gap) !important;
        min-height: 44px;
    }
    body > header:not(.mobile-header) .header-info {
        grid-area: 1 / 1;
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        justify-self: stretch;
        min-width: 0;
        gap: 2px !important;
        white-space: normal;
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.4;
    }
    body > header:not(.mobile-header) .header-info > .font-medium {
        color: #fffaf3 !important;
        font-weight: 600;
    }
    body > header:not(.mobile-header) .header-hours {
        display: flex;
        flex-direction: row;
        align-items: baseline;
        gap: 7px;
    }
    body > header:not(.mobile-header) .header-hours span {
        margin: 0;
        font-family: inherit;
        font-size: 11.5px;
        font-weight: 500;
        line-height: 1.4;
        color: rgba(255, 250, 243, 0.72) !important;
    }
    body > header:not(.mobile-header) .header-logo {
        grid-area: 1 / 2;
        position: relative;
        display: block;
        width: 100%;
        height: 44px;
        left: auto;
        top: auto;
        transform: none;
        z-index: 1;
    }
    body > header:not(.mobile-header) .header-logo-visual {
        position: absolute;
        display: block;
        top: 0;
        left: 50%;
        width: var(--header-logo-desktop-size) !important;
        height: var(--header-logo-desktop-size) !important;
        transform: translateX(-50%) !important;
        border-radius: 50%;
        transition: transform 320ms cubic-bezier(.22, .61, .36, 1), filter var(--header-hover-duration) ease;
    }
    body > header:not(.mobile-header) .header-logo img {
        position: static;
        display: block;
        width: 100% !important;
        height: 100% !important;
        transform: none !important;
        pointer-events: none;
    }
    body > header:not(.mobile-header) .header-actions {
        grid-area: 1 / 3;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        justify-self: stretch;
        gap: 10px !important;
        min-width: 0;
        white-space: nowrap;
    }
    body > header:not(.mobile-header) .header-phone-desktop {
        flex: none;
        color: #fffaf3 !important;
        font: 600 13px/1.3 'Montserrat', sans-serif;
        text-decoration: none;
        white-space: nowrap;
    }

    .clay-site-nav .top-nav-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--header-logo-zone) minmax(0, 1fr);
        gap: 0 8px;
        align-items: center;
        padding-block: 9px;
    }
    .clay-site-nav .top-nav-list {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: var(--header-nav-gap);
        padding: 0;
        margin: 0;
        min-width: 0;
        list-style: none;
        text-transform: uppercase;
    }
    .clay-site-nav .top-nav-left { justify-content: space-between; }
    .clay-site-nav .top-nav-right { justify-content: space-between; column-gap: 2px; }
    .clay-site-nav .top-nav-logo-gap { min-width: 0; }
    .clay-site-nav .top-nav-list > li { display: block; flex: none; min-width: 0; }

    /* Match the address/action row edges and keep the existing centered logo gap. */
    .clay-site-nav > div { padding-inline: var(--header-side-padding); }
    .header-art-masks { position: absolute; width: 0; height: 0; pointer-events: none; }

    /* PNGs keep their natural ratios; the left set has one shared optical correction. */
    [data-header-button="nav-master-classes"] { --header-button-ratio: 2.49647887; --header-art-mask: url(#header-mask-nav-master-classes); }
    [data-header-button="nav-subscriptions"] { --header-button-ratio: 2.50883392; --header-art-mask: url(#header-mask-nav-subscriptions); }
    [data-header-button="nav-holidays"] { --header-button-ratio: 2.56115108; --header-art-mask: url(#header-mask-nav-holidays); }
    [data-header-button="nav-unusual-mk"] { --header-button-ratio: 2.49300699; --header-art-mask: url(#header-mask-nav-unusual-mk); }
    [data-header-button="msg-vk"] { --header-button-ratio: 1; --header-art-mask: url(#header-mask-msg-vk); }
    [data-header-button="msg-tg"] { --header-button-ratio: 1; --header-art-mask: url(#header-mask-msg-tg); }
    [data-header-button="msg-max"] { --header-button-ratio: 1; --header-art-mask: url(#header-mask-msg-max); }
    [data-header-button="cta-book"] { --header-button-ratio: 2.73161765; --header-art-mask: url(#header-mask-cta-book); }
    [data-header-button="nav-dates"] { --header-button-ratio: 3.4; --header-art-mask: url(#header-mask-nav-dates); }
    [data-header-button="nav-certificates"] { --header-button-ratio: 3.44680851; --header-art-mask: url(#header-mask-nav-certificates); }
    [data-header-button="nav-faq"] { --header-button-ratio: 2.44748858; --header-art-mask: url(#header-mask-nav-faq); }
    [data-header-button="nav-prices"] { --header-button-ratio: 2.36936937; --header-art-mask: url(#header-mask-nav-prices); }
    [data-header-button="nav-about"] { --header-button-ratio: 2.46606335; --header-art-mask: url(#header-mask-nav-about); }
    .nav-image-button { --header-art-h: var(--nav-btn-h); --header-optical-scale: 1; }
    .top-nav-left .nav-image-button { --header-optical-scale: var(--nav-left-optical-scale); }
    .msg-image-button { --header-art-h: var(--msg-btn-size); --header-optical-scale: 1; }
    .cta-image-button { --header-art-h: var(--cta-btn-h); --header-optical-scale: 1; }

    .clay-site-nav .top-nav-list > li > .header-image-button,
    body > header:not(.mobile-header) .header-actions > a.header-image-button[aria-label],
    body > header:not(.mobile-header) .header-booking-btn.header-image-button {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        flex: none;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 999px;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        color: inherit !important;
        overflow: visible;
        cursor: pointer;
        backdrop-filter: none !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }
    /* Beat the shared clay/premium state rules while keeping every hit box stationary. */
    .clay-site-nav .top-nav-list > li > .header-image-button:is(:hover, :active, :focus-visible, .clay-is-pressed),
    body > header:not(.mobile-header) .header-actions > a.header-image-button[aria-label]:is(:hover, :active, :focus-visible, .clay-is-pressed),
    body > header:not(.mobile-header) .header-booking-btn.header-image-button:is(:hover, :active, :focus-visible, .clay-is-pressed) {
        transform: none !important;
        filter: none !important;
        box-shadow: none !important;
    }
    .clay-site-nav .top-nav-list > li > .header-image-button {
        width: calc(var(--header-art-h) * var(--header-button-ratio) * var(--header-optical-scale));
        height: var(--header-nav-height);
    }
    body > header:not(.mobile-header) .header-actions > a.header-image-button[aria-label] {
        width: var(--msg-btn-size) !important;
        height: var(--msg-btn-size) !important;
    }
    body > header:not(.mobile-header) .header-booking-btn.header-image-button {
        width: calc(var(--cta-btn-h) * var(--header-button-ratio));
        height: var(--cta-btn-h);
    }
    .header-button-visual {
        position: relative;
        display: block;
        flex: none;
        width: calc(var(--header-art-h) * var(--header-button-ratio) * var(--header-optical-scale));
        max-width: 100%;
        border-radius: 999px;
        pointer-events: none;
        transform: translateY(0) rotate(0);
        transform-origin: center;
        transition: transform var(--header-hover-duration) ease, filter var(--header-hover-duration) ease;
    }
    .header-image-button .header-button-art {
        display: block;
        width: 100%;
        height: auto;
        flex: none;
        pointer-events: none;
    }
    /* Inline SVG alpha masks reuse the source PNGs, including in file:// previews. */
    .header-button-visual::after,
    .header-logo-visual::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        opacity: 0;
        background-image: linear-gradient(112deg, transparent 43%, rgba(255, 250, 231, .04) 47%,
            rgba(239, 250, 255, .22) 50%, rgba(255, 250, 231, .07) 53%, transparent 57%);
        background-size: 260% 100%;
        background-position: 130% 0;
        background-repeat: no-repeat;
    }
    .header-button-visual::after { mask: var(--header-art-mask); }
    .header-logo-visual::after {
        clip-path: circle(45% at 50% 50%);
        background-image: radial-gradient(ellipse at 22% 30%, transparent 36%,
            rgba(255, 250, 231, .28) 42%, rgba(218, 246, 255, .12) 46%, transparent 52%);
        background-size: 210% 180%;
    }
    .header-image-button .header-button-label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        border: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .clay-site-nav .top-nav-list > li > .header-image-button::before,
    .clay-site-nav .top-nav-list > li > .header-image-button::after,
    body > header:not(.mobile-header) .header-actions > a.header-image-button[aria-label]::before,
    body > header:not(.mobile-header) .header-actions > a.header-image-button[aria-label]::after,
    body > header:not(.mobile-header) .header-booking-btn.header-image-button::before,
    body > header:not(.mobile-header) .header-booking-btn.header-image-button::after {
        content: none !important;
        display: none !important;
        background: none !important;
        box-shadow: none !important;
    }
    .header-image-button .clay-imprint { display: none !important; }
    .clay-site-nav .top-nav-list > li > .header-image-button:focus-visible,
    body > header:not(.mobile-header) .header-actions > a.header-image-button:focus-visible,
    body > header:not(.mobile-header) .header-booking-btn.header-image-button:focus-visible,
    body > header:not(.mobile-header) .header-logo:focus-visible { outline: none; }
    .header-image-button:focus-visible > .header-button-visual,
    .header-logo:focus-visible > .header-logo-visual {
        outline: 2px solid #c8fff3;
        outline-offset: 3px;
    }
    .header-image-button:is(:active, .clay-is-pressed) > .header-button-visual {
        transform: translateY(1px) rotate(0);
        filter: brightness(.98);
    }
    body > header:not(.mobile-header) .header-logo:active > .header-logo-visual {
        transform: translateX(-50%) translateY(1px) !important;
        filter: brightness(.98);
    }
    @media (hover: hover) and (pointer: fine) {
        .header-image-button:hover:not(:active):not(.clay-is-pressed) > .header-button-visual {
            transform: translateY(-2px) rotate(-.4deg);
            filter: brightness(1.025) drop-shadow(0 3px 3px rgba(0, 24, 34, .18));
        }
        .header-image-button:hover:not(:active):not(.clay-is-pressed) > .header-button-visual::after {
            animation: header-art-glare var(--header-glare-duration) ease-out both;
        }
        body > header:not(.mobile-header) .header-logo:hover:not(:active) > .header-logo-visual {
            transform: translateX(-50%) scale(var(--header-logo-hover-scale)) !important;
            filter: brightness(1.025) drop-shadow(0 4px 4px rgba(0, 24, 34, .2));
        }
        .header-logo:hover:not(:active) > .header-logo-visual::after {
            animation: header-logo-glare var(--header-glare-duration) ease-out both;
        }
    }
    @keyframes header-art-glare {
        0% { background-position: 130% 0; opacity: 0; }
        18% { opacity: .9; }
        65% { opacity: .7; }
        100% { background-position: -30% 0; opacity: 0; }
    }
    @keyframes header-logo-glare {
        0% { background-position: 110% 100%; opacity: 0; }
        20% { opacity: .95; }
        65% { opacity: .75; }
        100% { background-position: -10% 0; opacity: 0; }
    }
    @media (prefers-reduced-motion: reduce) {
        .header-button-visual,
        body > header:not(.mobile-header) .header-logo-visual { transition: none; }
        .header-image-button:is(:hover, :active, .clay-is-pressed) > .header-button-visual { transform: none !important; }
        body > header:not(.mobile-header) .header-logo:hover:not(:active) > .header-logo-visual,
        body > header:not(.mobile-header) .header-logo:active > .header-logo-visual {
            transform: translateX(-50%) !important;
        }
        .header-button-visual::after,
        .header-logo-visual::after { animation: none !important; opacity: 0; }
    }
}

@media (min-width: 1280px) {
    /* A 1% optical adjustment leaves breathing room for the five right-hand PNGs. */
    .clay-site-nav .top-nav-right .nav-image-button { --header-optical-scale: var(--nav-right-optical-scale); }
}

@media (min-width: 769px) and (max-width: 1399px) {
    :root { --header-nav-gap: 5px; --header-nav-padding: 10px; --header-side-padding: 24px; }
    body > header:not(.mobile-header) .header-actions { gap: 8px !important; }
}

@media (min-width: 769px) and (max-width: 1279px) {
    :root {
        --header-logo-desktop-size: clamp(112px, calc(112px + (100vw - 820px) * 0.074), 146px);
        --header-logo-zone: calc(var(--header-logo-desktop-size) + 34px);
        --header-column-gap: 12px;
        --header-nav-height: 46px;
        --nav-btn-h: 43px;
        --cta-btn-h: 42px;
        --header-nav-padding: 8px;
        --msg-btn-size: 42px;
    }
    body > header:not(.mobile-header) .header-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 42px) max-content;
        justify-content: end;
        gap: 6px !important;
    }
    body > header:not(.mobile-header) .header-phone-desktop { grid-column: 1 / -1; justify-self: end; }
    body > header:not(.mobile-header) .header-booking-btn { height: 42px; }
    body > header:not(.mobile-header) .header-logo { height: 100%; align-self: stretch; }
    body > header:not(.mobile-header) .header-logo-visual {
        top: auto;
        /* Two nav rows, their gap/padding, header padding and both row borders.
           The artwork's 5% inset keeps the visible medallion 25px over the hero. */
        bottom: calc(-1 * (var(--header-nav-height) * 2 + var(--header-nav-gap)
            + 18px + 12px + 2px + var(--header-logo-overhang)
            + var(--header-logo-desktop-size) * 0.05));
    }
    .clay-site-nav .top-nav-left { display: grid; grid-template-columns: repeat(2, max-content); justify-content: space-between; }
    .clay-site-nav .top-nav-right { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .clay-site-nav .top-nav-right > li:nth-child(1) { grid-area: 1 / 1 / 2 / 4; }
    .clay-site-nav .top-nav-right > li:nth-child(2) { grid-area: 1 / 4 / 2 / 7; }
    .clay-site-nav .top-nav-right > li:nth-child(3) { grid-area: 2 / 1 / 3 / 3; }
    .clay-site-nav .top-nav-right > li:nth-child(4) { grid-area: 2 / 3 / 3 / 5; }
    .clay-site-nav .top-nav-right > li:nth-child(5) { grid-area: 2 / 5 / 3 / 7; }
    .clay-site-nav .top-nav-list > li > .header-image-button { width: 100%; }
    .clay-site-nav .top-nav-left > li > .header-image-button {
        width: calc(var(--header-art-h) * var(--header-button-ratio) * var(--header-optical-scale));
    }
}

@media (min-width: 769px) and (max-width: 1000px) {
    :root { --header-side-padding: 16px; --header-column-gap: 8px; --header-nav-font-size: 10.5px; --header-nav-padding: 6px; }
    :root { --nav-btn-h: clamp(38.5px, calc(38.5px + (100vw - 769px) * 0.049), 41px); --header-nav-height: 44px; }
    .clay-site-nav .top-nav-right { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .clay-site-nav .top-nav-right > li:nth-child(1) { grid-area: 1 / 1 / 2 / 4; }
    .clay-site-nav .top-nav-right > li:nth-child(2) { grid-area: 1 / 4 / 2 / 7; }
    .clay-site-nav .top-nav-right > li:nth-child(3) { grid-area: 2 / 1 / 3 / 3; }
    .clay-site-nav .top-nav-right > li:nth-child(4) { grid-area: 2 / 3 / 3 / 5; }
    .clay-site-nav .top-nav-right > li:nth-child(5) { grid-area: 2 / 5 / 3 / 7; }
}

/* Widen only the four left PNGs; their vertical scale and all hover rules stay intact. */
@media (min-width: 769px) {
    .clay-site-nav .top-nav-left { --left-nav-width-scale: 1.18; }
    .clay-site-nav .top-nav-left > li > .nav-image-button,
    .clay-site-nav .top-nav-left .nav-btn-visual {
        width: calc(var(--header-art-h) * var(--header-button-ratio)
            * var(--header-optical-scale) * var(--left-nav-width-scale));
    }
    .clay-site-nav .top-nav-left .nav-btn-visual {
        height: calc(var(--header-art-h) * var(--header-optical-scale));
    }
    .clay-site-nav .top-nav-left .header-button-art { height: 100%; }
}
