/* ====================================================================
   KHARYAONE — vanilla HTML/CSS/JS port (Tailwind via CDN)
   ==================================================================== */

/* ====================================================================
   KHARYAONE — vanilla HTML/CSS/JS port (Tailwind via CDN)
   ==================================================================== */

/* ── Dark mode (default) ── */
:root, :root[data-theme="dark"] {
  --background: oklch(0.07 0.015 228);
  --background-alt: oklch(0.10 0.016 228);
  --foreground: oklch(0.95 0.006 220);
  --primary: oklch(0.70 0.17 196);
  --primary-foreground: oklch(0.07 0.015 228);
  --secondary: oklch(0.18 0.025 220);
  --secondary-foreground: oklch(0.95 0.006 220);
  --muted: oklch(0.15 0.018 225);
  --muted-foreground: oklch(0.60 0.018 215);
  --accent: oklch(0.22 0.030 220);
  --accent-foreground: oklch(0.95 0.006 220);
  --destructive: oklch(0.58 0.22 25);
  --border: oklch(0.25 0.020 225);
  --input: oklch(0.25 0.020 225);
  --ring: oklch(0.70 0.17 196);
  --card: oklch(0.11 0.018 228);
  --card-foreground: oklch(0.95 0.006 220);
  --radius: 0.5rem;
  --shader-hero-opacity: 1;
}

/* ── Light mode ── */
:root[data-theme="light"] {
  --background: oklch(0.97 0.006 225);
  --background-alt: oklch(0.93 0.009 225);
  --foreground: oklch(0.12 0.020 230);
  --primary: oklch(0.48 0.17 196);
  --primary-foreground: oklch(0.97 0.006 225);
  --secondary: oklch(0.90 0.012 220);
  --secondary-foreground: oklch(0.15 0.020 230);
  --muted: oklch(0.93 0.009 225);
  --muted-foreground: oklch(0.45 0.018 215);
  --accent: oklch(0.88 0.012 220);
  --accent-foreground: oklch(0.12 0.020 230);
  --destructive: oklch(0.52 0.22 25);
  --border: oklch(0.80 0.015 225);
  --input: oklch(0.80 0.015 225);
  --ring: oklch(0.48 0.17 196);
  --card: oklch(0.99 0.004 228);
  --card-foreground: oklch(0.12 0.020 230);
  --shader-hero-opacity: 0.07;
}

