/* The Gallery, an original's page, the about and print-guide pages, the
   newsletter block, and the shared navigation's mobile layout — on top of
   studio.css's tokens and home.css. The art is the loud thing: no card
   boxes, no badges, small quiet type around large images. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Navigation: Gallery · Studio · About on every screen ---- */
.site-links a[aria-current="page"] { color: var(--text); font-weight: 600; }
@media (max-width: 640px) {
  .site-links { display: flex !important; gap: 18px; }
  .site-links a { font-size: 13px; }
  .site-brand-name { display: none; }
  .site-nav-inner { gap: 16px; }
}

.gal-page { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.gal-intro { padding: 88px 0 24px; max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.gal-intro h1 { font-size: 56px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.gal-intro .lead { max-width: 620px; }

.gal-eyebrow { margin: 0; font-size: 13px; letter-spacing: 0.02em; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.gal-eyebrow a { color: inherit; }
.gal-collection { padding: 56px 0 24px; }
.gal-collection-head { display: grid; gap: 10px; max-width: 760px; margin-bottom: 48px; }
.gal-title { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
.gal-collection-head h1.gal-title { font-size: 48px; }
.gal-title a { color: var(--text); }
.gal-desc { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-secondary); max-width: 640px; }
.gal-count { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* the grid: the art large, a single quiet line under it */
.gal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 72px 48px; align-items: end; }
.gal-card { display: flex; flex-direction: column; gap: 16px; }
.gal-art { display: flex; align-items: flex-end; justify-content: center; }
.gal-art:hover { opacity: 1; }
.gal-art img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; box-shadow: var(--shadow-art); background: var(--bg-alt); transition: transform 0.4s ease; }
.gal-art:hover img { transform: translateY(-3px); }
.gal-card.is-sold .gal-art img { filter: saturate(0.92); }
.gal-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13px; color: var(--text-secondary); }
.gal-label { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.gal-status { color: var(--text-secondary); }
.gal-card.is-sold .gal-status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--text); vertical-align: 1px; }
.gal-action { margin-left: auto; color: var(--accent); white-space: nowrap; }

.gal-pager { display: flex; justify-content: space-between; gap: 16px; padding: 48px 0 0; font-size: 15px; }
.gal-past { padding: 96px 0 24px; border-top: 1px solid var(--border); margin-top: 96px; }
.gal-past h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 40px; }
.gal-past ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 56px; }
.gal-past-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.gal-past-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: end; }
.gal-past-strip img { width: 100%; height: auto; display: block; box-shadow: var(--shadow-art); }
.gal-past-item h3 { font-size: 21px; font-weight: 600; margin: 6px 0 0; }
.gal-past-item h3 a { color: var(--text); }
.gal-empty { padding: 32px 0 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; font-size: 19px; color: var(--text-secondary); }
.gal-empty p { margin: 0; max-width: 560px; }

