/* =========================================================
   FONTS
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

/* =========================================================
   GLOBAL THEME VARIABLES
========================================================= */
:root {
  --leo-accent: #4A90E2;
  --leo-accent-gradient: linear-gradient(90deg,#4A90E2,#00DBDE,#EC4899,#7F5BFF);

  /* Premium main title gradient */
  --leo-title-gradient: linear-gradient(90deg, #6C47FF, #4A90E2, #D6336C);

  --leo-bg: #f5f7fb;
  --leo-text: #111827;
  --leo-muted: #6B7280;

  /* Glow highlight for premium effects */
  --leo-glow: drop-shadow(0px 3px 14px rgba(108,71,255,0.25));
}

/* =========================================================
   GLOBAL PAGE BASE
========================================================= */
body {
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(1500px at 10% 0%, rgba(148,163,255,0.32), transparent 65%),
    radial-gradient(1200px at 90% 0%, rgba(45,212,191,0.22), transparent 70%),
    linear-gradient(180deg,#f5f7fb 0%,#eef2ff 40%,#e5edff 100%);
  margin: 0;
  color: var(--leo-text);
  line-height: 1.7;
}

/* Main wrapper spacing – consistent across all pages */
main.content {
  max-width: 1180px !important;
  margin: 2.75rem auto 4rem !important;
  padding: 0 1.5rem !important;
}

/* =========================================================
   TYPOGRAPHY
========================================================= */

h1, h2, h3, h4 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p { font-size: 1rem; color: var(--leo-text); }

/* =========================================================
   PREMIUM PAGE TITLES (CENTERED + UNDERLINE + ANIMATION)
========================================================= */

/* Center entire Quarto title block */
.quarto-title-block,
.quarto-title-block h1,
h1.title,
h1 {
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  display: block !important;
  animation: titleFadeIn 1s ease-out both;
}

/* Premium main H1 */
.quarto-title-block h1,
h1 {
  font-size: 2.05rem !important;
  font-weight: 800 !important;
  background: var(--leo-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: var(--leo-glow);
  margin-bottom: 0.7rem !important;
  letter-spacing: -0.4px !important;
}

/* Sub-heading smaller + elegant */
.quarto-title-block .subtitle {
  font-size: 1rem !important;
  font-weight: 500 !important;
  color: var(--leo-muted) !important;
  text-align: center !important;
  margin-top: -0.25rem !important;
  opacity: 0.85;
}

/* Animated underline */
.quarto-title-block h1::after,
h1::after {
  content: "";
  display: block;
  width: 150px;
  height: 3px;
  margin: 0.5rem auto 0 auto;
  border-radius: 999px;
  background: var(--leo-title-gradient);
  opacity: 0;
  animation: underlineSlide 1s ease-out 0.15s forwards;
}

/* Animations */
@keyframes titleFadeIn {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes underlineSlide {
  0% { transform: scaleX(0); opacity: 0; }
  100% { transform: scaleX(1); opacity: 1; }
}

/* =========================================================
   CARDS
========================================================= */
.hero, .card {
  max-width: 1150px !important;
  background: #ffffff;
  border-radius: 18px;
  padding: 2rem 2.2rem;
  margin: 1.6rem auto !important;

  /* Softer, thinner, elegant border */
  border: 1px solid rgba(148,163,184,0.30);

  box-shadow: 0 10px 28px rgba(15,23,42,0.05);
  position: relative;
}

/* Top accent bar */
/* .card::before, .hero::before {
  content: "";
  position: absolute;
  top: 0; left: 18px; right: 18px;
  height: 3px;
  border-radius: 999px;
  background-image: var(--leo-accent-gradient);
  opacity: 0.75;
} */

/* Hover rise */
.card:hover {
  transform: translateY(-4px);
  transition: 0.22s ease;
  box-shadow: 0 18px 38px rgba(15,23,42,0.12);
}

/* =========================================================
   SIDEBAR (KEEP PREMIUM LOOK)
========================================================= */
#quarto-margin-sidebar {
  position: fixed !important;
  top: 140px !important;
  right: 40px !important;
  max-width: 260px !important;
  background: rgba(255,255,255,0.88);
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.35);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(15,23,42,0.15);
}

/* =========================================================
   PLOTLY GRAPH WIDTH
========================================================= */
.plotly-graph-div {
  width: 100% !important;
  max-width: 1100px !important;
  margin: 1.2rem auto !important;
}

/* =========================================================
   CODE BLOCK WIDTH
========================================================= */
pre, code {
  max-width: 1080px !important;
  font-size: 0.85rem !important;
  overflow-x: auto !important;
}

/* =========================================================
   FOOTER
========================================================= */
footer {
  text-align: center;
  color: var(--leo-muted);
  font-size: 0.8rem;
  padding: 1.8rem 0 1.4rem;
}

/* =========================================================
   SCROLL REVEAL
========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Back to top */
#backToTop {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #374151;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: background 0.3s ease;
}
#backToTop:hover { background: #111827; }
#backToTop.hidden { display: none; }

/* =========================================================
   GLOBAL SPACING CALIBRATION
========================================================= */

main.content {
  max-width: 1180px !important;
  margin: 3.5rem auto 4.5rem !important;
  padding: 0 1.7rem !important;
}

/* Remove accidental double-spacing Quarto sometimes injects */
.quarto-section {
  margin-top: 1.6rem !important;
  margin-bottom: 1.6rem !important;
}

/* =========================================================
   PREMIUM TITLES — PROPORTIONAL SIZING
========================================================= */

.quarto-title-block h1, h1 {
  font-size: 2.1rem !important;
  letter-spacing: -0.35px !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
}

.quarto-title-block .subtitle {
  font-size: 1.05rem !important;
  color: var(--leo-muted) !important;
  margin-top: -0.35rem !important;
  margin-bottom: 0.9rem !important;
  text-align: center !important;
}

/* =========================================================
   PLOTLY FIXES
========================================================= */

.plotly-graph-div {
  max-width: 1100px !important;
  margin: 2.2rem auto !important;
}

.card .plotly-graph-div {
  margin-bottom: 0.6rem !important;
}

/* =========================================================
   FOOTER REFINEMENT
========================================================= */

footer {
  margin-top: 4rem !important;
  padding-top: 1.6rem !important;
  padding-bottom: 1.2rem !important;
}