:root {
  --bg: #f4ecde;
  --paper: rgba(255, 250, 242, 0.92);
  --ink: #111111;
  --muted: #635b50;
  --line: rgba(17, 17, 17, 0.14);
  --shadow: 0 22px 72px rgba(49, 33, 18, 0.12);
  --max: 1200px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(204, 91, 55, 0.12), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(12, 123, 103, 0.14), transparent 22%),
    linear-gradient(180deg, #fbf6ef 0%, var(--bg) 45%, #ede0cb 100%);
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 88%);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.shell { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(251, 246, 239, 0.78);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-mark, .button, .catalog-card, .hero-panel, .info-card, .product-image-stage, .product-panel, .product-note, .checkout-card, input, textarea { border-radius: 0; }
.brand-mark {
  width: 2.5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff7ea;
  font-family: "Bebas Neue", sans-serif;
  font-size: 0.78rem;
  line-height: 0.85;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  padding-top: 0.08rem;
}
nav { display: flex; align-items: center; gap: 1.3rem; color: var(--muted); font-size: 0.95rem; }
.basket-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.basket-nav-icon {
  font-size: 1.05rem;
  line-height: 1;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.15rem;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  cursor: pointer;
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--ink); color: #fff7ea; box-shadow: 0 16px 40px rgba(17, 17, 17, 0.18); }
.button-secondary { background: rgba(255, 255, 255, 0.54); border-color: var(--line); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  background: rgba(255, 251, 245, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: "Bebas Neue", sans-serif; line-height: 0.94; letter-spacing: 0.03em; }
h1 { font-size: clamp(4rem, 10vw, 8rem); }
h2 { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.lead, .section-copy, .info-card p, .product-note p, .product-panel p, .checkout-card p, .checkout-note, label {
  color: var(--muted);
  line-height: 1.65;
}
.lead { font-size: 1.08rem; max-width: 42rem; margin: 1rem 0 1.6rem; }
.hero, .product-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
  padding: 3rem 0 4rem;
}
.hero-actions, .product-actions, .checkout-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.hero-panel, .info-card, .product-image-stage, .product-panel, .product-note, .checkout-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 14px 44px rgba(42, 24, 8, 0.08);
}
.hero-panel, .product-image-stage { padding: 1rem; box-shadow: var(--shadow); }
.hero-carousel { display: grid; gap: 0.7rem; }
.hero-panel-art { aspect-ratio: 2 / 1; background-size: cover; background-position: center; }
.catalog-image {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}
.hero-panel-art {
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
  will-change: opacity, transform, filter;
}
.hero-panel-art.is-fading {
  opacity: 0;
  transform: scale(1.015);
  filter: saturate(0.88) contrast(0.96);
}
.hero-carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.hero-carousel-button,
.hero-carousel-counter {
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: rgba(255, 251, 245, 0.78);
  color: var(--muted);
  backdrop-filter: blur(8px);
}
.hero-carousel-button {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}
.hero-carousel-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 251, 245, 0.94);
  color: var(--ink);
}
.hero-carousel-counter {
  flex: 1;
  text-align: center;
  padding: 0.48rem 0.75rem;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-carousel-progress {
  height: 0.25rem;
  background: rgba(17, 17, 17, 0.12);
  overflow: hidden;
}
.hero-carousel-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(17, 17, 17, 0.42), rgba(17, 17, 17, 0.86));
  transform-origin: left center;
  transform: scaleX(0);
}
.hero-carousel-progress-fill.is-running {
  animation: heroProgress var(--hero-interval, 5000ms) linear forwards;
}
@keyframes heroProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.section-copy { max-width: 38rem; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.catalog-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.catalog-media-link { display: block; }
.catalog-copy { padding: 1rem; display: grid; gap: 0.7rem; }
.catalog-row, .checkout-summary, .product-meta { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.catalog-row h3 { font-size: 1.05rem; line-height: 1.2; }
.catalog-title-link:hover { text-decoration: underline; }
.catalog-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.75rem;
}
.catalog-add-button {
  min-width: 3rem;
  min-height: 3rem;
  padding: 0;
  background: var(--ink);
  color: #fff7ea;
  font-size: 1.8rem;
  line-height: 1;
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.18);
}
.catalog-add-button:hover {
  background: #202020;
}
.catalog-id, .meta-label { font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.price-tag, .checkout-price {
  font-family: "Bebas Neue", sans-serif;
  line-height: 0.9;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.price-tag { font-size: 2rem; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.info-card { padding: 1.2rem; }
.info-card h3 { font-size: 1.08rem; margin-bottom: 0.5rem; }
.product-image-stage { display: grid; align-items: center; }
.product-image { width: 100%; height: auto; }
.product-panel { padding: 1.2rem; display: grid; gap: 1rem; }
.meta-block { display: grid; gap: 0.25rem; }
.meta-block strong, .summary-title { color: var(--ink); }
.product-note { padding: 1rem 1.2rem; }
.basket-section { padding-bottom: 4rem; }
.basket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.72fr);
  gap: 1rem;
  align-items: start;
}
.basket-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.basket-items {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0;
}
.basket-empty { color: var(--muted); line-height: 1.6; }
.basket-item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(255, 251, 245, 0.62);
}
.basket-item img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}
.basket-item-copy {
  display: grid;
  gap: 0.25rem;
}
.basket-item-copy span { color: var(--muted); }
.basket-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}
.basket-total strong { font-size: 1.25rem; }

