/* ==========================================================================
   STRINGTUNE MOTION & WATERMELON UI / SHADCN PRIMITIVES
   CSS-First, JS-Light Spring Physics, Kinetic Stagger & Frosted Obsidian Design
   ========================================================================== */

:root {
  /* StringTune Physics Easing Tokens */
  --st-ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --st-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --st-ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --st-duration-fast: 0.22s;
  --st-duration-base: 0.4s;
  --st-duration-slow: 0.8s;

  /* Watermelon UI & shadcn Dark Obsidian Tokens */
  --wm-bg: #070708;
  --wm-surface: #0D0D11;
  --wm-surface-hover: #131318;
  --wm-surface-active: #181820;
  --wm-border: rgba(255, 255, 255, 0.08);
  --wm-border-focus: rgba(255, 255, 255, 0.24);
  --wm-border-glow: rgba(255, 255, 255, 0.12);
  --wm-text: #FAFAFA;
  --wm-text-muted: rgba(255, 255, 255, 0.58);
  --wm-text-dim: rgba(255, 255, 255, 0.36);
  --wm-radius-sm: 8px;
  --wm-radius-md: 14px;
  --wm-radius-lg: 20px;
  --wm-radius-full: 9999px;
  --wm-shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 36px -12px rgba(0, 0, 0, 0.8);
  --wm-shadow-dropdown: 0 10px 40px -10px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   StringTune Reveal & Stagger Utility Classes
   -------------------------------------------------------------------------- */
[data-st-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--st-duration-slow) var(--st-ease-out-expo),
              transform var(--st-duration-slow) var(--st-ease-out-expo);
  will-change: opacity, transform;
}

[data-st-reveal="fade"] {
  opacity: 0;
  transform: none;
  transition: opacity var(--st-duration-slow) var(--st-ease-out-expo);
}

[data-st-reveal="scale"] {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity var(--st-duration-slow) var(--st-ease-out-expo),
              transform var(--st-duration-slow) var(--st-ease-out-expo);
}

[data-st-reveal="left"] {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity var(--st-duration-slow) var(--st-ease-out-expo),
              transform var(--st-duration-slow) var(--st-ease-out-expo);
}

[data-st-reveal="right"] {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--st-duration-slow) var(--st-ease-out-expo),
              transform var(--st-duration-slow) var(--st-ease-out-expo);
}

[data-st-reveal].is-inview {
  opacity: 1;
  transform: none;
}

/* Stagger Children Support */
[data-st-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--st-ease-spring),
              transform 0.6s var(--st-ease-spring);
  transition-delay: calc(var(--st-index, 0) * 0.07s);
}

[data-st-stagger].is-inview > * {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Watermelon UI / shadcn Canonical Header (Menu | Wordmark (No Kanji) | Profile/Signup)
   -------------------------------------------------------------------------- */
.k-unified-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(16px, 3.2vw, 36px);
  background: rgba(7, 7, 8, 0.76);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--wm-border);
  z-index: 1000;
  box-sizing: border-box;
  transition: background var(--st-duration-fast) ease, border-color var(--st-duration-fast) ease;
}

.k-header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.k-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.k-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.k-header-wordmark {
  text-decoration: none;
  color: var(--wm-text);
  font-family: 'Nohemi', sans-serif;
  font-weight: 900;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity var(--st-duration-fast) ease, transform var(--st-duration-fast) var(--st-ease-spring);
}
.k-header-wordmark:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

/* shadcn-inspired tactile pills */
.k-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: 'Neue Montreal', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--wm-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--wm-border);
  border-radius: var(--wm-radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--st-duration-fast) var(--st-ease-spring);
  user-select: none;
}
.k-header-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--wm-border-glow);
  transform: translateY(-1px);
}
.k-header-btn:active {
  transform: scale(0.97);
}

.k-header-profile-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
}
.k-profile-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  display: inline-block;
}
.k-profile-status-dot.is-logged-out {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Watermelon UI Sleek Slide-Out Navigation Drawer
   -------------------------------------------------------------------------- */
.k-nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.k-nav-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.k-nav-drawer-pane {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 92vw);
  background: #09090C;
  border-left: 1px solid var(--wm-border);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.8);
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.4s var(--st-ease-spring);
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  box-sizing: border-box;
}
.k-nav-drawer-backdrop.is-open .k-nav-drawer-pane {
  transform: translateX(0);
}

.k-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}
.k-drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--wm-border);
  background: rgba(255, 255, 255, 0.04);
  color: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.k-drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.k-drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0 0 auto 0;
}
.k-drawer-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--wm-radius-md);
  text-decoration: none;
  color: var(--wm-text);
  font-family: 'Nohemi', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: transparent;
  transition: all 0.2s ease;
}
.k-drawer-nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}
.k-drawer-nav-link span.k-drawer-arrow {
  color: var(--wm-text-dim);
  font-size: 1rem;
  transition: transform 0.2s ease, color 0.2s ease;
}
.k-drawer-nav-link:hover span.k-drawer-arrow {
  transform: translateX(3px);
  color: #FAFAFA;
}

.k-drawer-footer {
  border-top: 1px solid var(--wm-border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.k-drawer-sub-link {
  color: var(--wm-text-muted);
  font-family: 'Neue Montreal', sans-serif;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}
.k-drawer-sub-link:hover {
  color: #FAFAFA;
}
