:root {
  --primary-gold: #CBA868;
  --primary-gold-soft: rgba(203, 168, 104, 0.18);
  --secondary-grey: #777777;
  --background: #FFFFFF;
  --text: #222222;
  --muted: #8A8A8A;
  --glass-border: rgba(255, 255, 255, 0.72);
  --shadow-soft: 0 24px 70px rgba(34, 34, 34, 0.10);
  --shadow-deep: 0 40px 120px rgba(34, 34, 34, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body.loading-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(203, 168, 104, 0.22), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(203, 168, 104, 0.12), transparent 30%),
    radial-gradient(circle at 50% 92%, rgba(238, 226, 202, 0.30), transparent 38%),
    linear-gradient(135deg, #FFFFFF 0%, #FCFAF6 48%, #FFFFFF 100%);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 28px;
}

body.loading-page::before {
  content: "";
  position: fixed;
  top: -180px;
  left: -160px;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: rgba(203, 168, 104, 0.10);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: ambientFloatOne 8s ease-in-out infinite;
}

body.loading-page::after {
  content: "";
  position: fixed;
  right: -170px;
  bottom: -190px;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: rgba(119, 119, 119, 0.08);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: ambientFloatTwo 9s ease-in-out infinite;
}

.loading-shell,
.loading-shell span {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.loading-shell {
  overflow: hidden;
}

.light-orb,
.particle {
  position: absolute;
  display: block;
  border-radius: 999px;
  pointer-events: none;
}

.light-orb {
  background: radial-gradient(circle, rgba(203, 168, 104, 0.22), transparent 68%);
  filter: blur(20px);
  opacity: 0.85;
  animation: lightDrift 7s ease-in-out infinite;
}

.light-orb-one {
  width: 260px;
  height: 260px;
  left: 10%;
  top: 18%;
}

.light-orb-two {
  width: 340px;
  height: 340px;
  right: 8%;
  bottom: 12%;
  animation-delay: -2.4s;
}

.light-orb-three {
  width: 180px;
  height: 180px;
  right: 22%;
  top: 12%;
  animation-delay: -4s;
}

.particle {
  width: 7px;
  height: 7px;
  background: rgba(203, 168, 104, 0.52);
  box-shadow: 0 0 24px rgba(203, 168, 104, 0.32);
  animation: particleFloat 6s ease-in-out infinite;
}

.particle-one { left: 14%; top: 28%; animation-delay: -0.4s; }
.particle-two { left: 76%; top: 30%; animation-delay: -1.6s; width: 5px; height: 5px; }
.particle-three { left: 24%; top: 72%; animation-delay: -2.4s; width: 6px; height: 6px; }
.particle-four { left: 86%; top: 66%; animation-delay: -3.1s; }
.particle-five { left: 50%; top: 18%; animation-delay: -4.2s; width: 5px; height: 5px; }
.particle-six { left: 58%; top: 82%; animation-delay: -5.2s; width: 6px; height: 6px; }

.loading-card {
  width: min(520px, 100%);
  position: relative;
  z-index: 1;
  padding: 48px 42px 42px;
  border: 1px solid var(--glass-border);
  border-radius: 36px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.60)),
    radial-gradient(circle at 50% 0%, rgba(203, 168, 104, 0.16), transparent 42%);
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  overflow: hidden;
  animation: cardReveal 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.loading-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 35px;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), transparent 40%),
    repeating-linear-gradient(135deg, rgba(203, 168, 104, 0.035) 0, rgba(203, 168, 104, 0.035) 1px, transparent 1px, transparent 22px);
}

.loading-card > * {
  position: relative;
  z-index: 1;
}

.loading-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
  margin: 0 auto 24px;
  display: block;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.58);
  padding: 8px;
  box-shadow: 0 24px 54px rgba(203, 168, 104, 0.24);
  animation: logoEntrance 3s ease-in-out infinite;
}

.eyebrow {
  color: var(--primary-gold);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.loading-card h1 {
  font-size: clamp(38px, 8vw, 58px);
  line-height: 1;
  letter-spacing: -0.06em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--secondary-grey);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tagline {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.loading-text {
  min-height: 26px;
  margin-top: 30px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: opacity 260ms ease, transform 260ms ease;
}

.loading-text.is-fading {
  opacity: 0;
  transform: translateY(8px);
}

.progress-track {
  width: 100%;
  height: 8px;
  margin: 24px auto 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(119, 119, 119, 0.10);
  box-shadow: inset 0 1px 3px rgba(34, 34, 34, 0.08);
}

.progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #E7C986 0%, var(--primary-gold) 48%, #9B7A35 100%);
  box-shadow: 0 0 18px rgba(203, 168, 104, 0.42);
  animation: progressFill var(--loading-duration, 3200ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary-gold);
  box-shadow: 0 0 16px rgba(203, 168, 104, 0.34);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

.quote-text {
  min-height: 24px;
  color: var(--secondary-grey);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  transition: opacity 360ms ease, transform 360ms ease;
}

.quote-text.is-fading {
  opacity: 0;
  transform: translateY(8px);
}

body.loading-page.is-leaving {
  animation: pageFadeOut 650ms ease forwards;
}

body.loading-page.is-leaving .loading-card {
  transform: scale(0.985);
  opacity: 0;
}

@keyframes logoEntrance {
  0%, 100% {
    opacity: 0.82;
    transform: translateY(-8px) scale(0.985);
  }

  50% {
    opacity: 1;
    transform: translateY(0) scale(1.035);
  }
}

@keyframes progressFill {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes dotPulse {
  0%, 80%, 100% {
    opacity: 0.28;
    transform: translateY(0) scale(0.86);
  }

  40% {
    opacity: 1;
    transform: translateY(-5px) scale(1);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ambientFloatOne {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(32px, 28px, 0); }
}

@keyframes ambientFloatTwo {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-34px, -24px, 0); }
}

@keyframes lightDrift {
  0%, 100% { opacity: 0.58; transform: translate3d(0, 0, 0) scale(1); }
  50% { opacity: 0.92; transform: translate3d(18px, -16px, 0) scale(1.08); }
}

@keyframes particleFloat {
  0%, 100% {
    opacity: 0.28;
    transform: translate3d(0, 0, 0);
  }

  50% {
    opacity: 0.9;
    transform: translate3d(10px, -22px, 0);
  }
}

@keyframes pageFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 16% 12%, rgba(203, 168, 104, 0.22), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(203, 168, 104, 0.12), transparent 30%),
    radial-gradient(circle at 50% 92%, rgba(238, 226, 202, 0.30), transparent 38%),
    linear-gradient(135deg, #FFFFFF 0%, #FCFAF6 48%, #FFFFFF 100%);
  transition: opacity 650ms ease, visibility 650ms ease, transform 650ms ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
}

.app-shell {
  transition: opacity 650ms ease, transform 650ms ease;
}

.app-shell.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
}

@media (max-width: 640px) {
  body.loading-page,
  .loading-overlay {
    padding: 18px;
  }

  .loading-card {
    padding: 38px 24px 34px;
    border-radius: 28px;
  }

  .loading-card::before {
    border-radius: 27px;
  }

  .loading-logo {
    width: 88px;
    height: 88px;
    border-radius: 24px;
  }

  .subtitle,
  .tagline,
  .loading-text,
  .quote-text {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
