/*
 * Karthick Traders — brand design system (static HTML/CSS/JS build).
 * Palette derived from the logo:
 *  Primary Royal Blue #2563EB, Secondary Blue #60A5FA,
 *  Accent Orange #F97316, Dark Text #1F2937, Background #F8FAFC.
 */

:root {
  --brand: #2563eb;
  --brand-light: #60a5fa;
  --brand-dark: #1d4ed8;
  --ink: #1f2937;
  --ink-muted: #4b5563;
  --surface: #f8fafc;
  --background: #f8fafc;
  --border: #e2e8f0;
  --accent: #f97316;
  --accent-soft: #ffedd5;
  --primary-soft: #dbeafe;

  --gradient-hero: linear-gradient(135deg, rgba(29,78,216,0.85) 0%, rgba(37,99,235,0.65) 45%, rgba(96,165,250,0.55) 100%);
  --gradient-brand: linear-gradient(120deg, #1d4ed8 0%, #2563eb 55%, #60a5fa 100%);
  --shadow-elegant: 0 20px 45px -25px rgba(37, 99, 235, 0.35);
  --shadow-card: 0 10px 30px -12px rgba(15, 23, 42, 0.12);
  --shadow-accent: 0 15px 35px -12px rgba(249, 115, 22, 0.45);
}

html { scroll-behavior: smooth; background: var(--background); }
body { background-color: var(--background); }
h1, h2, h3, h4, h5, h6 { font-family: "Poppins", ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.02em; }

/* ---------- layout helpers ---------- */
.container-x {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1.25rem;
  max-width: 80rem;
}
@media (min-width: 768px)  { .container-x { padding-inline: 2rem; } }
@media (min-width: 1280px) { .container-x { padding-inline: 3rem; } }

/* ---------- glass / gradient utilities ---------- */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 20px 60px -30px rgba(15, 23, 42, 0.35);
}
.glass-dark {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.text-gradient-brand {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-gradient { background: var(--gradient-hero); }
.hero-gradient-text {
  background: linear-gradient(120deg,#ffffff 0%,#bfdbfe 60%,#fdba74 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grid-bg {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ---------- animations ---------- */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.animate-marquee { animation: marquee 40s linear infinite; }

@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(1deg); }
}
.chip {
  position: absolute;
  z-index: 20;
  align-items: center;
  gap: 0.75rem;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.35);
  animation: float-slow 6s ease-in-out infinite;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  animation: chip-in 0.8s cubic-bezier(0.22,1,0.36,1) forwards, float-slow 6s ease-in-out infinite 0.8s;
}
@keyframes chip-in {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 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.in-view { opacity: 1; transform: translateY(0); }

/* ---------- header ---------- */
.header-anim { background: transparent; }
.header-anim.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px -15px rgba(15,23,42,0.15);
}
.nav-link { color: rgba(255,255,255,0.85); }
.header-anim.scrolled .nav-link { color: var(--ink); }
.header-anim.scrolled .nav-link:hover { color: var(--brand); }
.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; }
.header-anim.scrolled .nav-link.active { color: var(--brand); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: -1px;
  height: 2px; border-radius: 9999px;
  background: #fff;
}
.header-anim.scrolled .nav-link.active::after { background: var(--brand); }

#logo-badge { background: rgba(255,255,255,0.95); }
.header-anim.scrolled #logo-badge { background: transparent; box-shadow: none; backdrop-filter: none; }

#mobile-menu-btn { color: #fff; }
.header-anim.scrolled #mobile-menu-btn { color: var(--ink); }
.header-anim.scrolled #mobile-menu-btn:hover { background: #f1f5f9; }
#mobile-menu-btn:hover { background: rgba(255,255,255,0.1); }

.mobile-menu-collapsed { max-height: 0; opacity: 0; }
#mobile-menu { transition: max-height 0.3s ease, opacity 0.3s ease; max-height: 600px; opacity: 1; }

/* ---------- form ---------- */
.form-field {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(248,250,252,0.6);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.form-field:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}

