/* A Thousand & One Canvases — public gallery */
:root {
  --ivory: #f7f2e9;
  --paper: #fbf8f2;
  --ink: #1f1c19;
  --ink-soft: #5b544c;
  --line: #e4dccd;
  --night: #161c33;
  --night-2: #232b4d;
  --gold: #b08d57;
  --gold-soft: #d8c29b;
  --rose: #9c4f46;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --radius: 2px;
  --shadow: 0 18px 40px -22px rgba(31, 28, 25, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.8rem;
  font-weight: 400;
}
.lede { color: var(--ink-soft); max-width: 36rem; margin: 1rem auto 0; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  color: var(--paper);
  transition: background 0.4s, color 0.4s, box-shadow 0.4s, padding 0.4s;
}
.nav.is-solid {
  background: rgba(247, 242, 233, 0.94);
  backdrop-filter: blur(8px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  padding-block: 0.7rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--serif); font-size: 1.35rem; font-style: italic; }
.brand-star { width: 26px; height: 26px; color: var(--gold); }
.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
.nav-links a { text-decoration: none; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.85; }
.nav-links a:hover { opacity: 1; color: var(--gold); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 92vh;
  display: grid; place-items: center; text-align: center;
  color: var(--paper);
  background: radial-gradient(ellipse at 50% 120%, var(--night-2) 0%, var(--night) 60%, #0e1224 100%);
  overflow: hidden;
}
.hero-sky {
  position: absolute; inset: 0; opacity: 0.7;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 68%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 14%, var(--gold-soft) 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 42%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 80%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 60%, var(--gold-soft) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 84%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 10%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 90%, #fff 50%, transparent 51%);
  animation: twinkle 7s ease-in-out infinite alternate;
}
.hero::after {
  /* crescent moon */
  content: ''; position: absolute; top: 14%; right: 12%;
  width: 70px; height: 70px; border-radius: 50%;
  box-shadow: -14px 8px 0 0 var(--gold-soft);
  opacity: 0.85;
}
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 0.85; } }
.hero-inner { position: relative; padding: 6rem 1.5rem 4rem; }
.hero .eyebrow { color: var(--gold-soft); }
.hero-title { font-size: clamp(4rem, 13vw, 9.5rem); font-weight: 400; font-style: italic; letter-spacing: 0.01em; }
.hero-tagline { font-family: var(--serif); font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-style: italic; color: #d9d3c7; margin: 0 0 2.4rem; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.2rem auto 1.4rem; color: var(--gold); }
.ornament span { width: 70px; height: 1px; background: currentColor; opacity: 0.6; }
.ornament svg { width: 26px; height: 26px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; cursor: pointer;
  font: 400 0.78rem/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; text-decoration: none;
  padding: 1.05rem 2rem; border-radius: var(--radius);
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { background: var(--gold); border-color: var(--gold); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-light { background: transparent; color: var(--paper); border-color: rgba(251, 248, 242, 0.6); }
.btn-light:hover { background: var(--paper); color: var(--night); border-color: var(--paper); }

/* ---------- collection ---------- */
section { padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 4vw, 3rem); }
.section-head { text-align: center; margin-bottom: 3.2rem; }
.filters { display: inline-flex; gap: 0.4rem; margin-top: 1.8rem; border-bottom: 1px solid var(--line); }
.filter {
  background: none; border: 0; cursor: pointer; padding: 0.6rem 1.1rem;
  font: 400 0.74rem var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid transparent; margin-bottom: -1px;
}
.filter.is-active { color: var(--ink); border-bottom-color: var(--gold); }

/* Row-by-row grid (left to right, newest first). A few paintings sit centred;
   more fill up to three across on desktop and one per row on phones. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 360px));
  justify-content: center;
  align-items: start;
  gap: clamp(2rem, 4vw, 3.2rem) clamp(1.2rem, 3vw, 2.6rem);
  max-width: 1320px; margin: 0 auto;
}
.card {
  margin: 0;
  cursor: pointer; background: none; border: 0; padding: 0; width: 100%; text-align: left; color: inherit; font: inherit;
  opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease;
}
.card.is-visible { opacity: 1; transform: none; }
.card-frame {
  position: relative; background: var(--paper); padding: clamp(10px, 1.4vw, 16px);
  box-shadow: var(--shadow); transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.card:hover .card-frame, .card:focus-visible .card-frame { transform: translateY(-4px); box-shadow: 0 28px 50px -24px rgba(31, 28, 25, 0.55); }
.card:focus-visible { outline: none; }
.card:focus-visible .card-frame { outline: 2px solid var(--gold); outline-offset: 4px; }
/* Every frame is the same shape so rows line up; the whole painting shows inside, on a paper mat. */
.card img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: var(--paper); }
.badge {
  position: absolute; top: clamp(18px, 2vw, 26px); left: clamp(18px, 2vw, 26px);
  font: 500 0.64rem var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
  background: var(--paper); color: var(--ink); padding: 0.35rem 0.65rem;
}
.badge.sold { background: var(--rose); color: var(--paper); }
.card-caption { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 1rem 0.2rem 0; }
.card-title { font-family: var(--serif); font-size: 1.45rem; font-style: italic; line-height: 1.2; }
.card-sub { font-size: 0.8rem; color: var(--ink-soft); }
.card-price { font-family: var(--serif); font-size: 1.25rem; white-space: nowrap; }
.card-price.muted { color: var(--ink-soft); font-style: italic; font-size: 1.05rem; }
.empty { text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--ink-soft); }

