/* =========================================================================
   Quiet Light on Canvas — museum-style one-pager
   Palette inspired by gallery walls: warm parchment, deep ink, brass accent.
   ========================================================================= */

:root {
    --bg: #f4efe6;          /* parchment / gallery wall */
    --bg-deep: #ebe4d6;     /* slightly deeper section */
    --ink: #1a1714;         /* near-black text */
    --ink-soft: #4a423a;    /* secondary text */
    --ink-mute: #8a8076;    /* small print */
    --rule: #c8bfae;        /* hairline rules */
    --brass: #a98a4b;       /* accent: muted brass / aged gold */
    --shadow: 0 30px 60px -20px rgba(26, 23, 20, 0.35),
              0 12px 24px -12px rgba(26, 23, 20, 0.25);
    --shadow-soft: 0 18px 40px -18px rgba(26, 23, 20, 0.28);
    --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --max-w: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* very subtle paper grain to evoke a printed catalogue */
    background-image:
        radial-gradient(circle at 20% 0%, rgba(255,255,255,0.5), transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(168, 138, 75, 0.06), transparent 50%);
    background-attachment: fixed;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* =========================================================================
   Curtain (opening loader)
   ========================================================================= */
.curtain {
    position: fixed; inset: 0; z-index: 200;
    background: var(--ink);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 1.2s var(--ease), visibility 1.2s var(--ease);
}
.curtain.is-lifted { opacity: 0; visibility: hidden; }

.curtain__inner {
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.curtain__mark {
    font-family: var(--serif);
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--bg);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.02em;
}
.curtain__line {
    display: block; width: 1px; height: 0;
    background: var(--brass);
    animation: curtainLine 1.2s var(--ease) 0.2s forwards;
}
@keyframes curtainLine { to { height: 80px; } }

/* =========================================================================
   Top bar
   ========================================================================= */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem clamp(1.5rem, 4vw, 3rem);
    background: rgba(244, 239, 230, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
}
.topbar.is-scrolled {
    background: rgba(244, 239, 230, 0.88);
    border-bottom-color: var(--rule);
}
.topbar__brand { display: flex; align-items: center; gap: 0.85rem; }
.topbar__monogram {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.45rem;
    color: var(--ink);
    line-height: 1;
}
.topbar__divider {
    width: 1px; height: 18px; background: var(--rule);
}
.topbar__title {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}
@media (max-width: 720px) {
    .topbar__title { font-size: 0.62rem; letter-spacing: 0.16em; }
}
@media (max-width: 420px) {
    .topbar__title,
    .topbar__divider { display: none; }
}
.topbar__nav { display: flex; gap: 2rem; }
.topbar__nav a {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.3s var(--ease);
}
.topbar__nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
    height: 1px; background: var(--brass);
    transform: scaleX(0); transform-origin: left center;
    transition: transform 0.4s var(--ease);
}
.topbar__nav a:hover { color: var(--ink); }
.topbar__nav a:hover::after { transform: scaleX(1); }

@media (max-width: 640px) {
    .topbar__nav { display: none; }
}

/* =========================================================================
   Scroll progress
   ========================================================================= */
.progress {
    position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
    background: transparent;
    pointer-events: none;
}
.progress span {
    display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, transparent, var(--brass));
    transition: width 0.1s linear;
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center;
    padding: 8rem clamp(1.5rem, 4vw, 3rem) 6rem;
    position: relative;
    overflow: hidden;
}
.hero::before,
.hero::after {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    width: 1px; background: var(--rule);
}
.hero::before { top: 6rem; height: 4rem; }
.hero::after  { bottom: 0; height: 4rem; }

.hero__meta {
    font-size: 0.72rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 1s var(--ease) 0.4s forwards;
}

/* Artist name: the centre of gravity of the hero */
.hero__artist-name {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 8vw, 5.75rem);
    line-height: 1.02;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 1.25rem;
    opacity: 0;
    animation: fadeUp 1.1s var(--ease) 0.55s forwards;
}
.hero__artist-first {
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.005em;
    color: var(--brass);
}
.hero__artist-last {
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78em;
    margin-top: 0.1em;
}

.hero__rule {
    width: 64px; height: 1px;
    background: var(--rule);
    margin: 1.5rem 0 2rem;
    opacity: 0;
    animation: fadeUp 1s var(--ease) 0.75s forwards;
}

