:root {
  color-scheme: light;
  --bg: #f8f1ea;
  --surface: rgba(255, 250, 246, 0.74);
  --surface-strong: #fff9f3;
  --border: rgba(108, 70, 52, 0.16);
  --text: #2f241f;
  --muted: #68554b;
  --accent: #9a5c4b;
  --accent-deep: #6f3f35;
  --on-accent: #fff8f4;
  --shadow: 0 24px 60px rgba(81, 50, 37, 0.12);
  /* Phone bottom navigation: the fixed bar's occupied height (bar + home
     indicator inset), shared by the content/footer clearance and the raised
     Back to Top offset at <=760px. Desktop never references it. */
  --site-nav-bottom-space: calc(60px + env(safe-area-inset-bottom, 0px));
  /* Shared primary navigation: a native <details>/<summary> disclosure is the
     legacy narrow-screen menu (now superseded on phones by the fixed
     .site-nav-bottom bar, which hides the disclosure at every width), and the
     inline .topbar-links show on wider screens. The summary IS the disclosure
     control (browser exposes button role + expanded state from `open`);
     site-nav.js only adds close-on-link, outside-click, and Escape/focus
     enhancements. */
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Tinted (not default grey) tap feedback for touch devices. */
  -webkit-tap-highlight-color: rgba(154, 92, 75, 0.18);
}

/* Anchor targets get a small top margin so scrolling to a section leaves a
   sliver of breathing room and never parks focused content flush to the
   viewport edge or under any fixed control. */
#top,
.section[id] {
  scroll-margin-top: 24px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.005em;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 226, 204, 0.7), transparent 26%),
    radial-gradient(circle at top right, rgba(226, 205, 244, 0.45), transparent 20%),
    linear-gradient(180deg, #fbf4ed 0%, #f5ede6 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Touch input: `manipulation` allows panning and pinch-zoom but removes the
   legacy double-tap-zoom delay on every interactive control. */
a,
button,
input,
select,
textarea,
summary,
label,
.painting-card {
  touch-action: manipulation;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.hero {
  padding: 10px 0 40px;
}

.topbar,
.hero-content,
.intro-grid,
.story-layout,
.contact-grid,
.section-heading {
  display: grid;
  gap: 24px;
}

.topbar {
  /* minmax(0,1fr) lets the brand track shrink before the menu control, so a
     long label or large text zoom can reflow instead of overflowing. */
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 249, 243, 0.7);
  backdrop-filter: blur(14px);
}

.brand,
h1,
h2,
h3 {
  font-family: "Cormorant Garamond", serif;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.8rem;
  font-weight: 600;
}

.topbar-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.hero-content {
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  align-items: stretch;
  padding-top: 34px;
}

.hero-stack {
  display: grid;
  gap: 18px;
}

.hero-copy,
.hero-card,
.intro-panel,
.painting-card,
.testimonials-grid blockquote,
.contact-form,
.contact-card,
.painting-dialog {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
}

.hero-card,
.intro-panel,
.contact-card {
  padding: 28px;
}

.eyebrow,
.section-label,
.hero-card-label,
.section-note,
.painting-card-body p,
.painting-card-body span,
.stat-label,
.detail-list dt {
  color: var(--muted);
}

.eyebrow,
.section-label,
.hero-card-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
}

h1 {
  margin: 8px 0 14px;
  font-size: clamp(2.75rem, 6vw, 5.2rem);
  line-height: 0.98;
  max-width: 13ch;
}

h2 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

h3 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 600;
}

.hero-text,
.story-copy,
.accent-panel p,
.section-note,
.contact-card,
.dialog-copy p,
.painting-card-body p,
.painting-card-body span,
.detail-list dd,
label {
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.placeholder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.placeholder-list span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.button:hover,
.painting-card:hover {
  transform: translateY(-2px);
}

/* Touch-only pressed feedback (hover-capable pointers keep the hover nudge
   while pressing). The settled position reads as "pressed", not "lifted". */
@media (hover: none) {
  .button:active,
  .filter-chip:active,
  .painting-card:active {
    transform: translateY(0);
  }
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent-deep);
}

.button-secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.4);
}

