/* ============================================================
   Meredith Blackmore — site
   Bone paper, ink type. Bungee Inline wordmark, Space Grotesk
   display, DM Sans supporting.
   No decorative rules — hierarchy through space, weight, scale.
   ============================================================ */

:root {
  --bone: #f3f0e9;
  --ink: #16130f;
  --ink-soft: rgba(22, 19, 15, 0.62);
  --gap: clamp(1rem, 2.5vw, 2rem);
  --ease-sine: cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  overflow-x: clip;
  background: var(--bone);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

/* ---------- header ---------- */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem clamp(1.25rem, 3.5vw, 3rem);
  color: var(--ink);
  background: rgba(243, 240, 233, 0.5); /* videos play through underneath */
  transition: background-color 0.5s var(--ease-sine);
}

/* solid once past the hero; subpages have no hero so always solid */
.site-head.solid,
.subpage .site-head {
  background: var(--bone);
}

.wordmark {
  font-family: "Bungee Inline", sans-serif;
  font-weight: 400;
  font-size: clamp(0.8rem, 1.05vw, 0.95rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 2.2vw, 1.9rem);
}

.site-nav a {
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  transition: opacity 0.4s var(--ease-sine);
}

.site-nav a:hover { opacity: 0.65; }

.text-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.35em;
  transition: opacity 0.4s var(--ease-sine);
}

.text-link:hover { opacity: 0.65; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: #0c0b09;
}

.hero-stage { position: absolute; inset: 0; }

.hero-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.9s var(--ease-sine);
}

.hero-scene.live { opacity: 1; }

.hero-scene video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-cue {
  position: absolute;
  right: clamp(1.25rem, 3.5vw, 3rem);
  bottom: clamp(1.5rem, 5vh, 3.5rem);
  z-index: 5;
  mix-blend-mode: difference;
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  opacity: 0.7;
  animation: cue-drift 4.5s var(--ease-sine) infinite;
}

@keyframes cue-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ---------- film grain ---------- */

.grain { overflow: hidden; } /* positioning context comes from the host element */

figure.grain { position: relative; }

.grain::after {
  content: "";
  position: absolute;
  inset: -75%;
  z-index: 3;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* NB: no mix-blend-mode here — Chrome won't blend against <video> layers,
     the grain silently disappears. Contrast-punched noise at low alpha works. */
  filter: contrast(320%);
  opacity: 0.38;
  animation: grain-shift 1.2s steps(10) infinite;
}

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-4%, -8%); }
  20% { transform: translate(-12%, 4%); }
  30% { transform: translate(6%, -18%); }
  40% { transform: translate(-4%, 18%); }
  50% { transform: translate(-12%, 8%); }
  60% { transform: translate(12%, 0%); }
  70% { transform: translate(0%, 12%); }
  80% { transform: translate(2%, 24%); }
  90% { transform: translate(-8%, 8%); }
}

/* ---------- statement ---------- */

.statement {
  padding: clamp(6rem, 14vh, 10rem) clamp(1.25rem, 3.5vw, 3rem);
  display: flex;
  justify-content: center;
}

.statement p {
  max-width: 56rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 3.2vw, 2.9rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}

/* ---------- sections ---------- */

.section {
  padding: clamp(4.5rem, 10vh, 8rem) clamp(1.25rem, 3.5vw, 3rem);
  max-width: 90rem;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 1.2rem;
}

.title-years {
  font-style: italic;
  font-weight: 400;
  font-size: 0.5em;
  color: var(--ink-soft);
  margin-left: 0.35em;
}

.section-intro {
  max-width: 38rem;
  color: var(--ink-soft);
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
}

.sub-gap { margin-top: clamp(5rem, 10vh, 8rem); }

/* ---------- artist statement ---------- */

.statement-body { max-width: 46rem; }

.statement-body p {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.statement-body p:last-child { margin-bottom: 0; }

/* ---------- painting blocks ---------- */

.painting-blocks {
  margin-top: clamp(2rem, 4vh, 3rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
  gap: clamp(2.5rem, 6vw, 6rem);
}

.painting-block h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  margin-bottom: 1rem;
}

.painting-block p {
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
  max-width: 34rem;
}

/* ---------- painting galleries (subpages) ---------- */

.mural-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(26rem, 100%), 1fr));
  gap: var(--gap);
  row-gap: clamp(2rem, 4vh, 3rem);
}

