/* ============================================
   KAFIICAN DIGITAL — Shared Styles
   ============================================ */

:root {
  --navy: #0F172A;
  --navy-2: #1E293B;
  --orange: #F97316;
  --orange-soft: #FFF3E9;
  --ink: #1F2937;
  --mist: #F8FAFC;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display { font-family: 'Sora', 'Inter', sans-serif; }

::selection { background: var(--orange); color: #fff; }

/* ---------- Navbar ---------- */
#navbar { transition: box-shadow .35s ease, background-color .35s ease, padding .35s ease; }
#navbar.scrolled { box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .45); }

.nav-link { position: relative; transition: color .25s ease; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 2px; background: var(--orange);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.65, 0, .35, 1);
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--orange); }

/* Mobile menu */
#mobileMenu { transition: max-height .45s cubic-bezier(.65,0,.35,1), opacity .35s ease; max-height: 0; opacity: 0; overflow: hidden; }
#mobileMenu.open { max-height: 480px; opacity: 1; }

/* ---------- Buttons ---------- */
.btn-primary {
  position: relative; overflow: hidden;
  background: var(--orange); color: #fff;
  transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 0 8px 20px -8px rgba(249, 115, 22, .55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(249, 115, 22, .65); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.btn-primary:hover::before { transform: translateX(120%); }

.btn-ghost {
  border: 1.5px solid rgba(255,255,255,.35); color: #fff;
  transition: border-color .25s, background .25s, transform .25s;
}
.btn-ghost:hover { border-color: var(--orange); background: rgba(249,115,22,.12); transform: translateY(-2px); }

.btn-outline-navy {
  border: 1.5px solid #E2E8F0; color: var(--navy);
  transition: all .25s ease;
}
.btn-outline-navy:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.5,0,.2,1), transform .7s cubic-bezier(.5,0,.2,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-left { opacity: 0; transform: translateX(-36px); transition: opacity .7s ease, transform .7s cubic-bezier(.5,0,.2,1); }
.reveal-right { opacity: 0; transform: translateX(36px); transition: opacity .7s ease, transform .7s cubic-bezier(.5,0,.2,1); }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(.92); transition: opacity .6s ease, transform .6s cubic-bezier(.34,1.56,.64,1); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* Stagger children */
.stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.5,0,.2,1); }
.stagger.visible > * { opacity: 1; transform: none; }
.stagger.visible > *:nth-child(1) { transition-delay: .05s; }
.stagger.visible > *:nth-child(2) { transition-delay: .15s; }
.stagger.visible > *:nth-child(3) { transition-delay: .25s; }
.stagger.visible > *:nth-child(4) { transition-delay: .35s; }
.stagger.visible > *:nth-child(5) { transition-delay: .45s; }
.stagger.visible > *:nth-child(6) { transition-delay: .55s; }

/* ---------- Hero ---------- */
.hero-grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}

.glow-orb {
  position: absolute; border-radius: 9999px; filter: blur(90px); opacity: .35;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.12); }
}

.hero-badge { animation: fadeDown .8s .1s both cubic-bezier(.5,0,.2,1); }
.hero-h1   { animation: fadeUp .9s .25s both cubic-bezier(.5,0,.2,1); }
.hero-sub  { animation: fadeUp .9s .45s both cubic-bezier(.5,0,.2,1); }
.hero-cta  { animation: fadeUp .9s .65s both cubic-bezier(.5,0,.2,1); }
.hero-mock { animation: mockIn 1.1s .55s both cubic-bezier(.34,1.2,.5,1); }