/* Fixed "Back to Top" control, anchored to the bottom-right safe side so it
   never sits over the centered forms, CTAs, or consent text (back-to-top.js
   additionally hides it whenever a form/footer/avoid zone actually enters its
   placement region). Anchored with right/bottom only -- never a transform, so
   the generic .button:hover nudge (translateY) cannot break placement.
   bottom clears the iOS safe area; [hidden] wins over .button's display. */
.back-to-top {
  position: fixed;
  left: auto;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: fit-content;
  max-width: calc(100% - 40px);
  z-index: 40;
}

.back-to-top[hidden] {
  display: none;
}

/* Shared primary navigation disclosure (native <details>). Legacy narrow-
   screen menu, kept as valid progressive-enhancement markup for site-nav.js;
   since the fixed .site-nav-bottom bar became the phone navigation it is no
   longer displayed at any width (base display:none below is final -- the
   640px/760px blocks no longer re-display it). Wide screens show the inline
   .topbar-links. The summary IS the disclosure control: the browser exposes
   its button role and expanded state from the `open` attribute automatically
   (WAI-ARIA disclosure pattern, native), so no manual
   aria-expanded/aria-controls wiring is duplicated. */
.site-nav-disclosure {
  position: relative;
  display: none;
}

/* Summary is the visible >=44px control. The native disclosure triangle is
   removed (the pill is self-evident) on both legacy and spec selectors. */
.site-nav-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.site-nav-summary::-webkit-details-marker {
  display: none;
}

.site-nav-summary::marker {
  content: '';
}

.site-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 10px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

/* A closed <details> hides its non-summary content from the rendering (and
   thus the tab/focus order). This explicit rule makes that contract
   enforceable rather than relying solely on the user-agent default. */
.site-nav-disclosure:not([open]) .site-nav-menu {
  display: none;
}

.site-nav-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--text);
  white-space: nowrap;
}

.site-nav-menu a:hover {
  background: rgba(154, 92, 75, 0.1);
}

/* Phone-only fixed bottom navigation (display:none until the <=760px block
   switches it on; >=761px keeps the desktop topbar composition untouched).
   Four equal tabs, each a plain anchor (icon + readable label) with a 56px
   minimum target -- 44px floor, 48px+ preferred. The bar is anchored with
   left/right/bottom only and sits below the Back to Top control (z-index 40)
   and far below the native painting dialog top layer. Padding-bottom clears
   the gesture safe area (viewport-fit=cover is set on every page). */
.site-nav-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  border-top: 1px solid var(--border);
  background: rgba(255, 249, 243, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 -12px 32px rgba(81, 50, 37, 0.1);
}

.site-nav-bottom a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 8px 4px 6px;
  color: var(--muted);
  -webkit-tap-highlight-color: rgba(154, 92, 75, 0.18);
}

.site-nav-bottom a:hover {
  background: rgba(154, 92, 75, 0.08);
}

.site-nav-bottom-icon {
  width: 20px;
  height: 20px;
}

.site-nav-bottom-label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Current tab is marked with aria-current="page" and conveyed by weight AND
   shape, never colour alone: a deliberate 3px accent rail along the bar's top
   edge (the Facebook-style indicator, in the warm incumbent palette) plus a
   heavier label. The rail hugs the bar edge because the tab's padding-top
   starts at the bar's own top border. */
.site-nav-bottom a[aria-current="page"] {
  color: var(--accent-deep);
}

.site-nav-bottom a[aria-current="page"] .site-nav-bottom-label {
  font-weight: 600;
}

.site-nav-bottom a[aria-current="page"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

/* Current page is marked statically per-page with aria-current="page" and is
   conveyed with weight AND shape, never colour alone: a heavier weight plus a
   deliberate 2px underline. Restrained by design: no fill, no side bars. */
.topbar-links a[aria-current="page"],
.site-nav-menu a[aria-current="page"] {
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.site-footer {
  margin-top: 48px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 250, 246, 0.6);
}

.site-footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.site-footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer-nav a[aria-current="page"] {
  font-weight: 600;
  color: var(--accent-deep);
}

.button:focus-visible,
.dialog-close:focus-visible,
.filter-chip:focus-visible,
.topbar a:focus-visible,
.site-footer-nav a:focus-visible,
.home-section-nav a:focus-visible,
.inline-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.site-nav-summary:focus-visible,
.site-nav-menu a:focus-visible,
.site-nav-bottom a:focus-visible,
.back-to-top:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--on-accent);
}

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  clip: auto;
  clip-path: none;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.hero-card ul,
