/*
==================================================
1001 Guesthouse - Timeline UI
Full replacement stylesheet
==================================================

SECTION MAP
1. Root / reset
2. Stage / background
3. Top bar
4. Timeline line + shell
5. Dots
6. Dot labels
7. Popup card
8. Responsive tweaks
==================================================
*/


/* ==================================================
1. Root / reset
================================================== */
:root {
  --line-y: 76vh;
  --line-pad: 72px;

  --line-color: rgba(255, 255, 255, 0.82);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);

  --popup-bg: rgba(10, 10, 10, 0.72);
  --popup-border: rgba(255, 255, 255, 0.16);
  --popup-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);

  --active-ring: rgba(255, 255, 255, 0.26);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #111;
  color: var(--text);
  overflow: hidden;
}


/* ==================================================
2. Stage / background
================================================== */
#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 560ms ease;
}

.bg-layer.active {
  opacity: 1;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.44)),
    radial-gradient(circle at center, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.24));
}


/* ==================================================
3. Top bar
================================================== */
.topbar {
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  z-index: 20;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand {
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.reserve-btn {
  display: inline-block;
  text-decoration: none;
  color: #111;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.9rem;
}


/* ==================================================
4. Timeline line + shell
================================================== */
.timeline-scene {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.timeline-shell {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--line-y);
  height: 2px;
}

.timeline-line {
  position: absolute;
  left: var(--line-pad);
  right: var(--line-pad);
  top: 0;
  height: 1px;
  background: var(--line-color);
}

.dot-track {
  position: absolute;
  inset: 0;
}


/* ==================================================
5. Dots
Important:
- all dots are true circles
- sizes change only by hierarchy level
- no browser button styling allowed
================================================== */
.dot {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 11;

  display: block;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  line-height: 0;

  border: none;
  outline: none;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;

  transform: translate(-50%, -50%);

  transition:
  left 760ms cubic-bezier(.22, .9, .2, 1),
  width 280ms ease,
  height 280ms ease,
  opacity 280ms ease,
  box-shadow 280ms ease,
  transform 280ms ease,
  background-color 280ms ease;
}

/* Hierarchy-based sizes */
.dot-major {
  width: 18px;
  height: 18px;
}

.dot-sub {
  width: 12px;
  height: 12px;
}

.dot-subsub {
  width: 8px;
  height: 8px;
}

/* Timeline states */
.dot.past {
  opacity: 0.42;
}

.dot.support {
  opacity: 0.98;
}

.dot.future {
  opacity: 0.28;
}

.dot.active {
  opacity: 1;
  z-index: 15;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.22);
  transform: translate(-50%, -50%) scale(1.2);
}


/* ==================================================
6. Dot labels
Rules:
- major labels always visible
- sub/sub-sub labels appear when their parent topic is active
- labels angle diagonally up-right
================================================== */
.dot-label {
  position: absolute;
  left: 62%;
  bottom: 58%;

  transform: translate(0, -7px) rotate(-28deg);
  transform-origin: left bottom;

  white-space: nowrap;
  pointer-events: none;

  font-size: 0.68rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.94);
  opacity: 0;

  transition: opacity 220ms ease;
}

/* Main topic labels always visible */
.dot.major-labeled .dot-label {
  opacity: 1;
}

/* Sub-topic labels appear in active context */
.dot.context-labeled .dot-label,
.dot.active .dot-label {
  opacity: 1;
}


/* ==================================================
7. Popup card
- anchored above active dot
- compact and minimal
================================================== */
.popup-card {
  position: absolute;
  z-index: 16;

  min-width: 220px;
  max-width: 280px;
  padding: 14px 14px 12px;

  color: #fff;
  background: var(--popup-bg);
  border: 1px solid var(--popup-border);
  border-radius: 14px;
  box-shadow: var(--popup-shadow);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  transform: translate(-50%, calc(-100% - 26px));
  transition:
    left 560ms cubic-bezier(.22, .8, .2, 1),
    top 560ms cubic-bezier(.22, .8, .2, 1),
    opacity 240ms ease;
}

.popup-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;

  width: 12px;
  height: 12px;

  transform: translateX(-50%) rotate(45deg);
  background: var(--popup-bg);
  border-right: 1px solid var(--popup-border);
  border-bottom: 1px solid var(--popup-border);
}

.popup-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.2;
}

.popup-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.popup-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.78rem;
}

.popup-btn.primary {
  background: rgba(255, 255, 255, 0.94);
  color: #111;
}

.popup-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}


/* ==================================================
8. Responsive tweaks
================================================== */
@media (max-width: 900px) {
  :root {
    --line-y: 78vh;
    --line-pad: 24px;
  }

  .popup-card {
    min-width: 200px;
    max-width: 240px;
  }
}

@media (max-width: 640px) {
  .topbar {
    top: 14px;
    left: 14px;
    right: 14px;
  }

  .brand {
    font-size: 0.92rem;
  }

  .reserve-btn {
    padding: 9px 12px;
    font-size: 0.82rem;
  }

  .dot-major {
    width: 16px;
    height: 16px;
  }

  .dot-sub {
    width: 10px;
    height: 10px;
  }

  .dot-subsub {
    width: 7px;
    height: 7px;
  }

  .popup-card {
    max-width: 220px;
    padding: 12px;
  }

  .popup-card h2 {
    font-size: 0.92rem;
  }

  .popup-card p {
    font-size: 0.76rem;
  }
}