/* ==========================================================================
   Editorial Artwork Monograph (Jerin / Koak Reference Architecture)
   ========================================================================== */

html, body.monograph-body {
  background-color: #ffffff;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  transition: background-color 0.3s ease;
  /* NO `forwards` here. The keyframes end on `transform: translateY(0)`, and a
     filled animation keeps applying it forever. ANY transform value other than
     `none` turns <html>/<body> into the containing block for every
     `position: fixed` descendant, so full-screen overlays (the artist bio
     modal, mobile nav drawer, search palette, cookie banner) get sized against
     the whole 3-4k px document instead of the viewport and land far below the
     fold. Default `fill-mode: none` reverts to the base styles at 0.7s, which
     are already opacity 1 / no transform, so the entrance looks identical. */
  animation: monographPageIn 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes monographPageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] body.monograph-body {
  background-color: #01142e;
}

.monograph-stage-root {
  max-width: 1360px;
  margin: 0 auto;
  padding: 90px 24px 100px;
  position: relative;
}

/* --- 1. Overhead Linear Spotlight Rig --- */
.monograph-light-rig {
  position: relative;
  width: min(340px, 60vw);
  margin: 0 auto 28px;
  height: 4px;
  display: flex;
  justify-content: center;
}

.spotlight-bar-fixture {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #ede8d5 100%);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(254, 228, 81, 0.45), 0 0 24px rgba(255, 255, 255, 0.9);
}

.spotlight-beam-cone {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, 90vw);
  height: 480px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(180deg, rgba(255, 250, 235, 0.22) 0%, rgba(255, 250, 235, 0.05) 55%, transparent 88%);
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .spotlight-beam-cone {
  background: linear-gradient(180deg, rgba(254, 228, 81, 0.16) 0%, rgba(2, 155, 189, 0.04) 55%, transparent 88%);
}

/* --- 2. Calligraphic Stroke Unveiling Stage --- */
.calligraphy-stage-wrap {
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: 32px;
}

