body {
    font-family: "Inter", sans-serif;
    font-size: 12px;
    letter-spacing: -0.025em;
    min-width: 320px;
}
input, optgroup, select, textarea {
    font-weight: 300 !important;
}
.header {
    z-index: 9999;
}
.header::before,
.header::after {
    content: '';
    position: absolute;
    inset: 0;
    height: calc(100% + 24px);
    pointer-events: none;
}

.header::before {
    z-index: 0;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.6) 0%,
        rgba(255,255,255,0) 100%
    );

    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 60%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 60%,
        transparent 100%
    );
}

.header::after {
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.85) 0%,
        rgba(255,255,255,0) 100%
    );
}
.header-inner {
    position: relative;
    z-index: 2;
}

/* Main masthead: serif first name + sans surname (approx. Caslon / Helvetica pairing) */
.site-title {
    text-transform: uppercase;
    color: #352948;
}
.site-title-link {
    color: inherit;
    text-decoration: none;
}
.site-title-link:hover {
    opacity: 0.9;
}
.site-title-serif {
    font-family: "Libre Caslon Text", serif;
    font-weight: 400;
    letter-spacing: -0.025em;
}
.site-title-sans {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
}
.site-title-gap {
    font-weight: 400;
    letter-spacing: 0;
}

/* Grid view: subtle per-card frame ratios (paired with PHP/JS hash on record id) */
.portfolio-grid-frame {
    aspect-ratio: 1 / 1;
}

#artGrid[data-cols="1"] .portfolio-grid-frame {
    aspect-ratio: auto;
}

.portfolio-image-loader {
    position: relative;
}

.portfolio-image-loader::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 1px solid rgba(53, 41, 72, 0.18);
    border-top-color: rgba(53, 41, 72, 0.75);
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    animation: artwork-loader-spin 720ms linear infinite;
    z-index: 1;
}

.portfolio-image-loader.portfolio-image-loading::after {
    opacity: 1;
}

/* Masonry view is a simple multi-column stack with 20px gutters. */
.portfolio-masonry-batch {
    margin-bottom: 20px;
}

.portfolio-masonry-batch:last-child {
    margin-bottom: 0;
}

#artGrid[data-view-mode="masonry"] article {
    margin-bottom: 20px;
}

#artGrid[data-view-mode="masonry"] article:last-child {
    margin-bottom: 0;
}

#artGrid[data-view-mode="masonry"] .js-open-artwork img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

#artGrid article {
    transform-origin: center;
}

#artGrid article.portfolio-tile-scatter-in {
    animation: portfolio-tile-scatter-in 2000ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--scatter-delay, 0ms);
}

#artGrid article.portfolio-tile-scatter-out {
    animation: portfolio-tile-scatter-out 320ms ease-out both;
    animation-delay: var(--scatter-delay, 0ms);
    pointer-events: none;
}

