:root {
  --bg: #f6f3ee;
  --ink: #1d1b19;
  --muted: #7a736b;
  --accent: #9c4a2f;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
a { color: inherit; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: .9rem clamp(1rem, 4vw, 3rem); background: rgba(246, 243, 238, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid #e3ddd3;
}
.brand { font-family: var(--serif); font-size: 1.2rem; text-decoration: none; letter-spacing: .02em; }
.header-menu { display: flex; align-items: center; }
.top nav a { margin-left: 1.5rem; text-decoration: none; font-size: .9rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.top nav a:hover { color: var(--accent); }
.language-switch { display: flex; gap: .25rem; margin-left: 1rem; }
.language-switch a { font: inherit; font-size: .8rem; padding: .25rem .5rem; border: 1px solid #cfc7bb; border-radius: .25rem; background: transparent; color: var(--muted); text-decoration: none; }
.language-switch a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.menu-toggle { display: none; }

.hero { position: relative; height: 85vh; min-height: 420px; display: grid; place-items: center; text-align: center; background: #111; overflow: hidden; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; user-select: none; }
.hero-text { position: relative; padding: 2rem 3rem; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.7); pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,.75), rgba(0,0,0,.4) 55%, transparent 72%); }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 7vw, 4.5rem); margin: 0; }
.hero p { color: #e8e2d8; font-style: italic; font-family: var(--serif); font-size: 1.15rem; }
.hero-text { transition: opacity .35s; }
.hero-loader { position: absolute; inset: 0; display: grid; place-items: center; background: #111; transition: opacity .6s, visibility .6s; z-index: 2; }
.hero-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.spinner { width: 3rem; height: 3rem; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-text.is-hidden { opacity: 0; }
.hero-controls { position: absolute; top: 1rem; right: 1rem; display: flex; gap: .5rem; z-index: 2; }
.hero-controls button { display: flex; align-items: center; gap: .45rem; padding: .5rem .85rem; font: inherit; font-size: .85rem; color: #fff; background: rgba(20,20,22,.6); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); }
.hero-controls button:hover { background: rgba(20,20,22,.85); }
.hero-controls svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.hero-controls .ic-slash { display: none; stroke: currentColor; stroke-width: 2.2; fill: none; }
.hero-controls [aria-pressed="true"] .ic-slash { display: block; }
.hero-controls .ic-play { display: none; }
#btn-pause[aria-pressed="true"] .ic-play { display: block; }
#btn-pause[aria-pressed="true"] .ic-pause { display: none; }
.hero-hint { position: absolute; left: 1rem; bottom: 1rem; z-index: 2; display: flex; align-items: center; gap: .6rem; padding: .5rem .9rem .5rem .7rem; color: #fff; font-size: .9rem; background: rgba(20,20,22,.6); border-radius: 999px; backdrop-filter: blur(6px); pointer-events: none; }
.hero-hint svg { width: 1.6rem; height: 1.6rem; fill: #fff; stroke: #222; stroke-width: .8; transform-origin: 50% 20%; animation: hint-tap 1.6s ease-in-out infinite; }
@keyframes hint-tap { 0%, 55%, 100% { transform: translateY(0) scale(1); } 25% { transform: translateY(3px) scale(.88); } }
@media (prefers-reduced-motion: reduce) { .hero-hint svg { animation: none; } }
@media (max-width: 560px) { .hero-controls span { display: none; } .hero-hint { font-size: .8rem; } }

main { max-width: 1400px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
#gallery-heading { text-align: center; font-family: var(--serif); font-weight: 400; margin: 2rem 0 0; }

.filters { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin: 1rem 0 2rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; }
.filter-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; margin-right: .25rem; }
.filters button {
  font: inherit; font-size: .85rem; padding: .35rem 1rem; border: 1px solid #cfc7bb; border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer; transition: .2s;
}
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Masonry: columns keep each painting's true aspect ratio, so mixed sizes sit together naturally */
.grid { columns: 3 280px; column-gap: 1.5rem; }
.card { break-inside: avoid; margin: 0 0 1.5rem; cursor: zoom-in; background: none; border: 0; padding: 0; display: block; width: 100%; text-align: left; font: inherit; color: inherit; text-decoration: none; }
.card .frame { overflow: hidden; background: #e8e2d8; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.card img { display: block; width: 100%; height: auto; transition: transform .5s; }
.card:hover img, .card:focus-visible img { transform: scale(1.04); }
.card h3 { margin: .6rem 0 0; font-family: var(--serif); font-weight: 400; font-size: 1.05rem; }
.card span { font-size: .8rem; color: var(--muted); }
.card.hide { display: none; }

.about, .contact { max-width: 720px; margin: 5rem auto 0; }
.about h2, .contact h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; border-bottom: 1px solid #d8d0c4; padding-bottom: .5rem; }
.about h3 { font-family: var(--serif); font-weight: 400; margin-top: 2rem; }
.about p { font-size: 1.05rem; }
.about ul { padding-left: 1.2rem; }
.about-portrait { float: left; width: min(34%, 14rem); margin: 0 1.5rem 1rem 0; }
.about-portrait img { display: block; width: 100%; height: auto; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.contact { clear: both; }
.contact a { color: var(--accent); }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 4rem 1rem 2rem; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 13, 12, .95); display: flex;
  align-items: center; justify-content: center; padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 82vw; text-align: center; color: #e8e2d8; }
.lb-status { min-width: 12rem; min-height: 12rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; }
.lb-status[hidden], .lb-viewport[hidden] { display: none; }
.lb-viewport { display: inline-block; vertical-align: middle; max-width: 82vw; max-height: 65vh; overflow: hidden; box-shadow: 0 10px 40px #000; }
.lb-viewport img { display: block; max-width: 82vw; max-height: 65vh; cursor: zoom-in; }
.lb-viewport.is-zoomed {
  position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; overflow: auto; overscroll-behavior: contain; background: #0f0d0c;
}
.lb-viewport.is-zoomed img { max-width: none; max-height: none; margin: auto; cursor: grab; }
.lb-viewport.is-zoomed.is-panning img { cursor: grabbing; }
.lightbox .lb-zoom-close { position: fixed; top: .5rem; right: .75rem; z-index: 1; background: rgba(15,13,12,.8); border-radius: .25rem; }
.lb-zoom-close[hidden] { display: none; }
.lb-viewport:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.lb-tools { margin-top: .5rem; }
.lightbox .lb-tools button { position: static; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #8a837a; border-radius: 999px; padding: .4rem .8rem; font: inherit; font-size: .85rem; }
.lightbox .lb-tools button:disabled { opacity: .45; cursor: default; }
.lb-tools svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.lightbox figcaption { margin-top: .5rem; font-size: .9rem; }
.lightbox figcaption strong { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 400; }
.lightbox button { position: absolute; background: none; border: 0; color: #e8e2d8; font-size: 3rem; cursor: pointer; line-height: 1; padding: .5rem 1rem; }
.lb-close { top: .5rem; right: .75rem; }
.lb-nav.prev { left: .5rem; }
.lb-nav.next { right: .5rem; }

@media (max-width: 600px) {
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 2.75rem; height: 2.75rem; padding: .65rem; border: 1px solid #cfc7bb;
    border-radius: .25rem; background: transparent; color: var(--ink); cursor: pointer;
  }
  .menu-toggle span { display: block; width: 100%; height: 2px; background: currentColor; }
  .menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .header-menu {
    position: absolute; top: 100%; left: 0; right: 0; display: none; flex-direction: column;
    align-items: stretch; gap: .5rem; padding: .75rem clamp(1rem, 4vw, 3rem) 1rem;
    background: rgba(246, 243, 238, .98); border-bottom: 1px solid #e3ddd3;
    box-shadow: 0 8px 16px rgba(29, 27, 25, .08);
  }
  .header-menu.is-open { display: flex; }
  .top nav { display: flex; flex-direction: column; }
  .top nav a { margin: 0; padding: .55rem 0; font-size: .85rem; }
  .language-switch { margin: .25rem 0 0; }
  .about-portrait { float: none; width: min(70%, 18rem); margin: 0 auto 1.5rem; }
}