.contact-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.hero-preview {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 12px;
  padding: 12px;
}

.hero-preview-column {
  display: grid;
  gap: 12px;
}

.hero-preview-image {
  min-height: 148px;
  border-radius: 20px;
  background-size: cover;
  background-position: center;
}

.preview-primary {
  background-image: url('./artwork/WhatsApp%20Image%202026-03-30%20at%204.41.17%20PM.jpeg');
}

.preview-secondary {
  background-image: url('./artwork/WhatsApp%20Image%202026-03-30%20at%204.41.21%20PM%20(3).jpeg');
}

.preview-tertiary {
  background-image: url('./artwork/WhatsApp%20Image%202026-03-30%20at%204.41.22%20PM.jpeg');
}

.preview-large {
  min-height: 308px;
}

.hero-note {
  padding: 24px 28px;
}

.section {
  margin-top: 28px;
}

.intro-grid,
.story-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-grid {
  grid-template-columns: 1fr;
  justify-items: center;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.stat-value {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 3.2rem;
  line-height: 1;
}

.gallery-grid,
.testimonials-grid {
  display: grid;
  gap: 18px;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.gallery-results {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 10px 0 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  /* Primary gallery control: 48px target (44px floor, 48px preferred). */
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.8);
}

.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  border: 2px solid var(--accent-deep);
  color: var(--on-accent);
  font-weight: 600;
}

.painting-card[hidden] {
  display: none;
}

.gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.painting-card {
  overflow: hidden;
  cursor: pointer;
}

.painting-image,
.dialog-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.4);
}

.painting-image {
  overflow: hidden;
}

/* Natural artwork aspect ratios: the card image element keeps its own ratio.
   SSR emits intrinsic width/height pixel attributes (derived from each piece's
   physical cm dimensions) so the box reserves its exact aspect-ratio before
   the lazy thumbnail loads (low CLS), and height:auto lets the image render
   at its natural ratio with no cropping and no distortion. The opt-in
   containImage class is preserved on the markup for back-compat but is a
   no-op for layout now that nothing crops. */
.painting-image img,
.dialog-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

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

.painting-card-body {
  padding: 18px;
}

.painting-card-body p {
  font-size: 0.875rem;
  font-weight: 500;
}

.painting-card-body span {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}

.story-copy {
  max-width: 64ch;
}

/* MJ's portrait in the Story composition. The real photograph replaces the
   former decorative reserve: a responsive framed print that keeps its full
   natural 3:4 ratio (object-fit contain, never an aggressive crop), with the
   intrinsic width/height attributes reserving space before the lazy load. */
.artist-portrait {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 250, 246, 0.9);
  box-shadow: var(--shadow);
  object-fit: contain;
}

.artist-story {
  display: grid;
  gap: 18px;
}

.artist-quote {
  margin: 0;
  padding: 28px 24px 22px;
  border-radius: 18px;
  background: rgba(255, 250, 246, 0.9);
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  line-height: 1.1;
  /* A short accent rule above the pull-quote: an editorial mark rather than the
     generic side-tab border, in keeping with the warm atelier-editorial world. */
  box-shadow: inset 0 4px 0 -1px var(--accent);
}

.placeholder-copy,
.contact-card {
  background: rgba(255, 250, 246, 0.82);
}

/* A single genuine testimonial, set as an editorial pull-quote at a readable
   measure. The grid stays one column so future testimonials simply stack. */
.testimonials-grid {
  grid-template-columns: 1fr;
  justify-items: center;
  margin-top: 20px;
}

.testimonials-grid blockquote {
  margin: 0;
  padding: 30px 28px 24px;
  max-width: 62ch;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  line-height: 1.3;
}

.testimonials-grid cite {
  display: block;
  margin-top: 14px;
  font-family: "Hanken Grotesk", sans-serif;
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 740px;
  padding: 28px;
}