@keyframes portfolio-tile-scatter-in {
    from {
        opacity: 0;
        transform: translate(var(--scatter-x, 18px), var(--scatter-y, 14px)) scale(0.965);
    }

    to {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

@keyframes portfolio-tile-scatter-out {
    from {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    to {
        opacity: 0;
        transform: translate(0, 0) scale(1);
    }
}

/* Grid ↔ masonry: blur + fade on full navigation */
.portfolio-grid-stage--from-switch {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(10px) scale(0.992);
}

.portfolio-grid-stage--from-switch.portfolio-grid-stage--animate-in {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
    transition:
        opacity 0.42s ease,
        filter 0.52s ease,
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-grid-stage--out {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(10px) scale(0.988);
    transition:
        opacity 0.3s ease,
        filter 0.36s ease,
        transform 0.3s ease;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-grid-stage--from-switch,
    .portfolio-grid-stage--from-switch.portfolio-grid-stage--animate-in,
    .portfolio-grid-stage--out,
    #artGrid article.portfolio-tile-scatter-in,
    #artGrid article.portfolio-tile-scatter-out {
        animation: none !important;
        transition: none !important;
        filter: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
}

body.drawer-open {
    overflow: hidden;
}

/* Contact drawer: minimal underline fields, centred */
.contact-drawer-head {
    flex-shrink: 0;
    background: #fff;
}

.contact-drawer-head button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    text-transform: lowercase;
}

.contact-drawer-scroll {
    -webkit-overflow-scrolling: touch;
}

.contact-drawer-form {
    max-width: 22rem;
    margin: 0 auto;
}

.contact-field {
    margin-bottom: 2rem;
    text-align: center;
}

.contact-label {
    display: block;
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 300;
    color: #000;
    margin-bottom: 0.4rem;
}
.contact-input {
    width: 100%;
    max-width: 19rem;
    margin: 0 auto;
    display: block;
    border: 0;
    border-bottom: 1px solid #000;
    background: transparent;
    text-align: center;
    padding: 0.4rem 0;
    font-family: "Inter", sans-serif;
    font-size: 0.875rem;
    font-weight: 300;
    color: #000;
    outline: none;
}

.contact-input:focus, .contact-textarea:focus {
    border-bottom-color: #352948;
}

.contact-check-grid {
    border: 0;
    margin: 0 auto 2.25rem;
    padding: 0;
    max-width: 20rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.25rem;
    font-family: "Inter", sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    color: #3f3f46;
}

.contact-check {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    text-align: left;
    line-height: 1.5;
    cursor: pointer;
}

.contact-check input {
    margin: 0.15rem 0 0;
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
    accent-color: #352948;
}

.contact-textarea {
    width: 100%;
    max-width: 19rem;
    margin: 0 auto;
    display: block;
    min-height: 8.5rem;
    border: 1px solid #18181b;
    background: #fff;
    padding: 0.75rem 0.85rem;
    font-family: "Inter", sans-serif;
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.5;
    color: #18181b;
    resize: vertical;
    outline: none;
}

.contact-send-wrap {
    text-align: center;
    margin-top: 1.75rem;
}

.contact-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.contact-form-status {
    margin-top: 1.25rem;
    text-align: center;
    font-family: "Inter", sans-serif;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.contact-form-status.is-error {
    color: #b91c1c;
}

.contact-form-status.is-success {
    color: #15803d;
}

/* Exhibitions drawer */
.exhibitions-drawer-head {
    flex-shrink: 0;
    background: #fff;
}

.exhibitions-drawer-head button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    text-transform: lowercase;
}

.exhibitions-drawer-scroll {
    -webkit-overflow-scrolling: touch;
}

.exhibitions-empty {
    max-width: 28rem;
    margin: 2rem auto 0;
    text-align: center;
    font-family: "Inter", sans-serif;
    font-size: 0.875rem;
    color: #71717a;
}

.drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(92vh, 820px);
    height: calc(100% - 105px);
    background: #fff;
    transform: translateY(110%);
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 80;
    display: flex;
    flex-direction: column;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.drawer.open {
    transform: translateY(0);
}

.drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.4rem 0.8rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 15;
    background: #fff;
}

.drawer-head button {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #6b7280;
    font-family: "Inter", sans-serif;
}

/* My Collection drawer: centered mixed-font title (matches masthead pairing) + pill actions */
#collectionDrawer .collection-drawer-head {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    text-align: center;
}

#collectionDrawer .collection-drawer-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    text-transform: lowercase;
    font-family: "Inter", sans-serif;
}

.serif {
    font-family: "Libre Caslon Text", serif;
}
.sans {
    font-family: "Inter", sans-serif;
}

#collectionDrawer .collection-drawer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#collectionDrawer .collection-drawer-actions[hidden] {
    display: none;
}

button.collection-drawer-pill {
    gap: 0.4rem;
    border: 0;
    font-family: "Inter", sans-serif;
    line-height: 1.25;
    cursor: pointer;
}

button.collection-drawer-pill:hover {
    color: #18181b;
}

.collection-drawer-pill-glyph {
    font-size: 0.85em;
    line-height: 1;
    opacity: 0.85;
}

.collection-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

#collectionDrawer .collection-list {
    margin-left: auto;
    margin-right: auto;
}

.collection-empty-hint {
    text-align: center;
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    color: #71717a;
    padding: 1rem 0.5rem;
}

.collection-row {
    display: grid;
    grid-template-columns: 50px minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 1.1fr) auto;
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.collection-row[data-artwork] {
    cursor: pointer;
}

.collection-row[data-artwork] .collection-cell-remove,
.collection-row[data-artwork] a.remove {
    cursor: pointer;
}

