/* ============================================================================
   Black Cats® Security Solutions — Courier Tracking Page
   Palette pulled from the live site (blackcatscctv.com computed styles):
   white background, #555 body text, #333 headings, #FECD1A gold accent.
   ============================================================================ */

:root {
  --bc-bg: #ffffff;
  --bc-text: #555555;
  --bc-heading: #333333;
  --bc-accent: #fecd1a;
  --bc-accent-text: #222222;
  --bc-warning: #c62828;
  --bc-warning-bg: #fdecea;
  --bc-border: #e6e6e6;
  --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* Glass surfaces — sit over the video, so dark + frosted rather than
     opaque white; the accent stays the same brand gold throughout. */
  --glass-bg: rgba(22, 22, 26, 0.55);
  --glass-bg-solid: rgba(18, 18, 21, 0.96); /* fallback: browsers without backdrop-filter */
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.18);
  --glass-text: #f5f5f5;
  --glass-text-muted: rgba(245, 245, 245, 0.68);
  --glass-card-bg: rgba(255, 255, 255, 0.06);
  --glass-card-bg-hover: rgba(255, 255, 255, 0.11);
  --glass-blur: blur(28px) saturate(180%);

  /* Courier button accent — deliberately not brand gold (that's reserved
     for primary CTAs: skip pill, progress rail, Continue). A cool blue
     reads clearly against dark glass and separates "pick one of these"
     from "the one thing to tap now". */
  --courier-accent: #38bdf8;
  --courier-accent-rgb: 56, 189, 248;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--bc-text);
  font-family: var(--font-primary);
}

h1, h2, h3 { font-family: var(--font-primary); margin: 0; }

a { color: inherit; }

button { font-family: var(--font-primary); }

:focus-visible {
  outline: 3px solid var(--bc-accent);
  outline-offset: 2px;
}

/* ---------- noscript fallback ---------- */
.noscript-fallback {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  background: var(--bc-bg);
  text-align: center;
}

.noscript-poster {
  width: 100%;
  max-width: 320px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.noscript-fallback h1 {
  color: var(--bc-heading);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.noscript-fallback p {
  line-height: 1.5;
  margin-bottom: 20px;
}

.noscript-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.noscript-list a {
  display: block;
  background: var(--bc-bg);
  border: 2px solid var(--bc-border);
  border-left: 6px solid var(--bc-accent);
  border-radius: 14px;
  padding: 18px;
  font-weight: 700;
  color: var(--bc-heading);
  text-decoration: none;
}

/* ---------- floating brand mark ---------- */
.brand-mark {
  position: fixed;
  top: calc(14px + var(--safe-t));
  left: 14px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bc-accent);
  flex-shrink: 0;
}

/* ---------- floating brand logo (top-right) ---------- */
.brand-logo {
  position: fixed;
  top: calc(10px + var(--safe-t));
  right: 14px;
  z-index: 150;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.brand-logo img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
}

/* ---------- skip pill (escape hatch) ---------- */
.skip-pill {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--safe-b));
  z-index: 200;
  background: var(--bc-accent);
  color: var(--bc-accent-text);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 13px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.skip-pill:hover { filter: brightness(0.96); }

.skip-pill.is-hidden {
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  visibility: hidden;
}

/* ---------- scroll-down hint ---------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 180;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.scroll-hint.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

.scroll-hint__mouse {
  display: block;
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 13px;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.scroll-hint__mouse::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: #fff;
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollHintWheel 1.6s ease-in-out infinite;
}

.scroll-hint__chevrons {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.scroll-hint__chevrons span {
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.85);
  border-bottom: 2px solid rgba(255, 255, 255, 0.85);
  transform: rotate(45deg);
  animation: scrollHintChevron 1.6s ease-in-out infinite;
}

.scroll-hint__chevrons span:nth-child(2) { animation-delay: 0.2s; }

.scroll-hint__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

@keyframes scrollHintWheel {
  0% { opacity: 1; transform: translate(-50%, 0); }
  70% { opacity: 0; transform: translate(-50%, 13px); }
  100% { opacity: 0; transform: translate(-50%, 13px); }
}

@keyframes scrollHintChevron {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* ---------- scroll-scrub stage ---------- */
.scroll-stage {
  position: relative;
  height: 500vh;
}

.sticky-viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

/* Desktop: graceful fallback — centred 9:16 column, dark gutters either side */
@media (min-width: 640px) {
  .sticky-viewport,
  .fallback-scene {
    max-width: 480px;
    margin: 0 auto;
  }
}

