/* ==========================================================================
   Painter portfolio — light, airy, quiet. The paintings carry all the colour.
   Type: Spectral (thin serif, display + prose) and Jost (small UI text).
   Both have full Cyrillic support.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --wash: #f5f4f1;        /* placeholder tone behind images while they load */
  --ink: #292826;
  --graphite: #6a6965;    /* secondary text, 5.6:1 on white */
  --hairline: #e7e5e1;
  --accent: #3f6280;      /* smalt blue: focus rings, links, "available" dot */
  --danger: #9b2c2c;

  --serif: 'Spectral', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, system-ui, sans-serif;

  --gutter: clamp(1.25rem, 4.5vw, 4rem);
  --page-max: 96rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, p, dl, dd, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -5rem; z-index: 100;
  padding: .75rem 1.25rem; background: var(--ink); color: var(--paper);
  text-decoration: none; font-size: .95rem;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */

.site-header {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .75rem 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.4rem;
  letter-spacing: .01em;
  text-decoration: none;
}

.site-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.75rem; }
.nav-list { display: flex; gap: 1.75rem; }

.nav-link {
  display: inline-block;
  padding: .3rem 0;
  font-size: .95rem; letter-spacing: .02em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.nav-link[aria-current="page"] { border-bottom-color: currentColor; }

.lang-switch { display: flex; gap: .9rem; padding-left: 1.75rem; border-left: 1px solid var(--hairline); }
.lang-switch a {
  padding: .3rem 0;
  font-size: .85rem; letter-spacing: .08em;
  color: var(--graphite);
  text-decoration: none;
}
.lang-switch a[aria-current="true"] { color: var(--ink); border-bottom: 1px solid currentColor; }

@media (hover: hover) {
  .nav-link:hover { border-bottom-color: var(--graphite); }
  .lang-switch a:hover { color: var(--ink); }
}

@media (max-width: 40rem) {
  .site-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .site-nav { width: 100%; justify-content: space-between; gap: .5rem 1rem; }
  .nav-list { gap: 1.25rem; }
  .lang-switch { padding-left: 0; border-left: 0; gap: .75rem; }
}

/* ---------- Button ---------- */

.button {
  display: inline-block;
  padding: 1rem 2.25rem;
  font: 400 .95rem/1.2 var(--sans);
  letter-spacing: .04em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
@media (hover: hover) {
  .button:hover { background: var(--ink); color: var(--paper); }
}
.button[disabled] { opacity: .55; cursor: progress; }

/* ---------- Home ---------- */

.poster {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: clamp(1rem, 4vw, 3rem) var(--gutter) clamp(3.5rem, 8vw, 7rem);
}

.poster-name {
  margin-bottom: clamp(1.75rem, 4.5vw, 3.75rem);
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(3.25rem, 10.5vw, 9.5rem);
  line-height: .94;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.poster-figure {
  aspect-ratio: 4 / 5;
  background: var(--wash);
  overflow: hidden;
  animation: settle 1.1s ease-out both;   /* the one moment of motion on the site */
}
.poster-figure img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focal, 50% 50%); }
@media (min-width: 48rem) { .poster-figure { aspect-ratio: 16 / 9; } }

@keyframes settle { from { opacity: 0; } to { opacity: 1; } }

.poster-label {
  margin-top: 1.5rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1.75rem;
}
@media (min-width: 48rem) {
  .poster-label { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 3rem; }
}

.tagline {
  max-width: 26ch;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  line-height: 1.35;
}

/* ---------- Inner pages ---------- */

.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 4rem) var(--gutter) clamp(4rem, 9vw, 8rem);
}

.page--wide { max-width: 100rem; }

.page-title {
  margin-bottom: 1.1rem;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(2.6rem, 5.5vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}

.page-intro {
  max-width: 34rem;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.1rem, 1.2vw + .75rem, 1.3rem);
  line-height: 1.6;
  color: var(--graphite);
}

.empty { margin-top: 4rem; font-family: var(--serif); font-size: 1.2rem; color: var(--graphite); }

/* ---------- Gallery: masonry grid, many paintings at once ---------- */

/* --cols is the single place that sets the number of columns (masonry.js reads it too). */
.masonry {
  --cols: 2;
  --col-gap: 1rem;
  --row-gap: 2.25rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  column-count: var(--cols);   /* fallback layout when JavaScript is unavailable */
  column-gap: var(--col-gap);
  /* Hidden until masonry.js has laid it out, so nothing jumps. If the script never runs, show it after 1.5s. */
  opacity: 0;
  animation: masonry-reveal 0s linear 1.5s forwards;
}
@media (min-width: 48rem) { .masonry { --cols: 3; --col-gap: 1.5rem; --row-gap: 3rem; } }
@media (min-width: 72rem) { .masonry { --cols: 4; } }

.masonry[data-ready] { opacity: 1; animation: none; }
@keyframes masonry-reveal { to { opacity: 1; } }

.masonry.is-masonry { display: flex; align-items: flex-start; gap: var(--col-gap); column-count: auto; }
.masonry-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--row-gap); }

.work { break-inside: avoid; margin-bottom: var(--row-gap); }
.is-masonry .work { margin-bottom: 0; }

.work-open {
  display: block; width: 100%;
  aspect-ratio: var(--ratio);
  padding: 0; border: 0;
  background: var(--wash);
  cursor: zoom-in;
}
.work-open img { width: 100%; height: 100%; object-fit: cover; }

/* A compact label under each painting, like the card beside it on a gallery wall. */
.work-label { margin-top: .8rem; display: grid; gap: .15rem; }

