/* ==========================================================================
   styles.css — public gallery
   Warm paper, ink, one terracotta accent. No external fonts, no external
   images, no framework. Mobile first; the grid opens up from 700px.
   ========================================================================== */

:root {
  --paper:        #FBF8F3;
  --paper-deep:   #F3EDE3;
  --paper-warm:   #EFE7DA;
  --ink:          #191512;
  --ink-soft:     #5C534A;
  /* --ink-faint carries the small uppercase metadata (specs, labels, eyebrows).
     It was #8A7F73, which measured 3.7:1 on paper — below the 4.5:1 WCAG AA
     floor for text this size. #6F675C measures 5.3:1 on --paper and 4.8:1 on
     the darker --paper-deep panels, so it passes on both surfaces. */
  --ink-faint:    #6F675C;
  --rule:         #DED4C6;
  --accent:       #9C4A2F;
  --accent-soft:  #C6764F;
  --shadow:       28px 40px 80px -40px rgba(52, 36, 22, 0.45);

  --serif: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua',
           Georgia, 'Times New Roman', serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --measure: 34rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* `hidden` must always win. Without this, any class that sets display (.gate,
   .callout, .btn) silently overrides it: the passcode card stayed on screen
   after unlocking, and the "Local draft" warning showed in cloud mode. */
[hidden] { display: none !important; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

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

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

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: .85rem 1.25rem;
  border-radius: 2px; font-size: .9rem; text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

.wrap { width: 100%; max-width: 78rem; margin-inline: auto; padding-inline: var(--gutter); }

/* --- shared type ---------------------------------------------------------- */
.eyebrow {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: .5rem 0 0;
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* --- masthead ------------------------------------------------------------- */
.masthead {
  position: relative;
  padding: clamp(3rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  overflow: hidden;
  isolation: isolate;
}

.masthead__wash {
  position: absolute;
  inset: -12% -20% auto -20%;
  height: 130%;
  z-index: -1;
  opacity: .3;
  filter: blur(2px);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 22%, #000 0%, transparent 72%);
          mask-image: radial-gradient(120% 80% at 50% 22%, #000 0%, transparent 72%);
  pointer-events: none;
}
.masthead__wash svg { width: 100%; height: 100%; }

.masthead__inner { position: relative; text-align: center; }

.masthead__mark { display: flex; justify-content: center; margin-bottom: 1.75rem; }
.masthead__mark svg { width: 34px; height: 34px; }

.masthead__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 6rem);
  line-height: .96;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.masthead__name em { font-style: italic; }

.masthead__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .6rem 1rem;
  margin-top: 1.5rem;
}
.masthead__meta span { display: inline-flex; align-items: center; gap: 1rem; }
.masthead__meta span::after {
  content: ''; width: 3px; height: 3px; border-radius: 50%; background: var(--rule);
}
.masthead__meta span:last-child::after { display: none; }
/* Keep the three facts on one line on a phone; wrapped, the dot separator
   was left dangling at the end of the first line. Fits down to 360px. */
@media (max-width: 480px) {
  .masthead__meta { letter-spacing: .1em; gap: .6rem .45rem; }
  .masthead__meta span { gap: .45rem; }
}

.masthead__intro {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 32rem;
  margin: 2rem auto 0;
  text-wrap: pretty;
}

.masthead__actions { margin-top: 2.25rem; display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .95rem 1.7rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
  min-height: 44px;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

.btn--wide { width: 100%; }

/* --- gallery -------------------------------------------------------------- */
.gallery-section { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 6rem); }

.gallery-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem; padding-bottom: 1.5rem; margin-bottom: clamp(1.75rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

.filters { display: flex; gap: .25rem; flex-wrap: wrap; }
.filter {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  background: none; border: 0; border-bottom: 1px solid transparent;
  color: var(--ink-faint); padding: .5rem .6rem; cursor: pointer; min-height: 44px;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed='true'] { color: var(--ink); border-bottom-color: var(--accent); }

.gallery {
  columns: 1;
  column-gap: clamp(1.25rem, 3.5vw, 3rem);
  list-style: none; margin: 0; padding: 0;
}
@media (min-width: 700px)  { .gallery { columns: 2; } }
@media (min-width: 1080px) { .gallery { columns: 3; } }

.piece {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 clamp(2.25rem, 5vw, 3.75rem);
}

.piece__button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font: inherit; color: inherit; text-decoration: none;
}
.piece__button:hover { color: inherit; }

.piece__frame {
  position: relative;
  background: var(--paper-deep);
  padding: clamp(.5rem, 1.4vw, .85rem);
  box-shadow: var(--shadow);
  transition: transform .5s cubic-bezier(.2,.7,.3,1), box-shadow .5s ease;
}
.piece__button:hover .piece__frame,
.piece__button:focus-visible .piece__frame {
  transform: translateY(-6px);
  box-shadow: 32px 48px 90px -42px rgba(52, 36, 22, .55);
}

.piece__art { position: relative; overflow: hidden; background: var(--paper-warm); }
.piece__art > svg, .piece__art > img { width: 100%; height: auto; }
.piece__art--fixed { aspect-ratio: var(--ar, 1); }
.piece__art--fixed > svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.piece__art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(25, 21, 18, .07);
}

.piece__flag {
  position: absolute; top: 0; right: 0;
  background: var(--ink); color: var(--paper);
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  padding: .45rem .75rem;
}
.piece__flag--reserved { background: var(--accent); }

.piece__caption { padding-top: 1.15rem; }

.piece__title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem); line-height: 1.25;
  margin: 0; letter-spacing: -0.005em;
}

.piece__spec {
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); margin: .55rem 0 0;
}