/* compact checkout header (replaces the old full-screen hero) */
.checkout-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 2.4rem;
  padding-bottom: 0.4rem;
}
.checkout-head-titles { display: grid; gap: 0.8rem; }
.checkout-head h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0; line-height: 0.95; }

/* per-line quantity + remove controls */
.basket-item-unit { font-size: 0.85rem; }
.basket-item-total { align-self: start; }
.basket-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}
.qty-btn {
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.qty-btn:hover { background: var(--ink); color: var(--bg); }
.qty-value { min-width: 1.5rem; text-align: center; font-weight: 600; }
.basket-remove {
  margin-left: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.basket-remove:hover { color: var(--ink); }
.basket-clear-link {
  margin-top: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.basket-clear-link:hover { color: var(--ink); }

/* small form heading on the dark checkout card */
.checkout-form-label {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.checkout-hint { font-size: 0.9rem; line-height: 1.55; margin: 0 0 1.3rem; }
.payment-success-ship { font-size: 0.9rem; line-height: 1.5; margin: 0; }

.checkout-section { padding-bottom: 4rem; }
.checkout-card {
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.96), rgba(12, 123, 103, 0.88));
  color: #fff7ea;
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.checkout-card.is-payment-success .checkout-flow { display: none; }
.checkout-card p, .checkout-card label, .checkout-note { color: rgba(255, 247, 234, 0.78); }
.checkout-eyebrow {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 247, 234, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
}
.checkout-grid { display: grid; gap: 1rem; margin-top: 1.2rem; }
.checkout-actions { display: grid; grid-template-columns: 1fr; }
.paypal-smart-buttons { min-height: 0; }
.paypal-smart-buttons:empty { display: none; }
.payment-success-screen { display: grid; gap: 1rem; }
.payment-success-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(255, 247, 234, 0.16);
  background: rgba(255, 255, 255, 0.06);
}
.payment-success-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}
.payment-success-row span {
  color: rgba(255, 247, 234, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}
.payment-success-lines {
  display: grid;
  gap: 0.45rem;
  color: #fff7ea;
}
.payment-success-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 247, 234, 0.1);
}
.payment-success-line:first-child {
  padding-top: 0;
  border-top: 0;
}
.payment-success-line span { color: rgba(255, 247, 234, 0.78); }
.payment-success-total strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.6rem;
  line-height: 0.9;
  letter-spacing: 0.03em;
}
.payment-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.field { display: grid; gap: 0.45rem; }
input, textarea {
  width: 100%;
  border: 1px solid rgba(255, 247, 234, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff7ea;
  padding: 0.85rem 0.95rem;
  font: inherit;
}
textarea { min-height: 8rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(255, 247, 234, 0.52); }
.checkout-summary {
  padding: 0.9rem 0;
  border-top: 1px solid rgba(255, 247, 234, 0.16);
  border-bottom: 1px solid rgba(255, 247, 234, 0.16);
}
.checkout-price { font-size: 3rem; }
.paypal-button { background: #ffc439; color: #111111; border-color: #ffc439; }
.footer-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  flex-wrap: wrap;
}
.reveal { opacity: 0; transform: translateY(18px); animation: rise 700ms ease forwards; }
.delay-0 { animation-delay: 0ms; }
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@media (max-width: 980px) {
  .hero, .product-hero, .info-grid, .basket-layout { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: start; }
  .hero-home > :first-child { order: 2; }
  .hero-home > :last-child { order: 1; }
  .hero-home { padding-top: 1.25rem; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  nav { width: 100%; justify-content: space-between; overflow-x: auto; }
  .catalog-grid, .info-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(3.6rem, 18vw, 5.8rem); }
  .checkout-summary, .catalog-row, .product-meta { flex-direction: column; align-items: start; }
  .basket-item { grid-template-columns: 1fr; }
  .payment-success-row, .payment-success-line { flex-direction: column; }
  .footer-bar { flex-direction: column; }
}

/* ============================================================
   Artwork detail page — 3D viewer hero + product panel
   ============================================================ */
.artwork-page { padding-bottom: 4rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1.6rem;
  padding-bottom: 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }

/* --- full-width 3D viewer --- */
.art-stage-section {
  width: min(100% - 3rem, var(--max));
  margin: 0.6rem auto 0;
}
.art-viewer {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
#ppc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 360px;
  background: #0c0d11;
  cursor: grab;
  touch-action: none;
  overflow: hidden;
}
#ppc-stage.grabbing { cursor: grabbing; }
#ppc-stage canvas { display: block; width: 100% !important; height: 100% !important; }

/* loading spinner — shown until the full-res texture is on the canvas */
#ppc-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.art-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: art-spin 0.8s linear infinite;
}
@keyframes art-spin { to { transform: rotate(360deg); } }
#ppc-stage.is-live #ppc-loader { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .art-spinner { animation-duration: 1.6s; }
}