@keyframes fadeUp   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes mockIn   { from { opacity: 0; transform: translateY(46px) rotateX(14deg) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Dashboard mockups (pure CSS "screenshots") ---------- */
.mockup {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 16px;
  box-shadow: 0 30px 60px -20px rgba(15,23,42,.35);
  overflow: hidden;
}
.mockup-dark { background: var(--navy-2); border-color: rgba(255,255,255,.08); }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid #EDF2F7; }
.mockup-dark .mock-bar { border-color: rgba(255,255,255,.08); }
.mock-dot { width: 9px; height: 9px; border-radius: 50%; }

.mock-chart-bar {
  width: 100%; background: linear-gradient(180deg, var(--orange), #FDBA74);
  border-radius: 6px 6px 2px 2px; transform-origin: bottom; transform: scaleY(0);
}
.visible .mock-chart-bar, .hero-mock .mock-chart-bar { animation: growBar 1s 1s both cubic-bezier(.34,1.3,.5,1); }
.hero-mock .mock-chart-bar:nth-child(1), .visible .mock-chart-bar:nth-child(1) { animation-delay: 1.0s; }
.hero-mock .mock-chart-bar:nth-child(2), .visible .mock-chart-bar:nth-child(2) { animation-delay: 1.1s; }
.hero-mock .mock-chart-bar:nth-child(3), .visible .mock-chart-bar:nth-child(3) { animation-delay: 1.2s; }
.hero-mock .mock-chart-bar:nth-child(4), .visible .mock-chart-bar:nth-child(4) { animation-delay: 1.3s; }
.hero-mock .mock-chart-bar:nth-child(5), .visible .mock-chart-bar:nth-child(5) { animation-delay: 1.4s; }
.hero-mock .mock-chart-bar:nth-child(6), .visible .mock-chart-bar:nth-child(6) { animation-delay: 1.5s; }
.hero-mock .mock-chart-bar:nth-child(7), .visible .mock-chart-bar:nth-child(7) { animation-delay: 1.6s; }
@keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.mock-line { height: 8px; border-radius: 99px; background: #E9EEF5; }
.mockup-dark .mock-line { background: rgba(255,255,255,.12); }

.float-card { animation: floaty 5.5s ease-in-out infinite alternate; }
.float-card-2 { animation: floaty 6.5s 1s ease-in-out infinite alternate-reverse; }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-14px); } }

/* ---------- Cards ---------- */
.lift-card {
  transition: transform .35s cubic-bezier(.34,1.3,.5,1), box-shadow .35s ease, border-color .35s ease;
  border: 1px solid #EDF2F7;
}
.lift-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px -18px rgba(15,23,42,.18);
  border-color: rgba(249,115,22,.4);
}

.icon-pop { transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .3s, color .3s; }
.lift-card:hover .icon-pop { transform: scale(1.1) rotate(-6deg); }

.service-card { position: relative; overflow: hidden; }
.service-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--orange), #FDBA74);
  transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.65,0,.35,1);
}
.service-card:hover::before { transform: scaleX(1); }

/* Project cards */
.project-card { overflow: hidden; }
.project-card .proj-thumb { transition: transform .6s cubic-bezier(.5,0,.2,1); }
.project-card:hover .proj-thumb { transform: scale(1.05); }
.project-card .proj-overlay {
  opacity: 0; transition: opacity .4s ease;
  background: linear-gradient(180deg, rgba(15,23,42,0) 20%, rgba(15,23,42,.86) 100%);
}
.project-card:hover .proj-overlay { opacity: 1; }

/* Filter buttons */
.filter-btn { transition: all .25s ease; border: 1.5px solid #E2E8F0; }
.filter-btn:hover { border-color: var(--orange); color: var(--orange); }
.filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Marquee / ticker ---------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 3.5rem; width: max-content; animation: marquee 26s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--orange), #E2E8F0);
}
@media (min-width: 768px) {
  .timeline::before { left: 50%; transform: translateX(-50%); }
}

/* ---------- Accordion-ish hover features ---------- */
.feature-row { transition: background .25s ease, padding-left .25s ease; border-left: 3px solid transparent; }
.feature-row:hover { background: var(--mist); border-left-color: var(--orange); padding-left: 1.25rem; }

/* ---------- Forms ---------- */
.field {
  width: 100%; border: 1.5px solid #E2E8F0; border-radius: 12px;
  padding: .8rem 1rem; background: #fff; outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.field:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(249,115,22,.12); }

/* ---------- Back to top ---------- */
#toTop { opacity: 0; pointer-events: none; transform: translateY(12px); transition: all .35s ease; }
#toTop.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Tilt ---------- */
.tilt { transform-style: preserve-3d; transition: transform .2s ease; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background:
    radial-gradient(900px 320px at 85% -10%, rgba(249,115,22,.22), transparent 60%),
    radial-gradient(700px 300px at 10% 110%, rgba(56,128,255,.14), transparent 60%),
    var(--navy);
}

/* ---------- Breadcrumb ---------- */
.crumb a { transition: color .2s; }
.crumb a:hover { color: var(--orange); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible { outline: 3px solid rgba(249,115,22,.55); outline-offset: 2px; border-radius: 8px; }
