/* ==========================================================================
   YAR STUDIO — HERO INTEGRATION STYLESHEET
   Typography System V2 & Full-Viewport Cinematic Hero Architecture
   ========================================================================== */

:root {
  /* --- Typography System V2 Tokens --- */
  --font-clio: 'Clio', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-harietta: 'Harietta', 'Cormorant Garamond', 'Bodoni Moda', 'Playfair Display', Georgia, serif;

  /* --- Color Palette (YAR System V2) --- */
  --color-primary: #1E1B1A;      /* Soft Black */
  --color-secondary: #3E3934;    /* Warm Charcoal */
  --color-muted: #6B655E;        /* Subtle Warm Gray */
  --color-canvas-bg: #E3E2DE;    /* Calibrated Studio Wall Warm Concrete Tone */

  /* --- Fluid Typography Scales --- */
  --type-display-xl: clamp(3.2rem, 5.8vw, 6.8rem);
  --type-display-lg: clamp(2.2rem, 4vw, 4.5rem);
  --type-headline-clio: clamp(1.15rem, 1.7vw, 1.65rem);
  --type-nav: clamp(0.78rem, 0.85vw, 0.875rem);
  --type-label: clamp(0.72rem, 0.8vw, 0.82rem);

  /* --- Motion & Transition Curves --- */
  --ease-cinematic: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Pre-Hero Loading Line --- */
.yar-site-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color-canvas-bg, #E3E2DE);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.yar-site-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

.yar-loading-line-track {
  width: 180px;
  height: 1.5px;
  background: rgba(30, 27, 26, 0.12);
  overflow: hidden;
  position: relative;
}

.yar-loading-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: #1E1B1A;
  transition: width 0.15s ease-out;
}

/* --- Single Authoritative Header Overlay Layer --- */
#header-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  z-index: 100;
  pointer-events: none;
}

#header-root > * {
  pointer-events: auto;
}