#ppc-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
  pointer-events: none;
  font-weight: 700;
  z-index: 2;
}

/* --- product panel below the viewer --- */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.62fr);
  gap: 2rem;
  align-items: start;
  padding-top: 2.6rem;
}
.product-info h1 { margin: 0.6rem 0 0; }
.art-badge {
  display: inline-block;
  padding: 0.34rem 0.7rem;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.product-info .lead { margin: 1rem 0 1.8rem; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
}
.spec-item { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.spec-item:nth-child(odd) { border-right: 1px solid var(--line); }
.spec-item:nth-last-child(-n + 2) { border-bottom: 0; }
.spec-item dt {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.spec-item dd { margin: 0; color: var(--ink); font-weight: 500; }

/* --- buy box --- */
.buy-box {
  position: sticky;
  top: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: grid;
  gap: 1.1rem;
}
.buy-price { display: grid; gap: 0.2rem; }
.buy-price .meta-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.buy-price strong { font-size: 2rem; line-height: 1; }
.buy-box .product-actions { display: grid; gap: 0.6rem; }
.buy-box .button { width: 100%; text-align: center; }
.buy-cert {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 500;
}
.cert-mark { color: var(--ink); font-weight: 700; }
.buy-status { font-size: 0.86rem; color: var(--muted); margin: 0; line-height: 1.5; }
.buy-status:empty { display: none; }

/* --- AI / long-form story section --- */
.artwork-story {
  padding-top: 2.8rem;
  margin-top: 2.6rem;
  border-top: 1px solid var(--line);
}
.story-heading {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1rem;
}
.story-body { max-width: 46rem; }
.story-body > :first-child { margin-top: 0; }
.story-body p {
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 1.1rem;
  font-size: 1.04rem;
}
.story-body h2, .story-body h3 {
  color: var(--ink);
  margin: 1.8rem 0 0.6rem;
}
.story-body a { color: var(--ink); text-underline-offset: 3px; }
.story-body ul, .story-body ol { color: var(--muted); line-height: 1.7; padding-left: 1.2rem; }

@media (max-width: 980px) {
  .product-detail { grid-template-columns: 1fr; }
  .buy-box { position: static; }
}
@media (max-width: 560px) {
  .spec-grid { grid-template-columns: 1fr; }
  .spec-item { border-right: 0 !important; }
}
