/* KasaTech — Global Stylesheet */

:root {
  --bg: #0b0f14;
  --bg-alt: #10161d;
  --surface: #151c25;
  --surface-2: #1b232e;
  --border: #232c38;
  --text: #e8edf3;
  --text-muted: #9aa7b5;
  --accent: #0a84ff;
  --accent-2: #00d4a7;
  --accent-3: #e85d04;
  --radius: 14px;
  --max-width: 1180px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,15,20,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
}
.logo-img {
  height: 46px;
  width: auto;
  display: block;
}

nav.main-nav ul {
  display: flex;
  gap: 28px;
}
nav.main-nav a {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
nav.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--accent-2);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
nav.main-nav a:hover, nav.main-nav a.active { color: var(--text); }
nav.main-nav a:hover::after, nav.main-nav a.active::after { transform: scaleX(1); }

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
  animation: navGlow 3.5s ease-in-out infinite;
}
.nav-cta:hover { background: #0d6fd6; transform: translateY(-2px); animation-play-state: paused; }

@keyframes navGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(10,132,255,0); }
  50% { box-shadow: 0 0 18px rgba(10,132,255,0.55); }
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
  text-align: center;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(10,132,255,0.15), transparent 70%);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  width: 460px;
  height: 460px;
  top: -200px;
  left: 8%;
  background: radial-gradient(circle, rgba(10,132,255,0.35), transparent 70%);
  animation: heroDrift1 16s ease-in-out infinite;
}
.hero::after {
  width: 420px;
  height: 420px;
  bottom: -180px;
  right: 6%;
  background: radial-gradient(circle, rgba(0,212,167,0.3), transparent 70%);
  animation: heroDrift2 18s ease-in-out infinite;
}
.hero .container { position: relative; z-index: 1; }

@keyframes heroDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.12); }
}
@keyframes heroDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -40px) scale(1.15); }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero .eyebrow, .hero h1, .hero p.lead, .hero .hero-ctas {
  opacity: 0;
  animation: heroFadeUp 0.8s var(--ease) forwards;
}
.hero .eyebrow { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.15s; }
.hero p.lead { animation-delay: 0.3s; }
.hero .hero-ctas { animation-delay: 0.45s; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(0,212,167,0.1);
  border: 1px solid rgba(0,212,167,0.3);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 900px;
  margin: 0 auto 20px;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { position: relative; overflow: hidden; background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0d6fd6; }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; transition: transform 0.15s, border-color 0.2s; }
.btn-outline:hover { border-color: var(--accent); }

/* ---------- Sections ---------- */
section { padding: 90px 0; }
section.alt { background: var(--bg-alt); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Cards / Grid ---------- */
.grid {
  display: grid;
  gap: 28px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.3s var(--ease), border-color 0.25s, box-shadow 0.3s var(--ease), opacity 0.6s var(--ease);
}
.card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(10,132,255,0.4);
  box-shadow: 0 18px 40px rgba(10,132,255,0.18);
}

.icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,132,255,0.12);
  margin-bottom: 20px;
  font-size: 1.4rem;
  animation: iconFloat 4s ease-in-out infinite;
  transition: transform 0.25s var(--ease), background 0.25s;
}
.card:hover .icon-badge {
  animation-play-state: paused;
  transform: scale(1.12) rotate(-4deg);
  background: rgba(10,132,255,0.22);
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.card h3 { font-size: 1.15rem; margin: 0 0 10px; font-weight: 700; }
.card p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 14px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text-muted);
}

/* ---------- Portfolio ---------- */
.portfolio-card { position: relative; overflow: hidden; }
.concept-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(232,93,4,0.15);
  border: 1px solid rgba(232,93,4,0.4);
  color: var(--accent-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.thumb {
  height: 160px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}

/* ---------- Stats ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.stat h3 { font-size: 2.2rem; font-weight: 800; color: var(--accent-2); margin: 0 0 6px; }
.stat p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ---------- Process ---------- */
.process-list {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.process-step {
  text-align: center;
  padding: 24px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.25s;
}
.process-step:hover { border-color: rgba(10,132,255,0.4); transform: translateY(-3px); }
.process-step .num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin: 0 auto 14px;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; }

.form-status { display: none; margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; }
.form-status.show { display: block; }
.form-status.success { background: rgba(0,212,167,0.12); border: 1px solid var(--accent-2); color: var(--accent-2); }
.form-status.error { background: rgba(232,93,4,0.12); border: 1px solid var(--accent-3); color: var(--accent-3); }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-grid h4 { font-size: 0.9rem; margin: 0 0 16px; color: var(--text); }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: var(--text-muted); font-size: 0.9rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Blog ---------- */
.blog-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.blog-body { max-width: 720px; margin: 0 auto; }
.blog-body h1 { font-size: 2.2rem; margin-bottom: 12px; }
.blog-body p { color: var(--text-muted); margin-bottom: 20px; font-size: 1.02rem; }
.blog-body h2 { margin-top: 40px; margin-bottom: 14px; font-size: 1.4rem; }

/* ---------- Pricing ---------- */
.price-card { text-align: center; }
.price-card .price { font-size: 2.4rem; font-weight: 800; margin: 16px 0; }
.price-card .price span { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.price-card ul { text-align: left; margin: 20px 0; }
.price-card li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted); }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow); animation: featuredGlow 3s ease-in-out infinite; }
.price-card.featured:hover { animation-play-state: paused; }

@keyframes featuredGlow {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 10px 42px rgba(10,132,255,0.4); }
}

/* ---------- Scroll Reveal ---------- */
/* Base hidden state only applies once JS marks <html class="js-ready">, so
   content is never hidden if JavaScript fails to load. script.js reveals
   these via IntersectionObserver, adding .in-view when scrolled into view. */
.js-ready .card,
.js-ready .section-head,
.js-ready .stat,
.js-ready .process-step,
.js-ready .price-card,
.js-ready .form-card {
  opacity: 0;
  transform: translateY(28px);
}
.js-ready .card.in-view,
.js-ready .section-head.in-view,
.js-ready .stat.in-view,
.js-ready .process-step.in-view,
.js-ready .price-card.in-view,
.js-ready .form-card.in-view {
  opacity: 1;
  transform: translateY(0);
}
.js-ready .price-card.featured.in-view { transform: translateY(0); }

/* Staggered reveal timing for items within the same grid/row */
.grid > *:nth-child(1), .stats-row > *:nth-child(1), .process-list > *:nth-child(1) { transition-delay: 0s; }
.grid > *:nth-child(2), .stats-row > *:nth-child(2), .process-list > *:nth-child(2) { transition-delay: 0.08s; }
.grid > *:nth-child(3), .stats-row > *:nth-child(3), .process-list > *:nth-child(3) { transition-delay: 0.16s; }
.grid > *:nth-child(4), .stats-row > *:nth-child(4), .process-list > *:nth-child(4) { transition-delay: 0.24s; }
.grid > *:nth-child(5), .process-list > *:nth-child(5) { transition-delay: 0.32s; }
.grid > *:nth-child(6), .process-list > *:nth-child(6) { transition-delay: 0.4s; }

.section-head { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .process-list { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  nav.main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 24px;
    transition: max-height 0.35s var(--ease), opacity 0.3s ease, padding 0.35s var(--ease);
  }
  nav.main-nav.open { max-height: 400px; opacity: 1; padding: 20px 24px; }
  nav.main-nav ul { flex-direction: column; gap: 18px; }
  .menu-toggle { display: block; transition: transform 0.25s var(--ease); }
  .menu-toggle.open { transform: rotate(90deg); }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .process-list { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
  .hero { padding: 70px 0 50px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