html:has(body[data-page="hero"]),
html:has(body[data-page="doors"]) {
  scroll-padding-top: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: var(--color-canvas-bg, #E3E2DE) !important;
  width: 100% !important;
}

body[data-page="hero"],
body[data-page="doors"] {
  scroll-padding-top: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: var(--color-canvas-bg, #E3E2DE) !important;
  overflow-x: hidden !important;
  width: 100% !important;
  min-height: 100vh !important;
}

/* --- Top Header Overlay Behavior on Hero --- */
body[data-page="hero"] .yar-header {
  background: transparent !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, background-color 0.35s ease, backdrop-filter 0.35s ease;
}

body[data-page="hero"] .yar-header.header-hidden {
  transform: translateY(-100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body[data-page="hero"] .yar-header.header-stable,
body[data-page="doors"] .yar-header {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background-color: rgba(227, 226, 222, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(30, 27, 26, 0.05) !important;
}

/* --- Hero Root Container --- */
#hero-app-root {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
}

#hero-app-root.hidden {
  display: none !important;
}

/* --- Scroll Track & Viewport Container --- */
.hero-scroll-container {
  position: relative;
  width: 100%;
  height: 990vh;
  margin: 0;
  padding: 0;
}

.hero-sticky-stage {
  position: sticky;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-canvas-bg, #E3E2DE);
  margin: 0;
  padding: 0;
}

/* --- Full Viewport 2D Canvas Renderer --- */
.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* --- Overlay Layer System --- */
.hero-overlays-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* --- Left-Aligned Text Overlays (Line 2 Directly Below Line 1) --- */
.message-overlay {
  position: absolute;
  top: 32vh;
  left: 8vw;
  width: auto;
  max-width: 950px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, transform;
}

.message-left-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.6rem;
}

.message-line-1 {
  display: flex;
  align-items: baseline;
  text-align: left;
  gap: 0.38em;
  flex-wrap: wrap;
}

.message-line-2 {
  display: flex;
  align-items: flex-start;
  text-align: left;
}

.message-part-prefix {
  display: inline-block;
  will-change: transform, opacity;
}

.message-part-editorial-mask {
  display: inline-block;
  will-change: clip-path, -webkit-clip-path, opacity;
  overflow: visible;
}

.message-part-line2 {
  display: inline-block;
  will-change: transform, opacity;
}

.message-text-clio {
  font-family: var(--font-clio, 'Clio', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.7vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1E1B1A;
}

.message-editorial-harietta {
  font-family: var(--font-harietta, 'Harietta', 'Cormorant Garamond', 'Bodoni Moda', 'Playfair Display', Georgia, serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(3.2rem, 5.8vw, 6.8rem);
  line-height: 0.90;
  letter-spacing: -0.01em;
  color: #1E1B1A;
  transform: translateY(0.04em);
}

/* --- Final State Beside-Door Labels (EXHIBITION / COLLECTIONS at Frame 286) --- */
.doors-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.doors-overlay.active {
  opacity: 1;
  visibility: visible;
}

.doors-stage-container {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 100% Fully Transparent Clickable Door Links (Precisely Registered to Metallic Doors) */
.door-hitbox-link {
  position: absolute;
  display: block;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  pointer-events: none;
  cursor: default;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: none;
}

.door-hitbox-link:hover,
.door-hitbox-link:focus,
.door-hitbox-link:active,
.door-hitbox-link:visited {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

/* Clickable only when the final door-selection state is active */
.doors-overlay.active .door-hitbox-link {
  pointer-events: auto;
  cursor: pointer;
}

/* Beside-Door Interface Labels (EXHIBITION Beside Left Door, COLLECTIONS Beside Right Door) */
.door-aside-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
  user-select: none;
  transform: translateY(-50%);
  transition: opacity 0.35s ease;
}

.door-aside-label.door-fading-out {
  opacity: 0;
  pointer-events: none;
}

.door-aside-text {
  font-family: var(--font-clio, 'Clio', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-weight: 600;
  font-size: clamp(0.72rem, 0.8vw, 0.82rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1E1B1A;
  white-space: nowrap;
}

.door-aside-dash {
  width: 22px;
  height: 1px;
  background-color: #1E1B1A;
  opacity: 0.45;
}

/* ==================================================
   DYNAMIC DOOR OPENING SYSTEM (Active ONLY after click)
   ================================================== */

/* Pure White (#FFFFFF) doorway backdrop revealed behind the opening door leaf */
.doorway-backdrop {
  position: absolute;
  background-color: #FFFFFF;
  z-index: 2;
  pointer-events: none;
}

/* 3D Perspective Container for the single rotating door leaf */
.door-leaf-stage {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  transform-style: preserve-3d;
}

/* 3D Rotating Door Leaf */
.door-leaf {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transform-style: preserve-3d;
}

/* Exact Frame 286 High-Fidelity Canvas Slice */
.door-leaf-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Soft Luminous Cloud / Mist Layer (Emanating from doorway into pure white) */
.door-mist-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25; /* Above door leaf (3) and backdrop (2), below fixed header (100) */
  opacity: 0;
  background: radial-gradient(
    circle 90vmax at var(--mist-x, 50%) var(--mist-y, 50%),
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 42%,
    rgba(255, 255, 255, 0.98) 68%,
    rgba(255, 255, 255, 0.92) 84%,
    rgba(255, 255, 255, 0.88) 100%
  ), #FFFFFF;
  will-change: opacity;
}

/* --- Subtle Desktop Scroll Hint --- */
.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 15;
  pointer-events: none;
  opacity: 0.75;
  transition: opacity 0.35s ease;
}

.scroll-hint.hidden {
  opacity: 0;
}

.scroll-hint-text {
  font-family: var(--font-clio, 'Clio', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #3E3934;
}

.scroll-hint-bar {
  width: 1px;
  height: 22px;
  background: linear-gradient(to bottom, #3E3934, transparent);
  animation: scrollPulse 2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes scrollPulse {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 0.8; }
  50.1% { transform: scaleY(1); transform-origin: bottom; opacity: 0.8; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* --- Unobtrusive Hero Skip Control --- */
.hero-skip-intro {
  position: absolute;
  bottom: 2.2rem;
  right: 3.5vw;
  z-index: 25;
  background: transparent;
  border: none;
  padding: 0.4rem 0;
  margin: 0;
  font-family: var(--font-clio, 'Clio', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3E3934;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: opacity 0.35s ease, color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.hero-skip-intro:hover,
.hero-skip-intro:focus-visible {
  color: #1E1B1A;
}

.hero-skip-intro.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* ==================================================
   MOBILE RESPONSIVE RULES FOR HERO
   ================================================== */
.mobile-swipe-hint {
  display: none;
}

@media (max-width: 768px) {
  .scroll-hint {
    display: none !important;
  }

  .door-aside-label {
    gap: 0;
  }

  .door-aside-dash {
    display: none;
  }

  .door-aside-text {
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-align: center;
  }

  .mobile-swipe-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: clamp(1.1rem, 2.8vh, 1.6rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
  }

  .mobile-swipe-hint.visible {
    opacity: 0.72;
    visibility: visible;
  }

  .mobile-swipe-hint-img {
    display: block;
    width: 20px;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    will-change: transform, opacity;
  }

  .mobile-swipe-hint.visible .mobile-swipe-hint-img {
    animation: mobileSwipeUp 1.8s cubic-bezier(0.25, 1, 0.4, 1) infinite;
  }

  @keyframes mobileSwipeUp {
    0% {
      transform: translateY(0);
      opacity: 0.15;
    }
    20% {
      opacity: 0.95;
    }
    60% {
      transform: translateY(-20px);
      opacity: 0.95;
    }
    85%, 100% {
      transform: translateY(-20px);
      opacity: 0;
    }
  }
}

/* --- Page Top BACK TO DOORS Utility Action (Collections & Exhibition only) --- */
.page-back-to-doors {
  display: inline-block;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 32px 0;
  font-family: var(--font-clio, 'Clio', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-weight: 500;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3E3934;
  cursor: pointer;
  outline: none;
  user-select: none;
  opacity: 0.85;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.page-back-to-doors:hover,
.page-back-to-doors:focus-visible {
  opacity: 1;
  color: #1E1B1A;
}

.exhibition-title-group .exhibition-back-icon,
.catalog-title-group .exhibition-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -12px 0 11px -12px;
}

/* Faded out smoothly after scrolling down past the threshold */
.page-back-to-doors.is-scrolled {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Title groups to cleanly stack BACK TO DOORS directly above page titles */
.catalog-title-group,
.exhibition-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.catalog-title-group {
  margin-top: calc(-6vh + 18px);
  padding-top: 0;
}

.exhibition-page .journal-tabs.section-tabs {
  padding-top: calc(var(--header-height, 64px) + 18px);
  align-items: flex-end;
}

.catalog-title-group h1,
.catalog-toolbar>h1 {
  font-size: var(--text-page-title);
  line-height: var(--leading-heading);
  margin: 0;
}

.exhibition-title-group h1 {
  font-size: var(--text-page-title);
  line-height: var(--leading-heading);
  margin: 0;
}

.journal-tabs.section-tabs {
  align-items: flex-end;
}

@media (max-width: 1024px) and (orientation: portrait) {
  .catalog-title-group {
    margin-top: -13px;
    padding-top: 0;
  }
  .catalog-title-group h1 {
    font-size: 12px;
    padding: 0;
  }
  .exhibition-page .journal-tabs.section-tabs {
    padding-top: calc(var(--header-height, 56px) + 12px);
  }
  .page-back-to-doors {
    margin: 0 0 24px 0;
  }
  .exhibition-title-group .exhibition-back-icon,
  .catalog-title-group .exhibition-back-icon {
    margin-bottom: 3px;
  }
}

@media (max-width: 768px) {
  .catalog-title-group {
    margin-top: -13px;
    padding-top: 0;
  }
  .exhibition-page .journal-tabs.section-tabs {
    padding-top: calc(var(--header-height, 56px) + 12px);
  }
  .page-back-to-doors {
    margin: 0 0 24px 0;
  }
  .exhibition-title-group .exhibition-back-icon,
  .catalog-title-group .exhibition-back-icon {
    margin-bottom: 3px;
  }
}