html {
  transition: background-color 0.35s ease, color 0.35s ease;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Hero entrance animations ── */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-enter {
  opacity: 0;
  animation: hero-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Shader background opacity (theme-aware, no JS) ── */
.shader-hero-bg {
  opacity: var(--shader-hero-opacity);
  transition: opacity 0.6s ease;
}

/* ── Phone3D float keyframe ── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* ── Aurora pricing animations ── */
@keyframes aurora-move-1 {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(80px, 40px) rotate(180deg); }
}
@keyframes aurora-move-2 {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(-80px, -40px) rotate(-180deg); }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================================================
   THEME TOGGLE — responsive positioning (avoid navbar overlap)
   Nav is centered & pill-shaped; top-right corner is always free.
   ==================================================================== */
.theme-toggle {
  top: 1.25rem;
  right: 1.25rem;
}
/* On very small screens the centered nav reaches the top-right corner,
   so drop the toggle just below the nav to avoid overlap. */
@media (max-width: 360px) {
  .theme-toggle {
    top: 4.75rem;
    right: 1rem;
  }
}

/* ====================================================================
   NAVIGATION — expand/collapse pill (spring-style)
   ==================================================================== */

/* Initial entrance — nav drops in from top */
@keyframes nav-drop-in {
  from { transform: translate(-50%, -80px); opacity: 0; }
  to   { transform: translate(-50%, 0);     opacity: 1; }
}
.nav-wrap {
  animation: nav-drop-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.nav-shell {
  width: var(--nav-w, auto);
  /* Spring-ish curve for width — overshoots slightly like framer's spring */
  transition: width 0.55s cubic-bezier(0.34, 1.4, 0.5, 1), transform 0.25s ease;
  position: relative;
  will-change: width, transform;
}
.nav-shell[data-state="collapsed"] {
  cursor: pointer;
  justify-content: center;
}
.nav-shell[data-state="collapsed"]:hover {
  transform: scale(1.1);
}
.nav-shell[data-state="collapsed"]:active {
  transform: scale(0.95);
}

/* Children — staggered fade/slide */
.nav-logo,
.nav-item {
  transition:
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stagger: when expanding, items come in left-to-right.
   When collapsing, right-to-left (handled by reversed delays below). */
.nav-shell[data-state="expanded"] .nav-logo  { transition-delay: 0.18s; }
.nav-shell[data-state="expanded"] .nav-item:nth-child(1) { transition-delay: 0.22s; }
.nav-shell[data-state="expanded"] .nav-item:nth-child(2) { transition-delay: 0.29s; }
.nav-shell[data-state="expanded"] .nav-item:nth-child(3) { transition-delay: 0.36s; }
.nav-shell[data-state="expanded"] .nav-item:nth-child(4) { transition-delay: 0.43s; }
.nav-shell[data-state="expanded"] .nav-item:nth-child(5) { transition-delay: 0.50s; }

/* Collapsed state */
.nav-shell[data-state="collapsed"] .nav-logo {
  opacity: 0;
  transform: translateX(-25px) rotate(-180deg);
  pointer-events: none;
  transition-duration: 0.3s;
  transition-delay: 0s;
}
.nav-shell[data-state="collapsed"] .nav-items {
  pointer-events: none;
}
.nav-shell[data-state="collapsed"] .nav-item {
  opacity: 0;
  transform: translateX(-20px) scale(0.95);
  transition-duration: 0.2s;
}
/* Reverse stagger on collapse (rightmost disappears first) */
.nav-shell[data-state="collapsed"] .nav-item:nth-child(5) { transition-delay: 0s; }
.nav-shell[data-state="collapsed"] .nav-item:nth-child(4) { transition-delay: 0.05s; }
.nav-shell[data-state="collapsed"] .nav-item:nth-child(3) { transition-delay: 0.10s; }
.nav-shell[data-state="collapsed"] .nav-item:nth-child(2) { transition-delay: 0.15s; }
.nav-shell[data-state="collapsed"] .nav-item:nth-child(1) { transition-delay: 0.20s; }

/* Menu icon (hamburger) — bouncy pop on collapse */
.nav-menu-icon {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-shell[data-state="collapsed"] .nav-menu-icon {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.25s;
}

/* ====================================================================
   APP STORE & PLAY STORE BUTTONS (HOVER EFFECT)
   ==================================================================== */
.store-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.store-btn .btn-content {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.store-btn .btn-hover-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.store-btn:hover .btn-content {
  transform: translateY(-100%);
  opacity: 0;
}

.store-btn:hover .btn-hover-text {
  transform: translateY(0);
  opacity: 1;
}

/* ====================================================================
   PHONE3D — mount & frame
   ==================================================================== */
.phone-3d-mount {
  position: relative;
  width: 320px;
  height: 580px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone3d-glow {
  position: absolute;
  inset: 15%;
  border-radius: 9999px;
  pointer-events: none;
  background: radial-gradient(ellipse, oklch(0.62 0.22 220 / 0.35) 0%, oklch(0.45 0.20 230 / 0.12) 55%, transparent 80%);
  filter: blur(28px);
  animation: phone-ambient 5s ease-in-out infinite;
}
@keyframes phone-ambient {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.04); }
}

.phone3d-wrap {
  perspective: 1200px;
}
.phone3d-rot {
  transform-style: preserve-3d;
  opacity: 0;
  animation:
    phone-enter 1s cubic-bezier(0.22,1,0.36,1) forwards,
    phone-rot 8s 1s ease-in-out infinite;
}
@keyframes phone-rot {
  0%, 100% { transform: rotateY(2deg) rotateX(1deg) translateY(0); }
  50%      { transform: rotateY(-2deg) rotateX(4deg) translateY(-8px); }
}
@keyframes phone-enter {
  from { opacity: 0; transform: translateY(40px) rotateX(15deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0); }
}

.phone3d-frame {
  width: 252px;
  height: 516px;
  border-radius: 44px;
  background: linear-gradient(145deg, #1c1f30 0%, #0d0f1a 60%, #0a0c16 100%);
  border: 1.5px solid rgba(255,255,255,0.13);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 40px 80px -12px rgba(0,0,0,0.9),
    0 20px 40px -8px rgba(0,100,220,0.18),
    inset 0 1px 0 rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.phone3d-btn-l {
  position: absolute;
  left: -3px;
  width: 3px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px 0 0 2px;
}
.phone3d-btn-r {
  position: absolute;
  right: -3px;
  width: 3px;
  background: rgba(255,255,255,0.10);
  border-radius: 0 2px 2px 0;
}
.phone3d-screen {
  margin: 10px 8px 8px 8px;
  border-radius: 36px;
  overflow: hidden;
  height: calc(100% - 18px);
  position: relative;
}
.phone3d-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 45%);
}
.phone3d-notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 18px;
  background: #0d0f1a;
  border-radius: 10px;
  z-index: 10;
}
.phone3d-cam {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(16px);
  width: 8px;
  height: 8px;
  background: #1a1a2e;
  border-radius: 50%;
  z-index: 11;
  box-shadow: inset 0 0 3px rgba(0,150,255,0.3);
}
.phone3d-highlight {
  position: absolute;
  inset: 0;
  border-radius: 44px;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, transparent 50%);
}
.phone3d-drop {
  width: 200px;
  height: 20px;
  margin: 0 auto;
  background: radial-gradient(ellipse, oklch(0.40 0.18 220 / 0.45) 0%, transparent 70%);
  filter: blur(14px);
  transform: translateY(6px);
}

/* ── Floating badges on Phone3D ── */
.float-badge {
  position: absolute;
  z-index: 30;
  opacity: 0;
  transform: translateY(12px) scale(0.7);
  animation: badge-in 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}
.float-badge > .inner {
  animation: badge-float 3.5s ease-in-out infinite alternate;
}
@keyframes badge-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes badge-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

.glass-badge {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ── Attendance screen ── */
.att-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #070c1d 0%, #090e20 50%, #080c1b 100%);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: white;
  position: relative;
  overflow: hidden;
}
.att-screen .phase {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.att-screen .glow-a {
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: oklch(0.62 0.22 220 / 0.10);
  filter: blur(28px);
  pointer-events: none;
}
.att-screen .glow-b {
  position: absolute;
  bottom: 60px; left: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: oklch(0.55 0.20 250 / 0.07);
  filter: blur(20px);
  pointer-events: none;
}

.att-fade { transition: opacity 0.35s ease; }

.att-spin {
  animation: spin-slow 20s linear infinite;
}
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(14,165,233,0.95), transparent);
  animation: scan-y 1.3s linear infinite;
}
@keyframes scan-y {
  from { transform: translateY(-54px); }
  to   { transform: translateY(54px); }
}

.scan-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(14,165,233,0.5);
  animation: scan-pulse 0.9s ease-out infinite;
}
@keyframes scan-pulse {
  from { transform: scale(1); opacity: 0.5; }
  to   { transform: scale(1.22); opacity: 0; }
}

