@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300&family=Inter:wght@100;200;300;400&display=swap');

:root {
  --bg-color: #F7F4EF;
  --bg-card: #121212;
  --text-primary: #1A1A1A;
  --text-muted: #7E7A74;
  --text-light: #F7F4EF;
  --gold-accent: #B59A70;
  --font-serif: 'Cormorant Garamond', Didot, 'Bodoni MT', serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --transition-smooth: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle premium paper texture overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: "";
  opacity: 0.035;
  pointer-events: none;
  z-index: 9999;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Custom Cursor */
.custom-cursor {
  width: 8px;
  height: 8px;
  background-color: var(--text-primary);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-cursor.hovered {
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: 1px solid var(--text-primary);
}

/* Screen Wrapper */
.app-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 3rem 4rem;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .app-wrapper {
    padding: 2rem;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  header {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
  }

  header .exhibition-tag {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    line-height: 1.4;
  }
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

header .logo-mark {
  color: var(--text-primary);
  font-weight: 400;
}

/* Main Layout */
main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  margin: 2rem 0;
  gap: 4rem;
}

@media (max-width: 1024px) {
  main {
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
  }
}

/* Text Panel */
.text-panel {
  flex: 1;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
}

@media (max-width: 1024px) {
  .text-panel {
    text-align: center;
    align-items: center;
    max-width: 100%;
  }
}

.chapter-tag {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-accent);
  margin-bottom: 1.5rem;
}

.text-panel h1 {
  font-family: var(--font-serif);
  font-size: 6.5rem;
  font-weight: 300;
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 2rem;
  position: relative;
}

@media (max-width: 1200px) {
  .text-panel h1 {
    font-size: 5rem;
  }
}

@media (max-width: 768px) {
  .text-panel h1 {
    font-size: 4rem;
  }
}

.text-panel h2 {
  font-size: 1.15rem;
  font-weight: 200;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  position: relative;
}

@media (max-width: 768px) {
  .text-panel h2 {
    font-size: 0.95rem;
    letter-spacing: 0.2em;
  }
}

/* Interactive CTA/Link */
.explore-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 8px;
  cursor: none; /* Let custom cursor take over */
  width: fit-content;
  transition: var(--transition-fast);
}

.explore-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 1px;
  background-color: var(--text-primary);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-btn:hover {
  color: var(--gold-accent);
}

.explore-btn:hover::after {
  width: 100%;
  background-color: var(--gold-accent);
}

.explore-btn .arrow-icon {
  margin-left: 10px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-btn:hover .arrow-icon {
  transform: translateX(6px);
}

/* Central Art Portal */
.art-portal-container {
  flex: 1.2;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px; /* For 3D tilt effect */
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.4s;
}

.art-portal-card {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1.5; /* Golden Ratio-esque proportion */
  background-color: var(--bg-card);
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12), 
              0 15px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: box-shadow 0.5s ease;
}

.art-portal-card:hover {
  box-shadow: 0 45px 80px rgba(0, 0, 0, 0.22), 
              0 20px 40px rgba(0, 0, 0, 0.15);
}

.art-portal-card canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Interactive Canvas Card Inner Overlay */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(18,18,18,0.2) 0%, rgba(18,18,18,0) 50%, rgba(18,18,18,0.7) 100%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  color: var(--text-light);
  transform: translateZ(30px); /* Pushes elements out for 3D parallax depth */
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.6);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-footer .curator-info {
  font-size: 0.65rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.6;
}

.card-footer .curator-info span {
  display: block;
  font-weight: 400;
  color: var(--gold-accent);
}

/* Footer Section */
footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  padding-top: 2rem;
  gap: 2rem;
}

@media (max-width: 768px) {
  footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
  }
}

footer .coming-soon {
  font-weight: 400;
  color: var(--text-primary);
  flex-shrink: 0;
}

footer .disclaimer {
  text-transform: none;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
  max-width: 600px;
  text-align: right;
  font-style: italic;
  font-weight: 300;
}

