/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:    #f8f6f2;
  --text:  #1c1917;
  --mid:   #6b6460;
  --light: #7a7370;
  --faint: #9a9490;
  --line:  #e4dfd9;
  --max:   1060px;
  --pad:   48px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
img  { display: block; max-width: 100%; }
a    { color: inherit; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Shared layout wrapper ──────────────────────────────────── */
/* All sections use this to align left edges with the header */
.wrap {
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  height: 56px;
}
.header-inner {
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-name {
  font-size: 13px;
  font-family: system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}
nav a {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  margin-left: 36px;
  transition: color 0.15s;
}
nav a:hover,
nav a.active { color: var(--text); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  padding: 48px var(--pad) 0;
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
}
.hero img {
  width: 100%;
  height: auto;
  display: block;
}
.hero figcaption {
  margin-top: 12px;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--faint);
}

/* ── Home intro strip ───────────────────────────────────────── */
.intro {
  padding: 64px var(--pad) 72px;
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 40px;
  border-bottom: 1px solid var(--line);
}
.intro-text {
  font-size: 22px;
  color: var(--mid);
  font-style: italic;
}
.cta-link {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
}
.cta-link:hover { color: var(--mid); }

/* ── Selected works scroll (home) ───────────────────────────── */
.selected {
  padding: 56px 0 80px;
  border-top: 1px solid var(--line);
}
.selected-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 0 var(--pad);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding-left: var(--pad);
}
.selected-scroll::-webkit-scrollbar { display: none; }
.sel-item:first-child { scroll-snap-align: start; }
.sel-item {
  flex: 0 0 auto;
  width: 300px;
  text-decoration: none;
  scroll-snap-align: start;
  cursor: pointer;
}
.sel-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 12px;
}
.sel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.sel-item:hover .sel-img img { transform: scale(1.04); }
.sel-title {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 3px;
}
.sel-meta {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ── Page heading (Work, etc.) ──────────────────────────────── */
.page-head {
  padding: 48px var(--pad) 36px;
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  font-weight: 400;
}

/* ── Work grid ──────────────────────────────────────────────── */
.work-grid {
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  padding: 48px var(--pad) 100px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 24px;
}
.work-item { cursor: pointer; }
.work-item-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 14px;
}
.work-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.work-item:hover .work-item-img img { transform: scale(1.04); }
.work-title {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.work-meta {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.03em;
}
.work-status {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  margin-top: 6px;
  letter-spacing: 0.03em;
}
.work-status.available { color: #7a9e7a; }
.work-status.sold { color: var(--faint); }
.work-item.sold .work-item-img img { opacity: 0.72; }

/* ── Overlay ────────────────────────────────────────────────── */
/* Background layer — separate element so iOS doesn't clip it */
.overlay-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(14, 12, 10, 0.88);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}
.overlay-bg.open {
  opacity: 1;
  pointer-events: none;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.overlay-inner {
  display: flex;
  gap: 64px;
  max-width: 940px;
  width: 100%;
  max-height: 88vh;
  align-items: center;
}
.overlay-img-pane {
  flex: 1.6;
  max-height: 82vh;
  display: flex;
  align-items: center;
}
.overlay-img-pane img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
}
.overlay-info {
  flex: 1;
  min-width: 200px;
}

/* Price & availability */
.overlay-price {
  font-size: 20px;
  color: #ede8e2;
  margin-bottom: 4px;
}
.overlay-price-usd {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: #706a64;
  margin-bottom: 14px;
}
.overlay-avail {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.overlay-avail::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.overlay-avail.available { color: #7a9e7a; }
.overlay-avail.available::before { background: #7a9e7a; }
.overlay-avail.sold { color: #706a64; }
.overlay-avail.sold::before { background: #706a64; }

/* Painting details panel */
.overlay-title {
  font-size: 26px;
  font-weight: 400;
  color: #ede8e2;
  margin-bottom: 8px;
  line-height: 1.25;
}
.overlay-meta {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: #8a8480;
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}
.overlay-row { display: flex; margin-bottom: 10px; }
.overlay-key {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #706a64;
  width: 84px;
  flex-shrink: 0;
  padding-top: 2px;
}
.overlay-val {
  font-size: 14px;
  color: #ada8a2;
  line-height: 1.5;
}
.overlay-inquire {
  display: block;
  margin-top: 40px;
  padding: 13px 0;
  background: none;
  border: 1px solid #3e3a36;
  width: 100%;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a9490;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.overlay-inquire:hover {
  border-color: #6a6460;
  color: #d4cfc8;
}
.overlay-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #6a6460;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: color 0.15s;
}
.overlay-close:hover { color: #aaa49e; }

/* Inquiry form panel */
.overlay-back {
  background: none;
  border: none;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #706a64;
  cursor: pointer;
  padding: 0;
  margin-bottom: 28px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.overlay-back:hover { color: #aaa49e; }

.overlay-form-heading {
  font-size: 17px;
  font-weight: 400;
  color: #cdc7c0;
  margin-bottom: 6px;
  line-height: 1.4;
}
.overlay-form-sub {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: #8a8480;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}
.overlay-field { margin-bottom: 22px; }
.overlay-field label {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #706a64;
  margin-bottom: 8px;
}
.overlay-field input,
.overlay-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #323028;
  padding: 4px 0 10px;
  font-size: 16px;
  font-family: Georgia, serif;
  color: #cdc7c0;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}
.overlay-field input:focus,
.overlay-field textarea:focus { border-bottom-color: #6a6460; }
.overlay-field input::placeholder,
.overlay-field textarea::placeholder { color: #4a4642; }
.overlay-field textarea { resize: none; height: 80px; }

.overlay-field--check { margin-bottom: 4px; }
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--faint);
  cursor: pointer;
}
.check-label input[type="checkbox"] { accent-color: var(--mid); width: 14px; height: 14px; cursor: pointer; }

.overlay-send {
  margin-top: 24px;
  width: 100%;
  padding: 12px 0;
  background: none;
  border: 1px solid #3e3a36;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a9490;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.overlay-send:hover { border-color: #6a6460; color: #d4cfc8; }
.overlay-send:disabled { opacity: 0.4; cursor: default; }

/* Success panel */
.overlay-success-msg {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 12px;
}
.overlay-success-msg p {
  font-size: 17px;
  color: #cdc7c0;
  line-height: 1.7;
}
.overlay-success-msg p.sub {
  font-size: 14px;
  color: #8a8480;
}

/* ── About ──────────────────────────────────────────────────── */
.about-wrap {
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  padding: 72px var(--pad) 120px;
}
.about-wrap h1 {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  margin-bottom: 56px;
}
.about-wrap p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 28px;
  max-width: 600px;
}
.about-wrap p.secondary { color: var(--mid); }
.about-wrap .about-contact {
  max-width: 600px;
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--faint);
}
.about-wrap .about-contact a {
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.15s;
}
.about-wrap .about-contact a:hover { color: var(--text); }

/* ── Contact ────────────────────────────────────────────────── */
.contact-wrap {
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  padding: 72px var(--pad) 120px;
}
.contact-wrap h1 {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  margin-bottom: 16px;
}
.contact-intro {
  font-size: 17px;
  color: var(--mid);
  margin-bottom: 52px;
  line-height: 1.8;
  max-width: 520px;
}
.contact-form { max-width: 520px; }
.field { margin-bottom: 28px; }
.field label {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 10px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 6px 0 12px;
  font-size: 16px;
  font-family: Georgia, serif;
  color: var(--text);
  outline: none;
  border-radius: 0;
  appearance: none;
  transition: border-color 0.2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus { border-bottom-color: var(--mid); }
.field textarea { resize: none; height: 110px; }
.form-submit {
  margin-top: 40px;
  padding: 13px 44px;
  border: 1px solid var(--text);
  background: none;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.form-submit:hover {
  background: var(--text);
  color: var(--bg);
}
.form-note {
  margin-top: 20px;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.6;
}
.form-note a {
  color: var(--mid);
  text-decoration: none;
  transition: color 0.15s;
}
.form-note a:hover { color: var(--text); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer-inner {
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* Newsletter row */
.footer-newsletter {
  border-top: 1px solid var(--line);
  padding: 36px 0;
}
.footer-newsletter .footer-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}
.newsletter-label {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  white-space: nowrap;
  flex-shrink: 0;
}
.newsletter-form { flex: 1; max-width: 360px; }
.newsletter-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--light);
  border-radius: 2px;
  padding: 0 4px 0 14px;
  transition: border-color 0.2s;
}
.newsletter-row:focus-within { border-color: var(--mid); }
.newsletter-row input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 11px 0;
  font-size: 14px;
  font-family: Georgia, serif;
  color: var(--text);
  outline: none;
}
.newsletter-row input::placeholder { color: var(--faint); }
.newsletter-row button {
  background: none;
  border: none;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  cursor: pointer;
  padding: 11px 10px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.newsletter-row button:hover { color: var(--text); }
.newsletter-note {
  margin-top: 10px;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.01em;
}

/* Credits bar */
.footer-bar {
  border-top: 1px solid var(--line);
}
.footer-bar .footer-inner {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-social {
  color: var(--faint);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.footer-social:hover { color: var(--text); }
.footer-email {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--light);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-email:hover { color: var(--text); }
.footer-copy {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.03em;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --pad: 28px; }

  .hero img { height: 56vw; min-height: 260px; }

  .intro    { flex-direction: column; gap: 20px; padding-top: 48px; padding-bottom: 52px; }
  .sel-item { width: 240px; }

  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 18px; padding-top: 36px; padding-bottom: 72px; }

  /* Bottom sheet on mobile */
  .overlay {
    padding: 0;
    align-items: flex-end;
    justify-content: stretch;
    background: none;
  }
  .overlay-inner {
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #1c1917;
    border-radius: 16px 16px 0 0;
    padding: 0 24px 52px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .overlay-inner::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #3a3632;
    border-radius: 2px;
    margin: 14px auto 8px;
    flex-shrink: 0;
  }
  .overlay.open .overlay-inner {
    transform: translateY(0);
  }
  .overlay-close { display: none; }
  .overlay-img-pane { flex: none; width: 100%; max-height: 38vh; }
  .overlay-img-pane img { max-height: 38vh; }

  .about-wrap   { padding-top: 56px; padding-bottom: 80px; }
  .contact-wrap { padding-top: 56px; padding-bottom: 80px; }

  .footer-newsletter .footer-inner { flex-direction: column; gap: 20px; }
  .newsletter-form { max-width: 100%; width: 100%; }
  .footer-bar .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 500px) {
  :root { --pad: 20px; }
  nav a { margin-left: 20px; }
  .sel-item  { width: 200px; }
  .work-grid { grid-template-columns: 1fr; }
}