/* ---- An original's page ---- */
.art-page { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 72px; padding: 64px 0 40px; align-items: start; }
.art-stage-col { position: sticky; top: calc(var(--nav-h) + 24px); display: flex; flex-direction: column; gap: 16px; }
.art-stage { position: relative; background: var(--bg-alt); border-radius: var(--r-md); padding: 7%; display: flex; align-items: center; justify-content: center; min-height: 360px; }
.art-stage img { display: block; max-width: 100%; max-height: 74vh; width: auto; height: auto; box-shadow: var(--shadow-art); }
.art-room { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; border-radius: var(--r-sm); }
.art-stage:has(.art-room:not([hidden])) { padding: 0; background: none; }
.art-room-status { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; padding: 6px 14px; border-radius: var(--r-pill); background: rgba(255,255,255,0.9); font-size: 13px; color: var(--text-secondary); }
.art-views { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.art-view { min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--bg); color: var(--text); font: 400 14px var(--font); cursor: pointer; }
.art-view[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: #fff; }
.art-wall-note { margin: 0; text-align: center; font-size: 13px; }

.art-side { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.art-title { font-size: 48px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.art-sub { margin: -6px 0 0; font-size: 15px; color: var(--text-secondary); }
.art-id { font-variant-numeric: tabular-nums; }
.art-availability { margin: 0; font-size: 15px; font-weight: 600; }
.art-availability::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--text); vertical-align: 1px; }
.art-availability.is-available::before { background: #2f7d4f; }
.art-buy, .art-sold { display: flex; flex-direction: column; gap: 14px; padding: 24px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.art-price { margin: 0; font-size: 15px; color: var(--text-secondary); }
.art-price b { font-size: 32px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; margin-right: 6px; }
.art-buy-status { margin: 0; min-height: 18px; font-size: 14px; color: var(--text-secondary); }
.art-state { margin: 0; font-size: 17px; font-weight: 600; }
.art-sold .muted { margin: 0; font-size: 15px; }
.art-facts { margin: 0; display: grid; gap: 18px; font-size: 14px; line-height: 1.55; }
.art-facts dt { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.art-facts dd { margin: 0; color: var(--text-secondary); }
.art-sizes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.art-sizes b { font-weight: 600; color: var(--text); margin-right: 6px; }
.art-guide, .art-share { margin: 0; font-size: 15px; }

/* ---- Newsletter: one quiet block ---- */
.newsletter { max-width: 640px; margin: 120px auto 0; padding: 72px 0 96px; border-top: 1px solid var(--border); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.newsletter h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.newsletter > p { margin: 0; color: var(--text-secondary); font-size: 17px; line-height: 1.5; max-width: 520px; }
.newsletter-form { display: flex; gap: 10px; width: 100%; max-width: 460px; margin-top: 10px; }
.newsletter-form .input { flex: 1 1 auto; min-width: 0; }
.newsletter-form .btn { flex: 0 0 auto; }
.newsletter .newsletter-fine { font-size: 13px; }
.newsletter .newsletter-status { min-height: 20px; font-size: 15px; color: var(--text); }

/* ---- Homepage (new sections) ---- */
.home-hero .hero-note { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); }
.home-latest { max-width: 1180px; margin: 0 auto; padding: 56px 24px 40px; }
.home-latest .gal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px 32px; }
.home-latest .gal-grid .gal-card:nth-child(n + 9) { display: none; }
.home-latest-foot { display: flex; justify-content: center; margin-top: 56px; }
.home-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; max-width: 1100px; margin: 0 auto; padding: 120px 24px; }
.home-path { display: flex; flex-direction: column; gap: 12px; }
.home-path img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); background: var(--bg-alt); margin-bottom: 12px; }
.home-path h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.home-path p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--text-secondary); max-width: 460px; }
.home-path .price { color: var(--text); font-weight: 600; }
.home-artist { max-width: 760px; margin: 0 auto; padding: 140px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.home-artist h2 { font-size: 40px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.home-artist p { margin: 0; font-size: 19px; line-height: 1.55; color: var(--text-secondary); }

/* ---- About and the print guide ---- */
.prose-page { max-width: 720px; margin: 0 auto; padding: 88px 24px 40px; font-size: 18px; line-height: 1.65; }
.prose-page h1 { font-size: 52px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.06; margin-bottom: 28px; }
.prose-page h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; margin: 56px 0 12px; }
.prose-page p, .prose-page li { color: var(--text); }
.prose-page .lead { font-size: 22px; color: var(--text-secondary); margin-bottom: 8px; }
.prose-page ol, .prose-page ul { padding-left: 22px; }
.prose-page li { margin-bottom: 10px; }
.guide-steps { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 32px 0 8px; }
.guide-steps li { margin: 0; }
.guide-steps b { display: block; font-size: 19px; margin-bottom: 4px; }
.guide-steps span { font-size: 15px; color: var(--text-secondary); line-height: 1.5; }
.size-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.size-table th, .size-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.size-table th { font-weight: 600; white-space: nowrap; }
.size-table td { color: var(--text-secondary); }

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .home-latest .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-latest .gal-grid .gal-card:nth-child(n + 7) { display: none; }
}
@media (max-width: 900px) {
  .art-page { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 24px; }
  .art-stage-col { position: static; }
  .art-stage img { max-height: 64vh; }
  .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 20px; }
  .home-paths { grid-template-columns: minmax(0, 1fr); gap: 72px; padding: 96px 20px; }
  .gal-past-item { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .gal-page { padding: 0 16px; }
  .gal-intro { padding: 48px 0 8px; }
  .gal-intro h1, .prose-page h1 { font-size: 38px; }
  .gal-collection { padding-top: 40px; }
  .gal-collection-head { margin-bottom: 32px; }
  .gal-collection-head h1.gal-title { font-size: 34px; }
  .gal-title { font-size: 28px; }
  .gal-grid, .home-latest .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 14px; }
  .home-latest .gal-grid .gal-card:nth-child(n + 5) { display: none; }
  .gal-meta { font-size: 12px; gap: 2px 10px; }
  .gal-action { margin-left: 0; flex-basis: 100%; }
  .art-title { font-size: 38px; }
  .art-stage { padding: 6%; min-height: 0; }
  .home-latest { padding: 16px 16px 24px; }
  .home-artist { padding: 96px 20px 24px; }
  .home-artist h2 { font-size: 32px; }
  .newsletter { margin-top: 80px; padding: 56px 4px 72px; }
  .newsletter-form { flex-direction: column; }
  .prose-page { padding: 56px 20px 24px; font-size: 17px; }
  .guide-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .gal-art img { transition: none; } }

.how-steps.how-steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1100px; }
.home-gen-links { font-size: 15px !important; color: var(--text-secondary); }
@media (max-width: 900px) { .how-steps.how-steps-4 { grid-template-columns: minmax(0, 1fr); } }

/* ---- Studio: the bar that keeps "Make it mine" in reach on phones and tablets (Create step only) ---- */
.studio-buybar { display: none; }
@media (max-width: 900px) {
  html[data-step="create"] .studio-buybar {
    display: flex; align-items: center; gap: 14px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--nav-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
  }
  .studio-buybar .btn { flex: 1 1 auto; min-height: 48px; }
  .studio-buybar-guide { flex: 0 0 auto; font-size: 13px; color: var(--text-secondary); }
  html[data-step="create"] main.studio-main { padding-bottom: 120px; }
}
.is-studio .site-links { margin-right: 4px; }