.calligraphy-artist-name {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-coral);
  margin-bottom: 6px;
  opacity: 0;
  transform: translateY(-8px);
  animation: fadeArtist 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes fadeArtist {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.svg-cursive-title-box {
  width: min(920px, 94vw);
  margin: 0 auto;
  position: relative;
  height: clamp(90px, 16vw, 170px);
  overflow: hidden; /* contains long titles at the box edge instead of bleeding off the viewport */
}

.title-script-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Animated Flourish Underlay */
.flourish-path {
  fill: none;
  stroke: var(--accent-coral);
  stroke-width: 1.5;
  stroke-dasharray: 1900;
  stroke-dashoffset: 1900;
  opacity: 0.42;
  animation: drawFlourish 2.2s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

/* Dynamic SVG Cursive Title Stroke Drawing */
.script-title-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 800;
  font-size: clamp(26px, 5vw, 60px);
  letter-spacing: -0.01em;
  fill: transparent;
  stroke: var(--text-main);
  stroke-width: 1.4px;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawScriptTitle 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

[data-theme="dark"] .script-title-text {
  stroke: #fdfad9;
  animation-name: drawScriptTitleDark;
}

@keyframes drawFlourish {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawScriptTitle {
  55% {
    stroke-dashoffset: 0;
    fill: transparent;
  }
  100% {
    stroke-dashoffset: 0;
    fill: #012350;
    stroke-width: 0.4px;
  }
}

@keyframes drawScriptTitleDark {
  55% {
    stroke-dashoffset: 0;
    fill: transparent;
  }
  100% {
    stroke-dashoffset: 0;
    fill: #fdfad9;
    stroke-width: 0.4px;
  }
}

/* --- 3. Monumental Hero Canvas --- */
.monumental-canvas-mount {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 12px 0 48px;
  perspective: 1400px;
}

.canvas-monolith-frame {
  margin: 0;
  position: relative;
  width: min(1040px, 92vw);
  /* No fixed min-height here anymore — a static 70vh forced empty
     black space below any image whose real rendered height came in
     shorter than that (true for most square-ish pieces on a narrow
     mobile width). The frame now hugs the image's actual height. */
  background: #151515;
  border-radius: 4px;
  box-shadow: 
    0 32px 64px rgba(1, 35, 80, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.canvas-monolith-frame:not(:has(.monolith-image.is-loaded)) {
  /* Placeholder height ONLY while the image is loading (so the
     shimmer has somewhere to render) — this rule stops applying the
     instant .is-loaded lands, letting the frame shrink to fit. */
  min-height: 46vh;
}

@media (max-width: 640px) {
  .canvas-monolith-frame:not(:has(.monolith-image.is-loaded)) {
    min-height: 34vh;
  }
}

.canvas-monolith-frame:not(:has(.monolith-image.is-loaded))::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: monolithShimmer 1.6s ease-in-out infinite;
}

@keyframes monolithShimmer {
  0% { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

[data-theme="dark"] .canvas-monolith-frame {
  box-shadow: 
    0 36px 72px rgba(0, 0, 0, 0.75),
    0 14px 28px rgba(0, 0, 0, 0.55);
}

.monolith-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.monolith-image.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.canvas-wall-shadow {
  position: absolute;
  bottom: -28px;
  left: 6%;
  right: 6%;
  height: 24px;
  border-radius: 50%;
  background: rgba(1, 35, 80, 0.22);
  filter: blur(14px);
  pointer-events: none;
}

[data-theme="dark"] .canvas-wall-shadow {
  background: rgba(0, 0, 0, 0.65);
}

/* --- 4. Quaint Technical Specifications Strip --- */
.quaint-specs-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin: 0 auto 96px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-subtle);
  max-width: 820px;
}

.spec-provenance {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.spec-main-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}

.spec-separator {
  color: var(--accent-coral);
  font-weight: 800;
}

.spec-valuation-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.spec-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
}

.spec-status-pill {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(2, 155, 189, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(2, 155, 189, 0.25);
}

.spec-status-pill.is-sold {
  background: rgba(242, 65, 93, 0.12);
  color: var(--accent-coral);
  border-color: rgba(242, 65, 93, 0.25);
}

.spec-status-pill.is-reserved {
  background: rgba(254, 228, 81, 0.15);
  color: #fee451;
  border-color: rgba(254, 228, 81, 0.4);
}

/* Master Image Dimmed/Blurred while Held */
.monolith-image.is-held {
  filter: grayscale(60%) blur(3.5px) brightness(0.65);
}

/* --- Background Scroll-Drawn Botanical Scribble --- */
.botanical-scribble-stage {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, 98vw);
  pointer-events: none;
  z-index: 1;
  overflow: visible;
  opacity: 0.85;
}

.botanical-scribble-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.scribble-scroll-stroke {
  fill: none;
  stroke: url(#scribbleGradient);
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(242, 65, 93, 0.2));
  will-change: stroke-dashoffset;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .scribble-scroll-stroke {
  filter: drop-shadow(0 0 10px rgba(254, 228, 81, 0.28));
}

/* --- 5. Asymmetric Editorial Inspection Spread (Jerin Reference) --- */
.monograph-inspection-spread {
  display: flex;
  flex-direction: column;
  gap: 120px;
  max-width: 1200px;
  margin: 0 auto 120px;
  position: relative;
  z-index: 2; /* Keeps all crops, narrative text, and buttons elevated above the stroke */
}

/* Layout 1: Right-Aligned Variable Crop with Left Editorial Prose */
.editorial-spread-row {
  display: grid;
  align-items: center;
  gap: 56px;
}

.spread-align-right {
  grid-template-columns: 1.15fr 1fr;
}

/* Gives Slot 3 more visual presence across the row */
.spread-align-right.spread-slot-3 {
  grid-template-columns: 0.95fr 1.25fr;
}

.spread-align-left {
  grid-template-columns: 1fr 1.15fr;
}

.spread-align-stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* Variable-Aspect Container: Base Box */
.crop-natural-frame {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #111;
  box-shadow: 0 20px 48px rgba(1, 35, 80, 0.1);
  justify-self: center;
  transition: transform 0.4s ease;
}

/* Balanced Standard Crops (0.7 <= ratio <= 1.6): Enlarged from 380px to 480px */
.crop-natural-frame.is-balanced {
  width: 100%;
  max-width: 480px;
  max-height: clamp(380px, 50vh, 480px);
}

/* Wide Panoramic Crops (ratio > 1.6): Allowed to expand comfortably */
.crop-natural-frame.is-wide {
  width: 100%;
  max-width: 560px;
  max-height: 380px;
}

/* Tall Narrow Strips (ratio < 0.7): Fixed height anchor prevents vertical runaway */
.crop-natural-frame.is-tall {
  height: clamp(380px, 48vh, 480px);
  width: auto;
  max-width: 320px;
}

.spread-align-stacked .crop-natural-frame {
  max-width: 520px;
}

.crop-zoom-engine-img {
  position: absolute;
  max-width: none;
  max-height: none;
  display: block;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.crop-natural-frame:hover .crop-zoom-engine-img {
  transform: scale(1.03);
}

/* Editorial Floating Typography (Jerin Style) */
.editorial-prose-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.editorial-pull-lead {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.editorial-narrative-body {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.editorial-materiality-note {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--accent-coral);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* --- 6. Minimal Stacked Floor Action Cluster --- */
.monograph-floor-actions {
  display: flex;
  justify-content: center;
  padding: 40px 0 40px;
  border-top: 1px solid var(--border-subtle);
}

.floor-actions-stack {
  display: flex;
  flex-direction: column; /* Stacked layout */
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 440px;
}

.btn-primary-acquire {
  width: 100%;
  background: var(--accent-coral);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 18px 36px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(242, 65, 93, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary-acquire:hover {
  background: #fee451;
  color: #012350;
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(254, 228, 81, 0.4);
}

.btn-primary-acquire:disabled {
  background: #3a4b63 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-secondary-return {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none !important;
  padding: 10px 20px;
  border-radius: 999px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.btn-secondary-return:hover {
  color: var(--accent-coral);
  transform: translateX(-4px);
}

/* --- Scroll Reveal Animations --- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .spread-align-right,
  .spread-align-left {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .monograph-stage-root {
    padding: 82px 16px 60px;
  }
  .monograph-inspection-spread {
    gap: 72px;
  }
  .crop-natural-frame {
    max-width: 320px;
  }
  .spread-align-stacked .crop-natural-frame {
    max-width: 360px;
  }
  .svg-cursive-title-box {
    height: clamp(64px, 24vw, 120px);
  }
}

@media (max-width: 480px) {
  .crop-natural-frame {
    max-width: 260px;
  }
  .spread-align-stacked .crop-natural-frame {
    max-width: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html, body.monograph-body {
    animation: none !important;
  }
  .canvas-monolith-frame::after {
    animation: none !important;
  }
  .flourish-path,
  .script-title-text,
  .calligraphy-artist-name,
  .reveal-on-scroll,
  .monolith-image {
    animation: none !important;
    transition: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    fill: var(--text-main) !important;
  }
}