/* =========================================
           1. SETUP
        ========================================= */
:root {
  --accent-color: #9f6bf5;
  --text-white: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.15);

  /* --- PHYSICS VARIABLES --- */
  /* We use two separate timings:
               1. --fluid-shape: Slower (1.2s) for width/padding/rounding changes.
               2. --fluid-move: Faster (0.8s) for the vertical drop.
               This separation creates the "Liquid" effect.
            */
  --fluid-shape: 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  --fluid-move: 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: #050210;
  font-family: "Inter", sans-serif;
  color: #fff;
  height: 200vh;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

/* =========================================
           2. HEADER WRAPPER
        ========================================= */
#apex-style-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99999;
  display: flex;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
}

/* =========================================
           3. MORPHING NAV
        ========================================= */
.glass-pill-nav {
  pointer-events: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;

  /* --- INITIAL STATE --- */
  width: 100%;
  max-width: 1200px;

  /* Initial Padding (Matches inner elements) */
  padding: 20px 40px;
  border-radius: 0px;

  /* Position */
  transform: translateY(0) translateZ(0);

  /* Visuals */
  background: rgba(5, 2, 15, 0.01);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid transparent;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;

  /* --- SYNCHRONIZED TRANSITIONS --- */
  transition: 
                /* Shape & Layout (Slow) */
    width var(--fluid-shape),
    border-radius var(--fluid-shape),
    padding var(--fluid-shape),
    /* Position (Faster) */ transform var(--fluid-move),
    /* Visuals (Medium) */ background 1s ease,
    backdrop-filter 1s ease,
    border-color 1s ease,
    border-width 1s ease,
    box-shadow 1s ease;
}

/* --- SCROLLED STATE --- */
.glass-pill-nav.scrolled-mode {
  /* 1. Shape Change */
  width: 90%;
  max-width: 1200px;
  border-radius: 50px;

  /* 2. Padding Change (CRITICAL: Matches width timing) */
  padding: 10px 20px 10px 30px;

  /* 3. Position Change */
  transform: translateY(20px) translateZ(0);

  /* 4. Material Change */
  background: rgba(10, 5, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
}

/* =========================================
           4. INNER ELEMENTS (LOGO & BUTTON)
        ========================================= */

/* LOGO WRAPPER */
.pill-logo {
  display: flex;
  align-items: center;
}

.pill-logo img {
  height: 40px;
  width: auto;
  display: block;
  /* CRITICAL: Match the exact same timing variable as the container width/padding */
  transition: height var(--fluid-shape);
}

/* When Scrolled: Logo shrinks slightly if desired, or stays fixed. 
           If you want it to shrink, uncomment the next block. 
           If not, it will move smoothly because parent padding handles position. */
/* .glass-pill-nav.scrolled-mode .pill-logo img {
            height: 32px; 
        } 
        */

/* MENU */
.pill-menu ul {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pill-menu a {
  color: var(--text-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  opacity: 0.8;
  transition: all 0.3s ease;
  position: relative;
}
.pill-menu a:hover {
  color: #fff;
  opacity: 1;
  text-shadow: 0 0 12px rgba(159, 107, 245, 0.5);
}

/* BUTTON */
.header-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Button Padding */
  padding: 12px 28px;

  text-decoration: none;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);

  /* CRITICAL: Sync button padding/size changes with the container */
  transition:
    padding var(--fluid-shape),
    background 0.4s ease,
    border 0.4s ease,
    box-shadow 0.4s ease,
    transform 0.4s ease;
}

/* If you want the button to shrink slightly on scroll, define it here.
           Currently it stays same size, just moves with padding. */
.glass-pill-nav.scrolled-mode .header-btn {
  /* Optional: padding: 10px 24px; */
}

.btn-text {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 2;
}

.liquid-shine {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  background: radial-gradient(
    circle,
    rgba(159, 107, 245, 0.6) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
  pointer-events: none;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(159, 107, 245, 0.3);
  transform: translateY(-1px);
}
.header-btn:hover .liquid-shine {
  opacity: 1;
}

/* =========================================
           5. LANGUAGE PILL
        ========================================= */
.footer-lang {
  display: flex;
  justify-content: flex-start;
  margin-top: 36px;
}

@media (max-width: 950px) {
  .footer-lang {
    justify-content: center;
  }
}

.lang-pill {
  position: relative;
  display: inline-flex;
  padding: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  flex-shrink: 0;
}

.lang-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 8px;
  background: var(--accent-color);
  box-shadow: 0 4px 12px rgba(159, 107, 245, 0.4);
  pointer-events: none;
  z-index: 0;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width;
}

.lang-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px 13px;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s ease;
}

.lang-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.lang-pill.lang-ready .lang-btn.is-active {
  color: #fff;
}

/* =========================================
           6. MOBILE
        ========================================= */
@media (max-width: 640px) {
  .glass-pill-nav {
    padding: 15px 20px;
  }
  .glass-pill-nav.scrolled-mode {
    width: 92%;
    padding: 10px 20px;
  }
  .pill-menu {
    display: none;
  }
  .pill-logo img {
    height: 32px;
  }
  .header-btn {
    padding: 10px 20px;
  }
}

/* Placeholder */
.content-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, #1a0530 0%, #000000 70%);
  text-align: center;
}