/* ---------- about ---------- */
.about { background: var(--paper); border-block: 1px solid var(--line); }
.about-card { max-width: 46rem; margin: 0 auto; text-align: center; }
.about-text { font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.7; color: #3a352f; margin-top: 1.6rem; white-space: pre-line; }

/* ---------- forms ---------- */
.inquiry-form { max-width: 42rem; margin: 0 auto; display: grid; gap: 1.2rem; }
.inquiry-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.inquiry-form label { display: grid; gap: 0.35rem; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.inquiry-form input, .inquiry-form textarea {
  font: 300 1rem var(--sans); color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid #cfc5b3; padding: 0.55rem 0; border-radius: 0; resize: vertical;
  letter-spacing: normal; text-transform: none;
}
.inquiry-form input:focus, .inquiry-form textarea:focus { outline: none; border-bottom-color: var(--gold); }
.inquiry-form .btn { justify-self: start; }
.optional { text-transform: none; letter-spacing: 0; font-style: italic; }
.form-status { margin: 0; min-height: 1.4em; font-family: var(--serif); font-style: italic; font-size: 1.15rem; }
.form-status.error { color: var(--rose); }
.hp { position: absolute !important; left: -9999px; }

/* ---------- footer ---------- */
.footer { background: var(--night); color: #cfc8ba; text-align: center; padding: 4rem 1.5rem 3rem; }
.footer-star { width: 30px; height: 30px; color: var(--gold); margin: 0 auto; }
.footer-name { font-family: var(--serif); font-style: italic; font-size: 1.6rem; color: var(--paper); margin: 0.8rem 0 0.4rem; }
.footer-links a { color: var(--gold-soft); text-decoration: none; margin: 0 0.6rem; }
.footer-small { font-size: 0.75rem; letter-spacing: 0.05em; opacity: 0.6; margin-top: 1.6rem; }
.footer-credit { font-size: 0.7rem; letter-spacing: 0.08em; opacity: 0.45; margin-top: 0.5rem; }
.footer-credit a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }
.footer-credit a:hover { color: var(--gold-soft); }

/* ---------- viewer dialog ---------- */
.viewer {
  width: min(1180px, 94vw); max-height: 92vh; padding: 0; border: 0;
  background: var(--paper); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6);
}
.viewer::backdrop { background: rgba(14, 18, 36, 0.82); backdrop-filter: blur(3px); }
.viewer[open] { animation: rise 0.35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.viewer-close {
  position: absolute; top: 0.6rem; right: 0.9rem; z-index: 2;
  background: none; border: 0; font-size: 2.2rem; line-height: 1; cursor: pointer; color: var(--ink-soft);
}
.viewer-close:hover { color: var(--gold); }
.viewer-grid { display: grid; grid-template-columns: 1.35fr 1fr; max-height: 92vh; }
.viewer-figure { margin: 0; background: #ece5d8; display: grid; place-items: center; padding: clamp(1rem, 3vw, 2.5rem); }
.viewer-figure img { max-height: calc(92vh - 5rem); width: auto; object-fit: contain; box-shadow: var(--shadow); }
.viewer-info { padding: clamp(1.6rem, 3vw, 3rem); overflow-y: auto; }
.viewer-info h2 { font-style: italic; font-size: clamp(2rem, 3.4vw, 2.8rem); }
.viewer-meta { color: var(--ink-soft); font-size: 0.9rem; margin: 0.6rem 0 0; }
.viewer-price { font-family: var(--serif); font-size: 1.9rem; margin: 1rem 0 0; }
.viewer-price.sold { color: var(--rose); font-style: italic; }
.viewer-desc { white-space: pre-line; margin: 1rem 0 0; color: #3a352f; }
.viewer-info h3 { font-size: 1.4rem; margin: 2rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.inquiry-form.compact { gap: 1rem; }

@media (max-width: 820px) {
  .viewer-grid { grid-template-columns: 1fr; overflow-y: auto; }
  .viewer-figure img { max-height: 55vh; }
  .viewer-info { overflow: visible; }
  .inquiry-form .row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand span { font-size: 1.1rem; }
  .nav-links { gap: 0.9rem; }
  .nav-links a { font-size: 0.68rem; letter-spacing: 0.12em; }
  .hero::after { width: 48px; height: 48px; right: 8%; top: 18%; }
}
@media (max-width: 420px) {
  .nav-links a[href="#about"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card { opacity: 1; transform: none; }
}

/* portfolio pieces (not for sale) */
.viewer-commission h3 { font-size: 1.4rem; margin: 2rem 0 0.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.viewer-commission p { color: var(--ink-soft); margin: 0 0 1.4rem; }
.viewer-price.muted { color: var(--ink-soft); font-style: italic; font-size: 1.5rem; }