@media (max-width: 768px) {
  footer .disclaimer {
    text-align: center;
  }
}

/* Keyframe Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Interactive Canvas Card Loading Transition Overlay */
.card-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-card);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.loader-line {
  width: 40px;
  height: 1px;
  background-color: var(--gold-accent);
  position: relative;
  overflow: hidden;
}

.loader-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: var(--text-light);
  animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

/* Transition effects for parent app wrapper on active state */
.app-wrapper {
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.exhibition-active .app-wrapper {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

/* Fullscreen Exhibition Space */
.exhibition-space {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0A0A0A;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

body.exhibition-active .exhibition-space {
  opacity: 1;
  pointer-events: auto;
}

/* Background Canvas */
#exhibition-bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}

/* Wrapper */
.exhibition-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 3rem 4rem;
}

@media (max-width: 768px) {
  .exhibition-wrapper {
    padding: 2rem;
    overflow-y: auto;
  }
}

/* Exhibition Header */
.exhibition-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.4);
  border-bottom: 1px solid rgba(247, 244, 239, 0.05);
  padding-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .exhibition-header {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
}

.exhibition-header .logo-mark {
  color: var(--text-light);
  font-weight: 400;
}

.exhibition-header .exit-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  cursor: none;
  transition: var(--transition-fast);
}

.exhibition-header .exit-btn:hover {
  color: var(--gold-accent);
}

.exhibition-header .exit-btn .close-icon {
  margin-left: 10px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.exhibition-header .exit-btn:hover .close-icon {
  transform: rotate(90deg);
}

/* Rooms Grid */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: auto 0;
  border-left: 1px solid rgba(247, 244, 239, 0.05);
}

@media (max-width: 1024px) {
  .rooms-grid {
    grid-template-columns: 1fr;
    border-left: none;
    border-top: 1px solid rgba(247, 244, 239, 0.05);
    margin: 3rem 0;
  }
}

/* Room Card */
.room-card {
  padding: 3rem 2.5rem;
  border-right: 1px solid rgba(247, 244, 239, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
  background-color: transparent;
  transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  opacity: 0;
  transform: translateY(40px);
}

@media (max-width: 1024px) {
  .room-card {
    border-right: none;
    border-bottom: 1px solid rgba(247, 244, 239, 0.05);
    min-height: auto;
    padding: 2.5rem 0.5rem;
    gap: 1.5rem;
  }
}

body.exhibition-active #room-card-1 {
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s;
}
body.exhibition-active #room-card-2 {
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}
body.exhibition-active #room-card-3 {
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.7s;
}

.room-card:hover {
  background-color: rgba(247, 244, 239, 0.015);
  border-color: rgba(181, 154, 112, 0.3);
}

.room-index {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--gold-accent);
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .room-index {
    margin-bottom: 0.5rem;
  }
}

.room-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.room-card:hover .room-title {
  transform: translateX(5px);
  color: var(--gold-accent);
}

.room-desc {
  font-size: 0.8rem;
  font-weight: 200;
  line-height: 1.8;
  color: rgba(247, 244, 239, 0.6);
  letter-spacing: 0.05em;
  margin-bottom: 3rem;
}

@media (max-width: 1024px) {
  .room-desc {
    margin-bottom: 1rem;
  }
}

.room-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  color: rgba(247, 244, 239, 0.4);
  text-transform: uppercase;
  transition: color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.room-card:hover .room-indicator {
  color: var(--text-light);
}

.indicator-line {
  width: 30px;
  height: 1px;
  background-color: rgba(247, 244, 239, 0.1);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.room-card:hover .indicator-line {
  width: 60px;
  background-color: var(--gold-accent);
}

/* Exhibition Footer */
.exhibition-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.3);
  border-top: 1px solid rgba(247, 244, 239, 0.05);
  padding-top: 1.5rem;
}

@media (max-width: 768px) {
  .exhibition-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding-bottom: 1rem;
  }
}

.exhibition-disclaimer {
  text-transform: none;
  font-style: italic;
  font-weight: 200;
}