.journey-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scrim-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  pointer-events: none;
}

/* ---------- captions ---------- */
.captions {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.caption {
  position: absolute;
  top: 10%;
  left: 28px;
  right: 28px;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(1.05rem, 5vw, 1.7rem);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.caption.active {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- progress rail ---------- */
.progress-rail {
  position: absolute;
  right: 16px;
  top: 18%;
  bottom: 18%;
  width: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.progress-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 0%;
  background: var(--bc-accent);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(254, 205, 26, 0.7);
}

.rail-tick {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
}

/* ---------- fallback stage (no scrub / reduced motion) ---------- */
.fallback-stage {
  background: #000;
}

.fallback-scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fallback-scene.in-view {
  opacity: 1;
  transform: translateY(0);
}

.fallback-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.05));
}

.fallback-scene h2 {
  position: relative;
  z-index: 1;
  margin: 0 24px;
  text-align: center;
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(1.2rem, 6vw, 2rem);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

/* ---------- tracking panel (reveal) — glassmorphism ---------- */
.tracking-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  max-width: 480px;
  margin: 0 auto;
  background: var(--glass-bg-solid);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 40%), var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  box-shadow:
    0 -20px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--glass-highlight);
  padding: 14px 22px calc(22px + var(--safe-b));
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 84vh;
  overflow-y: auto;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tracking-panel { background: var(--glass-bg-solid); }
}

.tracking-panel.revealed {
  transform: translateY(0);
}

.tracking-panel__handle {
  width: 40px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  margin: 4px auto 16px;
}

.tracking-panel h2 {
  color: var(--glass-text);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}

.tracking-panel__sub {
  text-align: center;
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--glass-text-muted);
}

.courier-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.courier-btn {
  width: 100%;
  min-height: 56px;
  background:
    linear-gradient(180deg, rgba(var(--courier-accent-rgb), 0.16), rgba(var(--courier-accent-rgb), 0.05)),
    var(--glass-card-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(var(--courier-accent-rgb), 0.45);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(var(--courier-accent-rgb), 0.12), 0 4px 16px rgba(0, 0, 0, 0.3);
  color: var(--glass-text);
  font-size: 1.02rem;
  font-weight: 600;
  text-align: center;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .courier-btn { background: rgba(40, 44, 48, 0.92); }
}

.courier-btn:hover,
.courier-btn:focus-visible {
  background:
    linear-gradient(180deg, rgba(var(--courier-accent-rgb), 0.26), rgba(var(--courier-accent-rgb), 0.08)),
    var(--glass-card-bg-hover);
  border-color: rgba(var(--courier-accent-rgb), 0.8);
  box-shadow: 0 0 0 1px rgba(var(--courier-accent-rgb), 0.35), 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 20px rgba(var(--courier-accent-rgb), 0.25);
  transform: translateY(-2px);
}

/* ---------- redirect modal — glassmorphism ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 400;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--glass-bg-solid);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 45%), var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--glass-highlight);
  max-width: 420px;
  width: 100%;
  padding: 24px 22px 22px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal { background: var(--glass-bg-solid); }
}

.modal h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--glass-text);
  margin: 0 0 12px;
  border-bottom: 3px solid var(--bc-accent);
  padding-bottom: 10px;
}

.modal p {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 16px;
  color: var(--glass-text-muted);
}

.modal .countdown {
  text-align: center;
  font-weight: 700;
  color: #ffc4c4;
  background: rgba(198, 40, 40, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-left: 4px solid #ff6b6b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
}

.modal .countdown #countdownNum {
  color: #ff8a8a;
  font-size: 1.05rem;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 420px) {
  .modal-actions { flex-direction: row-reverse; }
}

.btn-accent,
.btn-ghost {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 14px 18px;
  cursor: pointer;
  flex: 1;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.btn-accent {
  background: var(--bc-accent);
  color: var(--bc-accent-text);
  border: 2px solid var(--bc-accent);
  box-shadow: 0 6px 18px rgba(254, 205, 26, 0.3);
}

.btn-accent:hover:not(:disabled) { filter: brightness(0.95); }

.btn-accent:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--glass-text);
  border: 2px solid var(--glass-border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .caption,
  .fallback-scene,
  .tracking-panel,
  .skip-pill,
  .scroll-hint {
    transition-duration: 0.01ms !important;
  }

  .scroll-hint__mouse::before,
  .scroll-hint__chevrons span {
    animation: none !important;
    opacity: 0.85;
  }
}