.piece__price {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--rule);
}
.piece__amount { font-family: var(--serif); font-size: 1.05rem; }
.piece__amount--sold { color: var(--ink-faint); text-decoration: line-through; }
.piece__cta { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

.gallery-empty {
  text-align: center; padding: 4rem 1rem; color: var(--ink-soft);
  font-family: var(--serif); font-size: 1.2rem;
}

/* --- lightbox ------------------------------------------------------------- */
/* Native <dialog> — gives us a real focus trap, Esc-to-close and inert
   background for free, which a hand-rolled div never quite manages. */
dialog.lightbox {
  width: 100%; max-width: 100%;
  height: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0;
  background: transparent;
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog.lightbox::backdrop {
  background: rgba(24, 18, 12, .84);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* Fallback for browsers without <dialog>: JS adds .is-open */
dialog.lightbox:not([open]) { display: none; }
dialog.lightbox.is-open { display: block; position: fixed; inset: 0; z-index: 100; background: rgba(24, 18, 12, .84); }

.lightbox__panel {
  background: var(--paper);
  max-width: 68rem;
  margin: 0 auto;
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  position: relative;
}
@media (min-width: 900px) {
  .lightbox__panel {
    grid-template-columns: 1.25fr 1fr;
    min-height: 0;
    margin: clamp(1rem, 5vh, 4rem) auto;
    border-radius: 2px;
  }
}

.lightbox__art {
  background: var(--paper-warm);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.lightbox__art > * { width: 100%; height: auto; box-shadow: var(--shadow); }
/* A tall phone photo used to run past the bottom of the screen on desktop,
   and on a phone it pushed the price and the Inquire button a full screen
   down. Cap the height; the whole painting stays visible. */
.lightbox__art > img { width: auto; max-width: 100%; max-height: 70vh; }
@media (min-width: 900px) { .lightbox__art > img { max-height: calc(100vh - 12rem); } }

.lightbox__body {
  padding: clamp(1.75rem, 4vw, 3rem);
  display: flex; flex-direction: column; gap: 1.1rem;
}

.lightbox__title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.15; margin: 0;
}

.lightbox__spec { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin: 0; }

.lightbox__story { font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; color: var(--ink-soft); margin: 0; max-width: var(--measure); }

.lightbox__price { font-family: var(--serif); font-size: 1.75rem; margin: 0; }
.lightbox__price small { font-family: var(--sans); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-top: .35rem; }

.lightbox__note { font-size: .82rem; color: var(--ink-faint); margin: 0; }

.lightbox__close {
  position: absolute; top: .35rem; right: .35rem; z-index: 3;
  margin: 0; padding: .85rem 1.1rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; cursor: pointer;
  font-family: var(--sans);
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  min-height: 44px;
}
.lightbox__close:hover { color: var(--accent); border-color: var(--accent); }

.lightbox__nav { display: flex; gap: 1.25rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--rule); }
.lightbox__nav button {
  background: none; border: 0; cursor: pointer; padding: .5rem 0; min-height: 44px;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.lightbox__nav button:hover:not(:disabled) { color: var(--accent); }
.lightbox__nav button:disabled { opacity: .3; cursor: default; }

body.is-locked { overflow: hidden; }

/* --- about ---------------------------------------------------------------- */
.about { background: var(--paper-deep); padding: clamp(3rem, 8vw, 6rem) 0; }
.about__grid { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); }
@media (min-width: 860px) { .about__grid { grid-template-columns: 1fr 1.15fr; align-items: start; } }
.about__body p { font-family: var(--serif); font-size: clamp(1.05rem, 2.2vw, 1.2rem); line-height: 1.7; color: var(--ink-soft); max-width: var(--measure); margin: 0 0 1.25rem; text-wrap: pretty; }
.about__body p:last-child { margin-bottom: 0; }

/* --- contact -------------------------------------------------------------- */
.contact { padding: clamp(3rem, 8vw, 6rem) 0; }
.contact__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 860px) { .contact__grid { grid-template-columns: 1fr 1.2fr; } }

.field { display: block; margin-bottom: 1.15rem; }
.field > span {
  display: block; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .5rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .85rem .95rem;
  min-height: 46px;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(156, 74, 47, .14); }

.form-status {
  margin-top: 1rem; padding: .9rem 1rem; border-radius: 2px; font-size: .92rem;
  border: 1px solid var(--rule); background: var(--paper-deep);
}
.form-status[data-tone='error'] { border-color: var(--accent); background: #F8EBE5; color: #6E3220; }
.form-status[data-tone='ok'] { border-color: #4E6E4E; background: #ECF2EC; color: #2F4A2F; }
.form-status:empty { display: none; }

.linklike {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.linklike:hover { color: var(--ink); }

.contact__card { background: var(--paper-deep); padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: 2px; align-self: start; }
.contact__card dl { margin: 0; }
.contact__card dt { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); margin-top: 1.25rem; }
.contact__card dt:first-child { margin-top: 0; }
.contact__card dd { margin: .3rem 0 0; font-family: var(--serif); font-size: 1.05rem; }

/* --- footer --------------------------------------------------------------- */
.footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3.5rem; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer small { color: var(--ink-faint); font-size: .8rem; }
/* inline-flex + min-height keeps this a thumb-sized target on a phone */
.footer a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink-soft); text-decoration: none; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
}
.footer a:hover { color: var(--accent); }
.footer__by { color: var(--ink-faint); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }

/* --- source banner (only shown when something is off) --------------------- */
.notice {
  background: var(--ink); color: var(--paper);
  font-size: .82rem; padding: .7rem var(--gutter); text-align: center;
}
.notice a { color: var(--accent-soft); }
