html, body {
  margin: 0;
  height: 100%;
  background: #000000;
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ===== CANVAS ===== */
#c {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 4;
  mix-blend-mode: screen;
  pointer-events: auto;
  /* Smooth fade-out when a section is chosen */
  transition: opacity 0.85s ease;
}

/* ===== SECTIONS (behind curtain, revealed when canvas fades) ===== */
.sections {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.section {
  height: 100%;
  padding: 0 32px;
  box-sizing: border-box;
  position: relative;
  border-left: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section h3 {
  margin: 0;
  padding: 0;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.5px;
  color: white !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  pointer-events: none;
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: calc(100% - 64px);
  text-align: center;
}

.s1 { background: linear-gradient(180deg, rgba(249,220,92,0.92), rgba(249,220,92,0.55)); }
.s2 { background: linear-gradient(180deg, rgba(250,229,136,0.92), rgba(250,229,136,0.55)); }
.s3 { background: linear-gradient(180deg, rgba(252,239,180,0.92), rgba(252,239,180,0.55)); }
.s4 { background: linear-gradient(180deg, rgba(253,244,203,0.92), rgba(253,244,203,0.55)); }

/* ===== HUD ===== */
.hud {
  position: fixed;
  left: 14px;
  top: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  pointer-events: none;
  z-index: 4;
}

.debug {
  position: fixed;
  right: 14px;
  top: 12px;
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  pointer-events: none;
  z-index: 4;
  background: rgba(0,0,0,0.5);
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
}

/* ===== HIBISCUS FLOWER CANVAS ===== */
#hibiscus {
  position: fixed;
  left: 10%;
  top: 280px;
  width: 80%;
  height: 60vh;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.85s ease, visibility 0.85s ease;
  pointer-events: none;

  display: block;
}

/* ===== TITLES OVERLAY ===== */
.titles-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 3;
  pointer-events: none;
  background: none;
}

.title-item {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.5px;
  color: white !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 20px rgba(255,255,255,0.5);
  margin: 0;
  position: relative;
  cursor: pointer;
  pointer-events: none;
  z-index: 10 !important;
  width: 100%;
  text-align: center;
  will-change: opacity, visibility;
  opacity: 0;
  visibility: hidden;
}

.title-item:hover {
  transform: scale(1.05);
  color: #7aaeff !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 18px rgba(122,174,255,0.7), 0 0 40px rgba(122,174,255,0.3);
  transition: color 300ms ease, text-shadow 300ms ease, transform 200ms ease;
}

/* ===== MOBILE ===== */
@media (max-width: 767px) {
  /* 4-col title row → 2×2 grid */
  .titles-overlay {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }
  .title-item {
    font-size: 16px;
    padding-top: 18px;
    letter-spacing: 0.2px;
  }
  .title-item:hover {
    transform: none;
  }
  /* Reposition hibiscus to fit narrower viewport */
  #hibiscus {
    left: 5%;
    width: 90%;
    top: 150px;
    height: 42vh;
  }
  /* Hide debug overlays */
  .hud, .debug {
    display: none;
  }
}