/* ---- Touch screens: every control at least 44 × 44 px to the finger (WCAG 2.5.5), however small it looks ---- */
@media (pointer: coarse), (max-width: 900px) {
  .site-brand { min-height: 44px; min-width: 44px; }
  .site-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 2px; }
  .nav-step { min-height: 44px; padding: 0 2px; }
  .size-pill { min-height: 44px; }
  input[type="range"] { height: 44px; }
  .studio-buybar-guide, .gal-action, .art-guide a, .site-footer-links a, .gal-pager a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .art-share .btn { min-height: 44px; }
  a.link-cta { display: inline-flex; align-items: center; gap: 0.25em; min-height: 44px; }
}

/* ---- Studio on phones: the art docked at the top while the controls scroll under it (public/studio-app/9b-dock.js) ---- */
.art-dock[hidden] { display: none !important; }
.art-dock {
  position: fixed; left: 0; right: 0; top: calc(var(--nav-h) + var(--steps-h)); z-index: 24;
  height: 32svh; padding: 10px 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt);
  background: color-mix(in srgb, var(--bg-alt) 94%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.art-dock-btn { display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.art-dock-btn canvas { display: block; max-width: 100%; max-height: 100%; box-shadow: var(--shadow-art); }
@media (prefers-reduced-motion: no-preference) { .art-dock { animation: dock-in 0.18s ease-out; } }
@keyframes dock-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
html.art-docked { scroll-padding-top: calc(var(--nav-h) + var(--steps-h) + 32svh + 16px); }

/* The artist's photo, on the About page only */
.about-photo { margin: 36px 0 12px; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); }
/* (beside the first paragraph, which wraps around it; the section after it starts below) */
@media (min-width: 641px) {
  .about-photo { float: left; width: 200px; margin: 8px 28px 12px 0; }
  .prose-page h2 { clear: left; }
}
@media (max-width: 640px) { .about-photo img { max-width: 70%; } }

/* ---- Touch screens: no frosted-glass blur. Phones recompute a backdrop blur on every frame of a scroll (and
   under a live camera in Creator Mode), the main cause of jank there; near-opaque surfaces look the same. ---- */
@media (pointer: coarse) {
  .site-nav, .steps-bar, .studio-buybar, .art-dock { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .site-nav, .steps-bar, html[data-step="create"] .studio-buybar { background: rgba(255, 255, 255, 0.97); }
  .art-dock { background: var(--bg-alt); }
}

/* Murmur is still (since 1 Dec 2026): no Play / Pause over the artwork, only Orbit and Rotate */
#flockPlay { display: none !important; }

/* ---- The site's loading indicator (public/loader.js): a thin ring with the percentage, centred on what's loading ---- */
.sm-loader {
  position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%);
  width: 76px; height: 76px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.25);
  pointer-events: none; transition: opacity 0.3s ease;
}
.sm-loader[hidden] { display: none; }
.sm-loader svg { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); transform: rotate(-90deg); }
.sm-loader-track { fill: none; stroke: var(--fill); stroke-width: 3; }
.sm-loader-arc { fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.12s linear; }
.sm-loader-pct { position: relative; font: 600 14px var(--font); font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -0.01em; }
.sm-loader.is-done { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .sm-loader-arc { transition: none; } }
/* (the studio's old "Drawing…" line: still there for its state, shown as the ring instead) */
.compute-note { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; padding: 0 !important; }
.sm-loader-source { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; padding: 0 !important; margin: 0 !important; }
/* in the flow of a page (the download page's progress), not over an artwork */
.sm-loader.is-inline { position: relative; left: auto; top: auto; transform: none; flex: 0 0 auto; box-shadow: none; background: none; }

/* the studio's "couldn't load" notice, over the canvas (public/studio-app/1-core.js: studioLoadFailed) */
.studio-load-failed { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: min(280px, 80%); padding: 18px; border-radius: var(--r-md); background: rgba(255,255,255,0.96); box-shadow: 0 8px 24px -10px rgba(0,0,0,0.3); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.studio-load-failed[hidden] { display: none; }
.studio-load-failed p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); }

/* "Make it a pair" in the cart drawer (public/studio-app/7-cart.js) */
.pair-offer { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--r-md); background: var(--bg-alt); }
.pair-offer-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pair-offer-title { font-size: 15px; font-weight: 600; }
.pair-offer-text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
.pair-offer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; }
.pair-offer-actions .pair-add { font-size: 15px; padding: 10px 18px; min-height: 44px; }
.pair-offer-actions .pair-skip { font-size: 13px; min-height: 44px; }
.pair-offer-status { margin: 0; font-size: 13px; color: var(--text-secondary); min-height: 0; }
.pair-offer .cart-line-thumb { background: var(--bg); width: 72px; height: 72px; flex-basis: 72px; }
.pair-offer .cart-line-thumb canvas { max-height: 58px; }
.cart-line-free { display: block; font-size: 12px; color: var(--accent); font-weight: 500; text-align: right; }