.work-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.25;
}
.work-facts { display: grid; font-size: .875rem; line-height: 1.5; color: var(--graphite); }
.work-status { margin-top: .15rem; font-size: .8125rem; line-height: 1.5; }

.status { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); }
.status::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--accent);
}
.status[data-status="sold"] { color: var(--graphite); }
.status[data-status="sold"]::before { background: transparent; box-shadow: inset 0 0 0 1px var(--graphite); }

.enquire, .lb-enquire { color: var(--accent); text-underline-offset: .25em; text-decoration-thickness: 1px; }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--paper); color: var(--ink);
}
.lightbox::backdrop { background: var(--paper); }
html:has(dialog[open]) { overflow: hidden; }

.lb-figure {
  height: 100%;
  padding: clamp(3.75rem, 7vw, 5rem) clamp(.75rem, 7vw, 6.5rem) 1.25rem;
  display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1rem;
}
.lb-img { width: 100%; height: 100%; object-fit: contain; }
.lb-caption { display: grid; gap: .2rem; justify-items: center; text-align: center; min-height: 3.2rem; }
.lb-title { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 1.3rem; line-height: 1.25; }
.lb-desc { max-width: 40rem; font-family: var(--serif); font-weight: 300; font-size: 1.05rem; line-height: 1.5; color: var(--graphite); }
.lb-meta { font-size: .9rem; color: var(--graphite); }
.lb-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.5rem; margin-top: .15rem; font-size: .9rem; }

.lb-btn {
  position: absolute; z-index: 2;
  display: grid; place-items: center;
  width: 3.25rem; height: 3.25rem;
  padding: 0; border: 0; background: transparent; color: var(--ink);
  cursor: pointer;
}
.lb-close { top: .75rem; right: .75rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: .5rem; }
.lb-next { right: .5rem; }
@media (hover: hover) { .lb-btn:hover { color: var(--accent); } }
@media (max-width: 40rem) {
  .lb-prev, .lb-next { top: auto; bottom: .5rem; transform: none; }
  .lb-figure { padding-bottom: 4.25rem; }
}

/* ---------- About ---------- */

.about { margin-top: clamp(2.5rem, 6vw, 5rem); display: grid; gap: 2.5rem; }
@media (min-width: 56rem) {
  .about { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(3rem, 7vw, 7rem); align-items: start; }
  .about-portrait { position: sticky; top: 2rem; }
}

.about-portrait { aspect-ratio: 4 / 5; background: var(--wash); overflow: hidden; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }

.prose {
  max-width: 38rem;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.1rem, 1.1vw + .8rem, 1.3rem);
  line-height: 1.75;
}
.prose p + p { margin-top: 1.4em; }
.prose h2 { margin: 0 0 .5em; font: 300 1.6rem/1.3 var(--serif); letter-spacing: -.005em; }
.prose section + section { margin-top: 2.6em; }
.prose ul { display: grid; gap: .5em; }
.prose a { text-underline-offset: .25em; text-decoration-thickness: 1px; }
.legal { font-size: 1.05rem; }
.page-meta { margin-top: -.25rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); font-size: .9rem; color: var(--graphite); }
.prose p:first-child { font-size: 1.12em; }

.about-cta-text { margin: clamp(2.5rem, 5vw, 4rem) 0 1.25rem; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 1.3rem; }

/* ---------- Contact ---------- */

.contact { margin-top: clamp(2.5rem, 6vw, 5rem); display: grid; gap: 3.5rem; }
@media (min-width: 56rem) {
  .contact { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(3rem, 7vw, 7rem); align-items: start; }
}

.contact-details dt { margin-top: 1.75rem; font-size: .9rem; color: var(--graphite); }
.contact-details dt:first-child { margin-top: 0; }
.contact-details dd { font-family: var(--serif); font-weight: 300; font-size: 1.3rem; line-height: 1.7; }
.contact-details a { text-underline-offset: .25em; text-decoration-thickness: 1px; }

.contact-form { max-width: 40rem; }
.form-about { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--hairline); font-size: .95rem; color: var(--graphite); }
.form-about em { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }

.field { margin-bottom: 1.9rem; }
.field label { display: block; margin-bottom: .15rem; font-size: .9rem; color: var(--graphite); }
.field input,
.field textarea {
  display: block; width: 100%;
  padding: .6rem 0;
  font-family: var(--serif); font-weight: 300; font-size: 1.25rem; line-height: 1.5;
  color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field [aria-invalid="true"] { border-bottom-color: var(--danger); }
.field-error { margin-top: .4rem; font-size: .9rem; color: var(--danger); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cf-turnstile { margin-bottom: 1.5rem; }
.cf-turnstile:empty { margin: 0; }

.form-note { margin-top: 1.5rem; max-width: 34rem; font-size: .875rem; line-height: 1.6; color: var(--graphite); }
.form-note a { text-underline-offset: .25em; text-decoration-thickness: 1px; }

.form-unavailable { max-width: 34rem; padding-top: .25rem; font-family: var(--serif); font-weight: 300; font-size: 1.25rem; line-height: 1.6; color: var(--graphite); }

.form-status { min-height: 1.6em; margin-top: 1.25rem; font-family: var(--serif); font-size: 1.15rem; }
.form-status.is-error { color: var(--danger); }

/* ---------- 404 ---------- */

.not-found .button { margin-top: 2.5rem; }

/* ---------- Footer ---------- */

.site-footer { margin-top: auto; border-top: 1px solid var(--hairline); }
.footer-inner {
  width: 100%;
  max-width: var(--page-max); margin-inline: auto;
  padding: 2rem var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem;
  font-size: .875rem; color: var(--graphite);
}
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer-links a { text-underline-offset: .25em; text-decoration-thickness: 1px; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .poster-figure { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