.collection-cell-thumb img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

.collection-name {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #000;
    line-height: 1.25;
}

.collection-type {
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 300;
    font-style: italic;
    color: #000;
    line-height: 1.3;
}

.collection-status {
    font-family: "Inter", sans-serif;
    font-size: 12px;
    color: #000;
    line-height: 1.3;
}

#collectionDrawer .collection-row .remove {
    border: 0;
    text-decoration: none;
    font-family: "Inter", sans-serif;
    white-space: nowrap;
}

#collectionDrawer .collection-row .remove:hover {
    color: #18181b;
}

@media (max-width: 899px) {
    .collection-row {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 0.5rem 0.5rem;
    }
    .collection-row > :nth-child(n + 3) {
        grid-column: 2;
    }
}

/* Artwork drawer: fixed top bar (no gap when scrolling); content scrolls below */
#artworkDrawer .artwork-drawer-head {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 25;
}

#artworkDrawer .artwork-drawer-scroll {
    flex: 0 0 auto;
    overflow: visible;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

.artwork-mainimg-layer {
    transition: opacity 180ms ease;
    pointer-events: none;
}

#artworkImageStage::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 1px solid rgba(53, 41, 72, 0.18);
    border-top-color: rgba(53, 41, 72, 0.75);
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    animation: artwork-loader-spin 720ms linear infinite;
}

#artworkImageStage.artwork-image-stage-loading::after {
    opacity: 1;
}

@keyframes artwork-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.artwork-mainimg-visible {
    opacity: 1;
}
.artwork-mainimg-hidden {
    opacity: 0;
}

.artwork-action-row {
    padding: 1.25rem 2rem 1rem;
    display: flex;
    justify-content: center;
    background: #fff;
}

/* Side drawers (Filter / Sort) */
.side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 75;
    transition: 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    visibility: hidden;
    opacity: 0;
}

.side-overlay.open {
    visibility: visible;
    opacity: 1;
}

.side-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(92vw, 360px);
    background: #3a2b45;
    color: #fff;
    z-index: 80;
    overflow: auto;
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    transform: translateX(-110%);
}

.side-drawer-head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #3a2b45;
}

.side-drawer-left {
    left: 0;
}

.side-drawer-right {
    right: 0;
    left: auto;
    transform: translateX(110%);
}

.side-drawer.open {
    transform: translateX(0);
}

.portfolio-size-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 2.25rem;
    padding: 0 0.65rem 0 0.75rem;
    cursor: default;
}
.portfolio-size-pill input[type="range"] {
    width: 100%;
    height: 3px;
    margin: 0;
    background: #352948;
    accent-color: #352948;
    vertical-align: middle;
    cursor: grab;
    border-color: #352948;
}

#colSizeSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent; 
}

/* Track */
#colSizeSlider::-webkit-slider-runnable-track {
    height: 2px;
    background: #352948;
    border-radius: 999px;
}

/* Thumb */
#colSizeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #352948;
    margin-top: -5px;
    cursor: grab;
}

/* Firefox track */
#colSizeSlider::-moz-range-track {
    height: 2px;
    background: #352948;
    border-radius: 999px;
}

/* Firefox thumb */
#colSizeSlider::-moz-range-thumb {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #352948;
    border: none;
    cursor: pointer;
}

#colSizeSlider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}
#colSizeSlider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

button.rounded-full:hover, .button.rounded-full:hover, a.rounded-full:hover {
    background: #352948 !important;
    color: #fff !important;
}

@media (max-width: 639px) {
    
    .hide-mobile {
        display: none !important;
    }
    
}

@media (min-width: 640px) {
    
    .header::before,
    .header::after {
        height: 110px;
    }
    
    .site-logo-animation,
    .header-large-overwrite {
        will-change: transform;
        backface-visibility: hidden;
        transform-style: preserve-3d;
        transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    body.header-compact .site-logo-animation {
        transform: translate3d(0, -68px, 0) scale(0.3);
    }
    body.header-compact .header-large-overwrite {
        transform: translate3d(0, -100px, 0);
    }
    
    .header {
        pointer-events: none;
    }
    .header nav, .site-logo-animation, .header-large-overwrite {
        pointer-events: all;
    }
    
}