label {
  display: grid;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.inline-link {
  color: var(--accent-deep);
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-noscript {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Home preview + section CTAs: a centered primary action that moves the
   visitor from a preview into the dedicated page. */
.gallery-preview-cta {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.books-preview-section {
  margin-top: 28px;
}

/* Home secondary section navigator (Story / Testimonials / Enquire). It is
   secondary to the primary topbar: never a second primary nav. On narrow and
   tablet screens it is a compact wrapped row above the first section; on wide
   screens it becomes a slim sticky vertical rail in the left margin beside the
   page's content column. Active state = weight + 2px underline (shape, not
   colour alone), mirroring the primary nav's current-page treatment. */
.home-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 28px;
}

.home-section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.home-section-nav a:hover {
  color: var(--text);
}

.home-section-nav a[aria-current="true"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

@media (min-width: 1100px) {
  .home-main {
    display: grid;
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 44px;
    align-items: start;
  }

  .home-content {
    display: flow-root;
    grid-column: 2;
  }

  .home-section-nav {
    /* A sticky grid item is constrained to its grid area. The rail and the
       .home-content wrapper are the grid's only two items, so one natural
       row makes the rail's area exactly as tall as the real content: sticky
       for the full page length. No artificial row spans -- spanning ~100
       implicit rows with a 44px grid row-gap injected thousands of px of
       blank space before the footer. */
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 24px;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 8px 0 8px 16px;
    border-left: 1px solid var(--border);
  }
}

/* Book cover frame: a consistent fixed portrait frame and scale for each book
   card. The real cover sits inside with object-fit contain, so the complete
   cover is always visible (no crop) whatever its native ratio; a quiet tonal
   field and the soft spine edge keep the book language. Swapping a cover later
   means replacing the public derivative URL only. */
.book-cover-frame {
  width: min(100%, 210px);
  aspect-ratio: 3 / 4;
  margin: 4px auto 8px;
  border-radius: 6px 14px 14px 6px;
  background:
    linear-gradient(90deg, rgba(154, 92, 75, 0.12), rgba(154, 92, 75, 0) 16%),
    linear-gradient(180deg, rgba(255, 250, 246, 0.92), rgba(242, 230, 223, 0.78));
  box-shadow: inset 0 0 0 1px var(--border);
}

.book-cover-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px 14px 14px 6px;
  object-fit: contain;
}

/* Gallery: compact featured intro sits between the section heading and the
   filter bar, so the Featured / size / All controls are the first interactive
   row of the collection. */
.gallery-featured-note {
  margin: 20px 0 0;
  max-width: 68ch;
  color: var(--muted);
}

.gallery-load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.painting-dialog {
  width: min(920px, calc(100% - 24px));
  /* Short viewports (landscape phones, high zoom): the dialog itself scrolls
     instead of overflowing the screen. dvh wins where supported. */
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  /* Solid, not the translucent card surface: Safari (iPhone) does not blur
     behind a modal dialog, so the gallery text and bottom bar showed through
     the painting details. */
  background: var(--surface-strong);
}

.painting-dialog::backdrop {
  background: rgba(39, 24, 20, 0.42);
  backdrop-filter: blur(6px);
}

/* While the modal painting dialog is open, script.js adds .dialog-open to
   <html>. showModal() already makes the page behind inert; this also stops
   touch devices scrolling the page behind the backdrop. */
html.dialog-open {
  overflow: hidden;
}

.dialog-close {
  justify-self: end;
  align-self: start;
  height: 44px;
  min-width: 44px;
  display: block;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.painting-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 24px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.detail-list div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-list dt,
.detail-list dd {
  margin: 0;
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-content,
  .intro-grid,
  .story-layout,
  .painting-dialog[open],
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* One-column dialog: cap the artwork against the viewport (portrait and
     landscape alike) so a tall painting can never push the details and
     actions off-screen. Ratio is preserved: the image shrinks to fit both
     constraints rather than being cropped or letterboxed. */
  .dialog-image img {
    width: auto;
    max-width: 100%;
    max-height: 52vh;
    max-height: 52dvh;
    margin-inline: auto;
  }

  .stats-panel {
    grid-template-columns: 1fr;
  }

  .hero-preview {
    grid-template-columns: 1fr;
  }

  .preview-large {
    min-height: 240px;
  }
}

@media (max-width: 680px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .hero-actions {
    flex-direction: column;
  }

  /* Narrow screens: the inline links stay hidden; phone navigation moved to
     the fixed bottom bar (see the 760px block below, which covers this band
     too). The legacy <details> disclosure stays in the markup and in the tab
     order only while displayed; it is no longer displayed at any width. */
  .site-nav-links {
    display: none;
  }

  .site-nav-summary {
    min-width: 44px;
    min-height: 44px;
  }

  /* Book cover frames stay modest on small screens (no excessive blank
     height): a narrower cap keeps the portrait frame compact. */
  .book-cover-frame {
    width: min(100%, 180px);
  }

  .hero-copy,
  .hero-card,
  .intro-panel,
  .contact-form,
  .contact-card,
  .painting-dialog {
    padding: 20px;
  }

  h1 {
    max-width: none;
  }

  /* Phone readability: primary reading text and live status messages step up
     to a full 16px+; the small uppercase labels gain a little more size. */
  .painting-card-body p,
  .gallery-results,
  .contact-status,
  .form-hint {
    font-size: 1rem;
  }

  .eyebrow,
  .section-label,
  .hero-card-label {
    font-size: 0.78rem;
  }

  .site-footer-copy {
    font-size: 0.95rem;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Coarse pointers (phones, tablets, touch-screen laptops): the text-only
   inline nav and footer links get a true 44px minimum hit area and a little
   more separation. Pointer-fine desktops keep the compact composition. */
@media (pointer: coarse) {
  .topbar-links a,
  .site-footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .topbar-links {
    gap: 20px;
  }

  .site-footer-nav {
    gap: 6px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .back-to-top,
  .back-to-top:hover {
    transition: none;
    transform: none;
  }

  .button,
  .filter-chip {
    transition: none;
  }

  .button:hover,
  .painting-card:hover {
    transform: none;
  }
}

/* ===========================================================================
   Mobile reading layout — release label: mobile-layout-v2.
   One readable column for every public page at <=760px: a flat masthead with
   the single Menu disclosure, an open editorial hero (no boxed card) with
   stacked full-width actions, hairline section rules for sequencing, a true
   single-column artwork grid with naturally proportioned images, and
   full-width stacked forms/CTAs. Everything lives inside max-width media
   queries appended AFTER the earlier breakpoints, so the desktop composition
   (>=761px) is untouched. The page sheets (gallery.css / books.css) load
   after this file and re-assert their single-column guards in their own
   appended blocks. No inline styles exist on these pages; scripts only
   toggle [hidden]/[open] and dialog-open, all unaffected here.
   =========================================================================== */
@media (max-width: 760px) {
  /* Comfortable lateral padding: 20px per side (16px on the smallest phones,
     see the 380px block below). */
  .page-shell {
    width: min(100% - 40px, 1180px);
    padding-top: 8px;
  }

  /* Masthead: the boxed topbar card becomes a simple full-width header row —
     brand left, the single Menu disclosure right, hairline underneath. */
  .topbar {
    padding: 6px 0 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: none;
    backdrop-filter: none;
  }

  .brand {
    font-size: 1.6rem;
  }

  /* One simple mobile navigation across the whole phone band (the inline
     link row only returns above 760px): the fixed bottom bar replaces both
     the inline row and the legacy Menu disclosure, so there is never a
     second primary nav on phones. */
  .site-nav-links {
    display: none;
  }

  .site-nav-bottom {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* Focused/scrolled elements never park under the fixed bar: scroll
     container padding keeps anchor targets and programmatic focus clear of
     the bar + safe area. */
  html {
    scroll-padding-block-end: calc(var(--site-nav-bottom-space, 60px) + 20px);
  }

  /* Back to Top keeps z-index 40 (above the bar's 30) and is raised above
     the bar so the two fixed controls never overlap; its avoid-zone logic in
     back-to-top.js is unchanged and measures the new position live. */
  .back-to-top {
    bottom: calc(var(--site-nav-bottom-space, 60px) + 16px);
  }

  /* The footer is the last page content: its padding clears the bar and the
     gesture safe area with breathing room. */
  .site-footer {
    padding-bottom: calc(var(--site-nav-bottom-space, 60px) + 28px);
  }

  .site-nav-menu {
    max-width: calc(100vw - 40px);
  }

  /* Hero: open editorial column on the cream ground — no card chrome, no
     inner box padding. Tamer display size (the desktop clamp overwhelms a
     320–430px screen), a slightly larger reading size, and the primary
     actions stacked full-width. */
  .hero {
    padding: 0 0 12px;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding-top: 22px;
  }

  .hero-copy {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    box-shadow: none;
  }

  h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.15rem, 8.5vw, 2.7rem);
    line-height: 1.04;
    max-width: none;
  }

  .eyebrow,
  .section-label,
  .hero-card-label {
    font-size: 0.8rem;
  }

  .hero-text {
    font-size: 1.04rem;
    line-height: 1.7;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
  }

  .hero-actions .button {
    width: 100%;
  }

  /* Artwork previews keep their framed plate but tighten: the large piece
     spans the top, the two smaller ones pair beneath, so the first screen
     reaches the art sooner without a tall stacked run. */
  .hero-stack {
    gap: 14px;
  }

  .hero-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .hero-preview-image {
    min-height: 128px;
    border-radius: 14px;
  }

  .preview-large {
    grid-column: 1 / -1;
    min-height: 230px;
  }

  /* Section sequencing: air plus a hairline rule above every section, and
     space above each heading clearly greater than the gap below it. */
  .section {
    margin-top: 52px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
  }

  .section-heading {
    gap: 10px;
  }

  h2 {
    font-size: clamp(1.9rem, 6vw, 2.25rem);
    line-height: 1.08;
  }

  .section-note,
  .gallery-featured-note {
    font-size: 1rem;
  }

  /* Gallery: one true column across the whole band (the 681–760px stretch
     was still two-up), full-width naturally proportioned artwork, and card
     copy/meta stepped up to legible sizes. */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    margin-top: 24px;
  }

  .painting-card-body {
    padding: 14px 16px 18px;
  }

  .painting-card-body p {
    font-size: 1.05rem;
  }

  .painting-card-body span {
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 0.875rem;
  }

  .gallery-results,
  .contact-status,
  .form-hint {
    font-size: 1rem;
  }

  /* Filter controls read as one clean two-across grid of large tap
     targets (script-built chips land in the same container). */
  .gallery-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gallery-filters .filter-chip {
    width: 100%;
    justify-content: center;
  }

  .gallery-load-more-row .button,
  .gallery-preview-cta .button {
    width: 100%;
  }

  /* Story: bigger portrait, calmer pull-quote measure. */
  .artist-portrait {
    width: min(100%, 340px);
    margin-top: 20px;
  }

  .artist-quote {
    padding: 22px 20px 18px;
    font-size: 1.7rem;
  }

  .testimonials-grid blockquote {
    padding: 24px 20px 20px;
    font-size: 1.45rem;
  }

  /* Forms: full-width, stacked, thumb-sized. */
  .contact-form {
    gap: 14px;
    padding: 22px 18px;
  }

  .contact-form .button {
    width: 100%;
  }

  .painting-dialog {
    padding: 16px;
  }

  #dialog-inquire {
    width: 100%;
  }

  /* Footer: aligned to the same lateral padding, stacked. */
  .site-footer {
    margin-top: 52px;
  }

  .site-footer-inner {
    width: min(100% - 40px, 1180px);
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Smallest phones (320–380px): keep the same column, tighten the gutters and
   the display size so nothing wraps into a wall of headline. */
@media (max-width: 380px) {
  .page-shell {
    width: min(100% - 32px, 1180px);
  }

  .site-nav-menu {
    max-width: calc(100vw - 32px);
  }

  h1 {
    font-size: 2rem;
  }

  .hero-preview {
    padding: 8px;
    gap: 8px;
  }

  .preview-large {
    min-height: 200px;
  }

  .hero-preview-image {
    min-height: 116px;
  }

  .painting-card-body p {
    font-size: 1rem;
  }
}

/* Touch screens (iPhone, iPad, Android): opening a painting moves focus to
   Close by script, and Safari then draws the keyboard ring around it, which
   looks like a glitch. Mouse and keyboard devices keep the ring. */
@media (hover: none) and (pointer: coarse) {
  .dialog-close:focus-visible {
    outline: none;
  }
}
