/* Import Urbanist & Montserrat Fonts */
@import url("https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;900&display=swap");

:root {
  --bg: #070b16;
  --panel: rgba(12, 16, 30, 0.5);
  --panel-border: #000000;
  --text: #f4f6ff;
  --muted: #b5bfd6;
  --accent: #8b5cf6;
  --accent2: #baa9fe;
  --dot: #ffd166;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Montserrat", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow: hidden;
}

#app {
  position: relative;
}

#scene {
  position: absolute;
  inset: 0;
}

.panel {
  position: absolute;
  z-index: 20;
  top: 12px;
  left: 12px;
  right: none;
  width: 460px;
  max-width: calc(100vw - 24px);
  overflow: auto;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: flex;
  gap: 0.75rem;
  color: var(--accent2);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.eyebrow img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e6e6e6;
}

h1 {
  margin: 0 0 10px;
  font-size: 1.8rem;
  line-height: 1.1;
}

.intro {
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.45;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  color: white;
  font-weight: 600;
  font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

button.secondary,
.close-btn {
  background: rgba(255, 255, 255, 0.07);
}

.info-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  color: white;
  font-weight: 600;
  background: none;
}

.hero-card {
  position: absolute;
  z-index: 21;
  top: auto;
  left: 12px;
  width: 460px;
  bottom: 100px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 230px);
  padding: 0; /* Remove the original padding-top from hero-card */
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.hero-card.hidden {
  display: none;
}

.hero-card h2 {
  margin: 0 8px 8px 0;
}

.card-meta {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.card-name {
  color: var(--accent2);
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.relationship-header {
  position: sticky; /* This is already present, which is great */
  top: 0; /* Make it stick to the very top of its scrollable parent */
  z-index: 10; /* Ensure it stays above scrolling content */
  background: #30343f;
  padding-top: 18px; /* Add padding to the top of the sticky header to account for the hero-card's original padding */
  padding-left: 16px;
  padding-bottom: 10px; /* Adjust padding to maintain desired spacing below the header */
  margin-top: -18px; /* Negative margin to pull it up and cover the hero-card's original top padding */
  margin-bottom: 0; /* Remove the margin-bottom to avoid extra space when sticky */
  margin-left: 0px;
  margin-right: 0px;
  width: 100%;
  border-bottom: 1px solid #999;

  /* existing display, align-items, justify-content, gap, flex-wrap */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.close-btn {
  top: 10px;
  margin-left: auto;
  margin-right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1.5rem;
  padding: 0px;
}

.relationship-title {
  margin-top: 32px;
  margin-bottom: 14px;
  padding-left: 16px;
}

.card-pair {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-story-card {
  background: #30343fbb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
}

.hero-story-topline.hidden {
  display: none;
}

.hero-story-name.hidden {
  display: none;
}

.hero-story-card.hidden {
  display: none;
}

.hero-story-label.hidden {
  display: none;
}

.hero-story-location.hidden {
  display: none;
}

.hero-story-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.hero-story-type {
  color: var(--accent2);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero-story-economy {
  font-size: 0.76rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  text-transform: capitalize;
}

.hero-story-name {
  margin: 0 0 4px;
  font-size: 1.02rem;
  line-height: 1.2;
}

.hero-story-location {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.hero-story-section + .hero-story-section {
  margin-top: 12px;
}

.hero-story-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent2);
  margin-bottom: 5px;
}

.hero-story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
}

@media (max-width: 820px) {
  h1 {
    font-size: 1.6rem;
  }

  .hero-card {
    max-height: calc(100vh - 280px);
  }

  .card-pair {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-story-card {
    padding: 13px;
  }

  .hero-story-name {
    font-size: 0.98rem;
  }

  .hero-story-location {
    font-size: 0.86rem;
  }

  .hero-story-card p {
    font-size: 0.92rem;
    line-height: 1.42;
  }
}

.label {
  color: white;
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transform: translate(-50%, -120%);
}

@media (max-width: 820px) {
  .panel {
    width: min(92vw, 420px);
  }
}

.actions {
  display: flex;
  position: absolute;
  z-index: 20;
  left: 12px;
  bottom: 12px;
  width: 460px;
  max-width: calc(100vw - 24px);
  gap: 10px;
  justify-content: space-between;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.action-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  color: white;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
}

.action-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.action-btn-active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.action-btn-disabled {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.55);
  cursor: default;
}

@media (max-width: 820px) {
  .card-pair {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .hero-story-card {
    padding: 13px;
  }

  .hero-story-name {
    font-size: 0.98rem;
  }

  .hero-story-location {
    font-size: 0.86rem;
  }

  .hero-story-card p {
    font-size: 0.92rem;
    line-height: 1.42;
  }

  .label {
    font-size: 11px;
  }
}

.hero-card::-webkit-scrollbar {
  width: 10px;
}

.hero-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.hero-card::-webkit-scrollbar-thumb {
  background: rgba(191, 168, 255, 0.35);
  border-radius: 999px;
}

.hero-card::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 168, 255, 0.55);
}