.mural-grid figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.mural-grid figcaption,
.about-media figcaption {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.portrait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: var(--gap);
}

.portrait-grid figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* ---------- shop (emulates the existing WooCommerce shop) ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: var(--gap);
  row-gap: clamp(2.2rem, 4vh, 3.2rem);
}

.product-card {
  display: block;
  text-decoration: none;
}

.card-media {
  position: relative;
  display: block;
  margin-bottom: 0.85rem;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: opacity 0.4s var(--ease-sine);
}

.product-card:hover img { opacity: 0.88; }

.product-card.is-sold { pointer-events: none; }

.product-card.is-sold img { opacity: 0.55; filter: saturate(0.6); }

.sold-badge {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  padding: 0.3rem 0.7rem;
  background: var(--bone);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.product-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 1.08rem;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.product-card .desc {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .price {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.8rem;
}

.card-cta {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: var(--ink);
  color: var(--bone);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.4s var(--ease-sine);
}

.product-card:hover .card-cta { opacity: 0.82; }
button.card-cta { border: 0; cursor: pointer; font-family: inherit; }

/* enquiry dialog */
#enquiryDialog {
  border: 0; padding: 2rem; width: min(30rem, calc(100vw - 2rem));
  background: var(--bone); color: var(--ink);
}
#enquiryDialog::backdrop { background: rgba(0,0,0,0.55); }
.enq-close-row { display: flex; justify-content: flex-end; margin: -1rem -1rem 0 0; }
.enq-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); }
.enq-title { font-size: 1.3rem; margin: 0 0 0.5rem; }
.enq-sub { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 1.2rem; }
.enq-form label { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.9rem; }
.enq-form input, .enq-form textarea {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.6rem;
  font: inherit; font-size: 0.95rem; letter-spacing: 0; text-transform: none;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.enq-status { font-size: 0.85rem; margin: 0.8rem 0 0; min-height: 1.2em; }

.shop-more {
  margin-top: clamp(2.5rem, 5vh, 4rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2rem;
}

.shop-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.shop-note a { color: inherit; }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.about-bio p { max-width: 40rem; margin-bottom: 1.3rem; }

.about-bio p:last-child { margin-bottom: 0; }

.about-media img,
.about-media video { width: 100%; }

.selected {
  margin-top: clamp(4rem, 9vh, 7rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: clamp(2rem, 4vw, 4rem);
}

.selected-col h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.selected-col ul { list-style: none; }

.selected-col li {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 0.55rem;
}

/* ---------- contact ---------- */

.contact { padding-bottom: clamp(3rem, 6vh, 5rem); }

.contact-mail {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 400;
  font-size: clamp(1.6rem, 4.6vw, 4rem);
  letter-spacing: -0.015em;
  text-decoration: none;
  transition: opacity 0.4s var(--ease-sine);
  overflow-wrap: anywhere;
}

.contact-mail:hover { opacity: 0.7; }

.contact-social {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-social a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.4s var(--ease-sine);
}

.contact-social a:hover { color: var(--ink); }

/* ---------- gallery subpages ---------- */

.subpage .gallery-page {
  padding-top: clamp(8rem, 16vh, 11rem); /* clear the fixed header */
}

.gallery-back {
  margin-top: clamp(2.5rem, 5vh, 4rem);
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

/* ---------- footer ---------- */

.site-foot {
  padding: 2.2rem clamp(1.25rem, 3.5vw, 3rem) 2.6rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .site-head {
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1rem;
  }
  .wordmark { font-size: 0.78rem; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0.4rem; }
  .site-nav a { font-size: 0.58rem; letter-spacing: 0.06em; }
  .hero-cue { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-media { order: -1; max-width: 20rem; }
  .product-grid,
  .portrait-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
    row-gap: 1.6rem;
  }
  .product-card h3 { font-size: 0.92rem; }
  .card-cta { padding: 0.45rem 0.8rem; font-size: 0.62rem; }
  .subpage .gallery-page { padding-top: 7.5rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-cue { animation: none; }
  .hero-scene { transition: none; }
  .grain::after { animation: none; }
}