.scan-text {
  animation: scan-blink 1.2s ease-in-out infinite;
}
@keyframes scan-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.btn-spin {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: white;
  animation: spin-fast 0.8s linear infinite;
}
@keyframes spin-fast { to { transform: rotate(360deg); } }

.check-anim path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: check-draw 0.5s ease-out 0.2s forwards;
}
@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}

.success-pop {
  opacity: 0;
  transform: scale(0.88);
  animation: success-pop 0.4s ease-out forwards;
}
@keyframes success-pop {
  to { opacity: 1; transform: scale(1); }
}

.success-icon {
  transform: scale(0);
  animation: icon-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes icon-pop {
  to { transform: scale(1); }
}

.fade-in-up {
  opacity: 0;
  transform: translateY(8px);
  animation: fade-up 0.4s 0.35s ease-out forwards;
}
@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

.gps-dot {
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ====================================================================
   FEATURES BENTO
   ==================================================================== */
.feature-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--card) 60%, transparent);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background 0.3s, border-color 0.3s;
}
.feature-card:hover {
  border-color: color-mix(in oklch, var(--border) 80%, transparent);
  background: color-mix(in oklch, var(--card) 80%, transparent);
}
.feature-card .glow-accent {
  position: absolute;
  top: -3rem; right: -3rem;
  width: 10rem; height: 10rem;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.feature-card:hover .glow-accent {
  opacity: 1;
}

/* GPS visual pulse */
.gps-pulse {
  animation: gps-pulse 2.5s ease-out infinite;
}
@keyframes gps-pulse {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.4; }
  50%  { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 0.4; }
}
.offline-dot {
  animation: offline-blink 1.5s ease-in-out infinite;
}
.offline-dot:nth-child(2) { animation-delay: 0.2s; }
.offline-dot:nth-child(3) { animation-delay: 0.4s; }
.offline-dot:nth-child(4) { animation-delay: 0.6s; }
.offline-dot:nth-child(5) { animation-delay: 0.8s; }
@keyframes offline-blink {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 1; }
}