.hero__title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2rem, 5.5vw, 4.25rem);
    line-height: 1.05;
    letter-spacing: 0.005em;
    margin: 0;
    color: var(--ink-soft);
    text-align: center;
}
.hero__title-line {
    display: block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1.1s var(--ease) forwards;
}
.hero__title-line:nth-child(1) { animation-delay: 0.95s; }
.hero__title-line:nth-child(2) { animation-delay: 1.10s; }
.hero__title-line:nth-child(3) { animation-delay: 1.25s; }
.hero__title-line--accent em {
    font-style: italic;
    font-weight: 400;
    color: var(--ink);
}

.hero__dates {
    margin-top: 2.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    color: var(--ink-mute);
    opacity: 0;
    animation: fadeUp 1s var(--ease) 1.5s forwards;
}

.hero__scroll {
    position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 0.85rem;
    font-size: 0.65rem; letter-spacing: 0.4em; text-transform: uppercase;
    color: var(--ink-soft);
    opacity: 0;
    animation: fadeUp 1s var(--ease) 1.6s forwards;
}
.hero__scroll-line {
    width: 1px; height: 40px; background: var(--ink-soft);
    position: relative; overflow: hidden;
}
.hero__scroll-line::after {
    content: ""; position: absolute; top: -100%; left: 0; width: 100%; height: 100%;
    background: var(--brass);
    animation: scrollPulse 2.4s var(--ease) infinite;
}
@keyframes scrollPulse {
    0%   { top: -100%; }
    60%  { top: 100%; }
    100% { top: 100%; }
}

@keyframes fadeUp {
    to { opacity: 1; transform: none; }
}

/* =========================================================================
   Statement
   ========================================================================= */
.statement {
    max-width: 720px;
    margin: 0 auto;
    padding: 8rem clamp(1.5rem, 4vw, 2rem) 6rem;
    text-align: center;
}
.statement__label {
    font-size: 0.68rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 2rem;
}
.statement__body {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    line-height: 1.55;
    color: var(--ink);
    margin: 0 0 1.5rem;
}
.statement__body--small {
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    color: var(--ink-soft);
    font-style: italic;
}

/* =========================================================================
   Gallery
   ========================================================================= */
.gallery {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 4rem clamp(1.5rem, 4vw, 3rem) 6rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 3vw, 2.5rem);
}

/* Each plate is a small museum object label + the painting itself */
.plate {
    position: relative;
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.plate.is-visible { opacity: 1; transform: none; }

.plate__frame {
    position: relative;
    background: #ffffff;
    padding: clamp(1rem, 2vw, 1.5rem);
    box-shadow: var(--shadow);
    cursor: zoom-in;
    overflow: hidden;
    transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.plate__frame::before {
    /* inner mat: a hairline reveal between mat and image */
    content: ""; position: absolute; inset: clamp(0.6rem, 1.2vw, 1rem);
    border: 1px solid rgba(26, 23, 20, 0.08);
    pointer-events: none;
}
.plate__frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 40px 80px -20px rgba(26,23,20,0.45),
                0 18px 32px -16px rgba(26,23,20,0.3);
}
.plate__img-wrap {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #efe9dc, #ddd4c2);
    aspect-ratio: 4 / 5;
}
.plate__img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 1.4s var(--ease), filter 1.4s var(--ease);
    filter: saturate(0.96);
}
.plate__frame:hover .plate__img {
    transform: scale(1.04);
    filter: saturate(1.05);
}

/* Loupe glyph on hover, hinting that the painting opens */
.plate__loupe {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(244, 239, 230, 0.92);
    color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif);
    font-size: 1.4rem;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
    pointer-events: none;
    box-shadow: var(--shadow-soft);
}
.plate__frame:hover .plate__loupe {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Object label below the painting: only a quiet plate number */
.plate__label {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.75rem;
    padding-top: 1rem;
    position: relative;
}
.plate__label::before,
.plate__label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
    max-width: 80px;
}
.plate__plate-no {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--brass);
    letter-spacing: 0.06em;
}

/* Compositional rhythm: alternate plate widths and offsets to evoke a
   curated wall hang rather than a uniform grid. */