/* ---------- splash screen ---------- */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(160deg, #0b1330 0%, #1d4ed8 55%, #2563eb 100%);
  transition: opacity 0.7s ease-in-out, transform 0.7s ease-in-out, visibility 0.7s;
}
.splash-screen.splash-hidden {
  opacity: 0;
  transform: scale(1.03);
  visibility: hidden;
  pointer-events: none;
}
.splash-orb {
  position: absolute;
  border-radius: 9999px;
  opacity: 0.4;
  filter: blur(64px);
  pointer-events: none;
}
.splash-orb-1 {
  height: 34rem; width: 34rem;
  background: radial-gradient(circle, rgba(96,165,250,0.55) 0%, transparent 70%);
  animation: orb1 14s ease-in-out infinite;
  top: 20%; left: 30%;
}
.splash-orb-2 {
  height: 26rem; width: 26rem;
  opacity: 0.3;
  right: 0; top: 0;
  background: radial-gradient(circle, rgba(249,115,22,0.55) 0%, transparent 70%);
  animation: orb2 16s ease-in-out infinite;
}
@keyframes orb1 { 0%,100% { transform: translate(-60px,-40px); } 50% { transform: translate(60px,30px); } }
@keyframes orb2 { 0%,100% { transform: translate(40px,30px); } 50% { transform: translate(-40px,-30px); } }
.splash-grid { position: absolute; inset: 0; opacity: 0.1; filter: invert(1); }
.splash-lines { position: absolute; inset: 0; height: 100%; width: 100%; opacity: 0.3; pointer-events: none; }
.splash-lines path {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: draw-line 2.4s ease-in-out forwards;
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.splash-sparks { position: absolute; inset: 0; pointer-events: none; }
.spark {
  position: absolute;
  bottom: 0;
  border-radius: 9999px;
  background: #fdba74;
  box-shadow: 0 0 6px 1px rgba(251,146,60,0.8);
  animation: spark-rise linear infinite;
}
@keyframes spark-rise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { transform: translateY(-100vh); opacity: 0; }
}
.splash-glow {
  position: absolute;
  height: 38rem; width: 38rem;
  border-radius: 9999px;
  opacity: 0.4;
  filter: blur(64px);
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
  pointer-events: none;
}
.splash-skip {
  position: absolute;
  right: 1.25rem; top: 1.25rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  padding: 0.5rem 0.75rem;
  color: #fff;
  backdrop-filter: blur(10px);
  transition: background 0.2s;
  font-size: 0.75rem;
  font-weight: 500;
}
.splash-skip:hover { background: rgba(255,255,255,0.2); }
@media (min-width: 640px) { .splash-skip { right: 2rem; top: 2rem; } }

.splash-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.5rem;
  text-align: center;
}
.splash-logo-wrap { position: relative; animation: splash-logo-in 0.7s ease-out; }
@keyframes splash-logo-in { from { opacity: 0; transform: translateY(16px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
.splash-ring-dashed {
  position: absolute; inset: 0; margin: -1.25rem;
  border-radius: 9999px;
  border: 1px dashed rgba(255,255,255,0.3);
  animation: spin 20s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash-ring-pulse {
  position: absolute; inset: 0; margin: -0.75rem;
  border-radius: 2rem;
  border: 2px solid rgba(255,255,255,0.4);
  animation: ring-pulse 2.2s ease-out infinite;
}
@keyframes ring-pulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}
.splash-logo-box {
  position: relative;
  border-radius: 1.5rem;
  background: rgba(255,255,255,0.95);
  padding: 1.5rem;
  box-shadow: 0 25px 60px -15px rgba(0,0,0,0.5);
}
@media (min-width: 640px) { .splash-logo-box { padding: 2rem; } }

.splash-stage-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
  transition: color 0.3s;
}
.splash-stage-label.active { color: #fff; }
.splash-stage-sep { height: 1px; width: 1rem; background: rgba(255,255,255,0.25); }
@media (min-width: 640px) { .splash-stage-sep { width: 2rem; } }

.splash-progress-seg {
  height: 0.25rem;
  flex: 1;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(255,255,255,0.2);
}
.splash-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  background: #f97316;
  transform-origin: left;
}
.splash-progress-fill.done { background: #fb923c; }
.splash-progress-fill.animating {
  background: linear-gradient(90deg, #f97316, #ffffff);
  animation: progress-grow linear forwards;
}
@keyframes progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.splash-stage-fade { animation: stage-fade-in 0.5s ease-out; }
@keyframes stage-fade-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