/* ====================================================================
   TESTIMONIALS CAROUSEL
   ==================================================================== */
.testi-track {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.testi-slide {
  min-width: 100%;
  flex-shrink: 0;
  padding-left: 1rem;
}

/* ====================================================================
   PRICING — billing toggle
   ==================================================================== */
.billing-dot {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-billing="yearly"] .billing-dot {
  transform: translateX(20px);
}
[data-billing="yearly"] #billing-yearly-label { color: var(--foreground); }
[data-billing="yearly"] #billing-monthly-label { color: var(--muted-foreground); }

/* Featured card glow */
.pricing-card {
  transition: transform 0.25s ease;
}
.pricing-card:hover {
  transform: translateY(-6px);
}

/* ====================================================================
   FOOTER (Cinematic)
   ==================================================================== */
.cinematic-footer-wrapper {
  -webkit-font-smoothing: antialiased;
  --pill-bg: color-mix(in oklch, var(--foreground) 4%, transparent);
  --pill-border: color-mix(in oklch, var(--foreground) 10%, transparent);
  --pill-shadow: color-mix(in oklch, var(--background) 50%, transparent);
  --pill-highlight: color-mix(in oklch, var(--foreground) 8%, transparent);
  --pill-bg-hover: color-mix(in oklch, var(--foreground) 9%, transparent);
  --pill-border-hover: color-mix(in oklch, var(--foreground) 22%, transparent);
}
@keyframes footer-breathe {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.45; }
  100% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.75; }
}
@keyframes footer-scroll-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes footer-heartbeat {
  0%, 100% { transform: scale(1); }
  20%       { transform: scale(1.25); }
  40%       { transform: scale(1); }
}
.animate-footer-breathe       { animation: footer-breathe 9s ease-in-out infinite alternate; }
.animate-footer-scroll-marquee { animation: footer-scroll-marquee 45s linear infinite; }
.animate-footer-heartbeat     { animation: footer-heartbeat 2.2s ease-in-out infinite; }

.footer-bg-grid {
  background-size: 60px 60px;
  background-image:
    linear-gradient(to right, color-mix(in oklch, var(--foreground) 4%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklch, var(--foreground) 4%, transparent) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
}
.footer-aurora {
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in oklch, var(--primary) 12%, transparent) 0%,
    color-mix(in oklch, var(--ring) 8%, transparent) 40%,
    transparent 70%
  );
}
.footer-glass-pill {
  background: var(--pill-bg);
  box-shadow: 0 8px 24px -8px var(--pill-shadow), inset 0 1px 0 var(--pill-highlight);
  border: 1px solid var(--pill-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}
.footer-glass-pill:hover {
  background: var(--pill-bg-hover);
  border-color: var(--pill-border-hover);
  box-shadow: 0 16px 32px -8px var(--pill-shadow);
  color: var(--foreground);
}
.footer-giant-bg-text {
  font-size: 26vw;
  line-height: 0.75;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in oklch, var(--foreground) 6%, transparent);
}

/* ── Footer bottom credit pill ── */
.footer-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  line-height: 1;
  white-space: nowrap;
}
.footer-credit-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted-foreground);
}
.footer-credit-heart {
  font-size: 14px;
  color: var(--destructive);
  display: inline-block;
  line-height: 1;
}
.footer-credit-brand {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--foreground);
  margin-left: 2px;
}

/* ── Misc tailwind v4 patches ── */
.hover\:bg-white\/8:hover { background-color: rgb(255 255 255 / 0.08); }