.plate--full   { grid-column: span 12; }
.plate--wide   { grid-column: span 8; }
.plate--narrow { grid-column: span 4; }
.plate--half   { grid-column: span 6; }

.plate--offset-down { margin-top: clamp(2rem, 6vw, 5rem); }

.plate--hero .plate__img-wrap { aspect-ratio: 16 / 9; }
.plate--portrait .plate__img-wrap { aspect-ratio: 3 / 4; }
.plate--square .plate__img-wrap { aspect-ratio: 1 / 1; }

@media (max-width: 900px) {
    .plate--full,
    .plate--wide,
    .plate--narrow,
    .plate--half { grid-column: span 12; }
    .plate--offset-down { margin-top: 0; }
}

/* Image not-yet-loaded placeholder */
.plate__img-wrap::after {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(26,23,20,0.04) 0,
        rgba(26,23,20,0.04) 10px,
        rgba(26,23,20,0.02) 10px,
        rgba(26,23,20,0.02) 20px
    );
    opacity: 1;
    transition: opacity 0.6s var(--ease);
    pointer-events: none;
}
.plate__img-wrap.is-loaded::after { opacity: 0; }

/* =========================================================================
   Closing
   ========================================================================= */
.closing {
    text-align: center;
    padding: 6rem clamp(1.5rem, 4vw, 2rem) 4rem;
}
.closing__rule {
    width: 80px; height: 1px; background: var(--brass);
    margin: 0 auto 2rem;
}
.closing__text {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--ink);
    margin: 0 0 0.5rem;
}
.closing__sub {
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* =========================================================================
   Colophon
   ========================================================================= */
.colophon {
    background: var(--bg-deep);
    border-top: 1px solid var(--rule);
    padding: 3rem clamp(1.5rem, 4vw, 3rem);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 100%;
}
.colophon__label {
    font-size: 0.65rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 0.5rem;
}
.colophon__value {
    font-family: var(--serif);
    font-size: 1.1rem;
    color: var(--ink);
}
@media (max-width: 700px) {
    .colophon { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================================
   Lightbox (single-painting viewing room)
   ========================================================================= */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(12, 10, 9, 0.94);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
    padding: clamp(2rem, 6vw, 4rem);
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__stage {
    margin: 0;
    max-width: 92vw;
    max-height: 88vh;
    display: flex; flex-direction: column; align-items: center;
    gap: 1.25rem;
    transform: scale(0.98);
    opacity: 0;
    transition: transform 0.6s var(--ease) 0.1s, opacity 0.6s var(--ease) 0.1s;
}
.lightbox.is-open .lightbox__stage { transform: scale(1); opacity: 1; }

.lightbox__img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    box-shadow: 0 40px 80px -10px rgba(0,0,0,0.6);
    background: #fff;
}

.lightbox__caption {
    color: rgba(244, 239, 230, 0.85);
    text-align: center;
    display: flex; flex-direction: column; gap: 0.25rem;
}
.lightbox__plate {
    font-family: var(--serif);
    font-style: italic;
    color: var(--brass);
    font-size: 1rem;
    letter-spacing: 0.06em;
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    background: transparent;
    border: 1px solid rgba(244, 239, 230, 0.25);
    color: rgba(244, 239, 230, 0.85);
    cursor: pointer;
    font-family: var(--serif);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.lightbox__close:hover,
.lightbox__nav:hover {
    background: rgba(244, 239, 230, 0.08);
    border-color: rgba(244, 239, 230, 0.55);
    color: #fff;
}

.lightbox__close {
    top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem);
    width: 44px; height: 44px;
    font-size: 1.6rem;
    line-height: 1;
    border-radius: 50%;
}

.lightbox__nav {
    top: 50%; transform: translateY(-50%);
    width: 56px; height: 56px;
    font-size: 1.8rem;
    border-radius: 50%;
}
.lightbox__nav--prev { left: clamp(1rem, 3vw, 2.5rem); }
.lightbox__nav--next { right: clamp(1rem, 3vw, 2.5rem); }

@media (max-width: 600px) {
    .lightbox__nav { width: 44px; height: 44px; font-size: 1.4rem; }
}

/* Reduced motion: keep the gallery still and dignified */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .plate { opacity: 1; transform: none; }
}
