/* Kastar website UI kit — scoped styles */

/* FADE-IN SCROLL ANIMATION */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.kn-root { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; min-height: 100vh; background: var(--bg); color: var(--fg); transition: background 0.3s, color 0.3s; }

/* NAV */
.kn-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(12, 27, 51, 0.70);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(8px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.light .kn-nav { background: rgba(255, 255, 255, 0.75); }

.kn-nav.kn-nav-scrolled {
  background: rgba(7, 14, 28, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.30);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
.light .kn-nav.kn-nav-scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 20px rgba(12, 27, 51, 0.12);
  border-bottom-color: #e4e8f2;
}

.kn-nav-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 36px;
  display: flex; align-items: center; justify-content: space-between;
  height: 90px;
  transition: height 0.3s ease;
  min-width: 0;
}
.kn-nav.kn-nav-scrolled .kn-nav-inner { height: 65px; }

.kn-nav-logo { transition: transform 0.3s ease; transform-origin: left center; }
.kn-nav.kn-nav-scrolled .kn-nav-logo { transform: scale(0.8); }
.kn-nav-logo-img { height: 80px; width: auto; display: block; }

.kn-nav-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.kn-nav-links { display: flex; gap: 32px; list-style: none; padding: 0; margin: 0; }
.kn-nav-links a { text-decoration: none; font-size: 17px; font-weight: 600; transition: color 0.2s; color: var(--fg); letter-spacing: 0.2px; }
.kn-nav-links a:hover { color: var(--accent); }
.kn-btn-cta { background: var(--accent); color: var(--btn-gold-fg); border: none; padding: 10px 22px; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; transition: opacity 0.2s; }
.kn-btn-cta:hover { opacity: 0.85; }
.kn-mode-toggle { background: none; border: 1.5px solid var(--nav-border); border-radius: 8px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg); transition: border-color 0.2s; padding: 0; }
.kn-mode-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kn-mode-toggle:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .kn-nav-inner {
    height: 72px;
    padding: 0 20px;
  }
  .kn-nav.kn-nav-scrolled .kn-nav-inner {
    height: 62px;
  }
  .kn-nav-logo-img {
    height: 54px;
  }
  .kn-nav.kn-nav-scrolled .kn-nav-logo {
    transform: scale(0.86);
  }
  .kn-nav-right {
    gap: 10px;
  }
  .kn-nav-links {
    display: none;
  }
  .kn-btn-cta {
    padding: 9px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* HERO */
.kn-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  touch-action: pan-y;
}
.kn-hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.kn-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(1.018);
  transition:
    opacity 1250ms ease-in-out,
    transform 1250ms ease-in-out;
  will-change: opacity, transform;
}
.kn-hero-slide.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.kn-hero-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  transform: translate3d(0, 0, 0) scale(1.025);
  backface-visibility: hidden;
  will-change: transform;
}
.kn-hero-slide.is-active .kn-hero-bg {
  animation: kn-soft-drift 5800ms ease-out forwards;
}
.kn-hero-slide-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 10, 20, 0.28) 0%, rgba(4, 10, 20, 0.54) 100%),
    radial-gradient(circle at 50% 44%, rgba(12, 27, 51, 0.06) 0%, rgba(7, 14, 28, 0.36) 74%);
  opacity: 0.72;
  transition: opacity 1250ms ease-in-out;
  will-change: opacity;
}
.kn-hero-slide.is-active .kn-hero-slide-overlay {
  opacity: 1;
}
.kn-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 14, 28, 0.18) 0%, rgba(7, 14, 28, 0.04) 48%, rgba(7, 14, 28, 0.18) 100%),
    linear-gradient(180deg, rgba(7, 14, 28, 0.16) 0%, rgba(7, 14, 28, 0.12) 48%, rgba(7, 14, 28, 0.30) 100%);
  pointer-events: none;
}
@keyframes kn-soft-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1.025);
  }
  to {
    transform: translate3d(0, -8px, 0) scale(1.045);
  }
}
.kn-hero-inner { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 100px 36px; display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; }
.kn-hero-h1 { font-family: var(--font-display); font-size: clamp(28px, 3.5vw, 52px); font-weight: 700; line-height: 1.1; color: #fff; letter-spacing: -1.5px; margin: 0 0 24px; max-width: 900px; text-wrap: balance; }
.kn-hero-h1 em { font-style: normal; color: #f0d060; }
.kn-hero-btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.kn-hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  background: rgba(7,14,28,0.24);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(12px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.kn-hero-arrow:hover {
  background: rgba(7,14,28,0.42);
  border-color: rgba(240,208,96,0.55);
  color: #f0d060;
  transform: translateY(-50%) scale(1.04);
}
.kn-hero-arrow svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kn-hero-arrow-prev { left: clamp(18px, 4vw, 54px); }
.kn-hero-arrow-next { right: clamp(18px, 4vw, 54px); }
.kn-hero-dots {
  position: absolute;
  left: 50%;
  bottom: clamp(26px, 5vh, 48px);
  z-index: 3;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}
.kn-hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}
.kn-hero-dot.is-active {
  width: 28px;
  background: #f0d060;
}
@media (max-width: 640px) {
  .kn-hero {
    min-height: 720px;
    height: 100svh;
  }
  .kn-hero-inner {
    padding: 96px 24px 112px;
  }
  .kn-hero-arrow {
    width: 38px;
    height: 38px;
    top: auto;
    bottom: 72px;
    transform: none;
  }
  .kn-hero-arrow:hover {
    transform: none;
  }
  .kn-hero-arrow-prev { left: 24px; }
  .kn-hero-arrow-next { right: 24px; }
  .kn-hero-dots {
    bottom: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .kn-hero-slide,
  .kn-hero-slide-overlay {
    transition-duration: 200ms;
  }
  .kn-hero-slide.is-active .kn-hero-bg {
    animation: none;
    transform: none;
  }
}
.kn-btn-gold { background: var(--brand-gold); color: #0c1b33; padding: 14px 28px; border-radius: 8px; font-weight: 700; font-size: 15px; cursor: pointer; border: none; font-family: inherit; transition: opacity 0.2s, transform 0.15s; }
.kn-btn-gold:hover { opacity: 0.88; transform: translateY(-1px); }
.kn-btn-outline { background: transparent; color: rgba(255,255,255,0.85); padding: 14px 28px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; border: 2px solid rgba(255,255,255,0.25); font-family: inherit; transition: border-color 0.2s, color 0.2s; }
.kn-btn-outline:hover { border-color: var(--brand-gold); color: var(--brand-gold); }

/* SECTIONS */
.kn-sec { padding: 80px 36px; }
.kn-sec-dark  { background: var(--section-alt-bg); }
.kn-sec-light { background: var(--bg); }
.light .kn-sec-light { background: var(--surface-2); }
.light .kn-sec-dark {
  background: var(--surface);
  border-block: 1px solid var(--border-soft);
}
.kn-sec-inner { max-width: 1240px; margin: 0 auto; }
.kn-eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.kn-h2 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 42px); font-weight: 700; letter-spacing: -0.8px; margin: 0 0 12px; text-wrap: pretty; }
.kn-h2.on-dark { color: #fff; }
.kn-h2.on-light { color: var(--fg); }
.kn-sub { font-size: 16px; line-height: 1.7; max-width: 560px; margin: 0 0 52px; }
/* Dark-mode alternate sections use white text. */
.kn-sub.on-dark { color: rgba(255, 255, 255, 0.85); }
/* on-light sections have theme-dependent bg — use muted token (light in dark mode, dark in light mode) */
.kn-sub.on-light { color: var(--fg-muted); }
.light .kn-h2.on-dark { color: var(--fg); }
.light .kn-sub.on-dark { color: var(--fg-muted); }

/* SERVICES */
.kn-services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.kn-services-grid-count-5 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.kn-services-grid-count-5 .kn-svc-card {
  grid-column: span 2;
}
.kn-services-grid-count-5 .kn-svc-card:nth-child(4) {
  grid-column: 2 / span 2;
}
.kn-services-grid-count-5 .kn-svc-card:nth-child(5) {
  grid-column: 4 / span 2;
}
.kn-svc-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  transition:
    transform    0.25s ease,
    background   0.25s ease,
    border-color 0.25s ease,
    box-shadow   0.25s ease;
}
.kn-svc-card:hover {
  transform: translateY(-8px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(250,204,21,0.40);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.28),
    0  4px 16px rgba(0,0,0,0.18),
    0  0  24px rgba(250,204,21,0.10),
    0  0   0 1px rgba(250,204,21,0.20) inset;
}
.kn-svc-icon { width: 46px; height: 46px; background: rgba(201,162,23,0.15); border: 1px solid rgba(201,162,23,0.25); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.kn-svc-icon svg { width: 22px; height: 22px; stroke: var(--brand-gold); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kn-svc-title { font-size: 16px; font-weight: 700; color: var(--brand-gold); margin-bottom: 8px; }
.kn-svc-desc  { font-size: 14px; color: #ffffff; line-height: 1.65; }
.kn-svc-card-link { text-decoration: none; color: inherit; }
.kn-svc-more { font-size: 13px; font-weight: 700; color: rgba(201,162,23,0.55); margin-top: 18px; display: inline-block; transition: color 0.25s ease, transform 0.25s ease; }
.kn-svc-card:hover .kn-svc-more { color: var(--brand-gold); transform: translateX(5px); }
.light .kn-svc-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.light .kn-svc-card:hover {
  background: #ffffff;
  border-color: var(--accent-border);
  box-shadow: 0 16px 40px rgba(12, 27, 51, 0.14), 0 0 0 1px rgba(176,140,16,0.14) inset;
}
.light .kn-svc-title,
.light .kn-svc-more { color: var(--accent); }
.light .kn-svc-desc { color: var(--fg-muted); }

@media (max-width: 980px) {
  .kn-services-grid,
  .kn-services-grid-count-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kn-services-grid-count-5 .kn-svc-card,
  .kn-services-grid-count-5 .kn-svc-card:nth-child(4),
  .kn-services-grid-count-5 .kn-svc-card:nth-child(5) {
    grid-column: auto;
  }
  .kn-services-grid-count-5 .kn-svc-card:last-child {
    grid-column: 1 / -1;
    max-width: calc(50% - 10px);
    width: 100%;
    justify-self: center;
  }
}

@media (max-width: 620px) {
  .kn-services-grid,
  .kn-services-grid-count-5 {
    grid-template-columns: 1fr;
  }
  .kn-services-grid-count-5 .kn-svc-card:last-child {
    grid-column: auto;
    max-width: none;
  }
}

/* LIGHT THEME — section-level overrides for elements that don't use CSS variables */

/* Section backgrounds respond to the theme token */
.kn-sec-light {
  transition: background-color 0.3s ease;
}

/* In light mode, service cards inside dark sections still look fine (dark section stays dark).
   Only the cert cards (in a light section) need a light-mode style — those already use var(--surface). */

/* Blog cards follow the active theme. */

/* Footer always stays dark navy — no override needed. */

/* CERTS */
.kn-certs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.kn-cert-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px 20px; text-align: center; }
.kn-cert-badge { width: 56px; height: 56px; background: var(--accent-tint); border: 1px solid var(--accent-border); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.kn-cert-badge svg { width: 26px; height: 26px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kn-cert-name { font-size: 14px; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.kn-cert-org  { font-size: 12px; color: var(--fg-muted); }

/* BLOG */
.kn-blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.kn-blog-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
.kn-blog-card:hover { transform: translateY(-3px); border-color: rgba(201,162,23,0.3); }
.kn-blog-thumb { height: 140px; background: #0a1628; display: flex; align-items: center; justify-content: center; font-size: 11px; color: rgba(255,255,255,0.30); font-family: ui-monospace, monospace; border-bottom: 1px solid rgba(255,255,255,0.05); }
.kn-blog-body { padding: 20px; }
.kn-blog-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--brand-gold); margin-bottom: 8px; }
.kn-blog-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 8px; line-height: 1.4; text-wrap: pretty; }
.kn-blog-excerpt { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.6; }
.kn-blog-date { margin-top: 14px; font-size: 12px; color: rgba(255,255,255,0.40); }
.light .kn-blog-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.light .kn-blog-thumb {
  background: var(--surface-2);
  color: var(--fg-subtle);
  border-bottom-color: var(--border);
}
.light .kn-blog-title { color: var(--fg); }
.light .kn-blog-excerpt,
.light .kn-blog-date { color: var(--fg-muted); }

/* CONTACT */
.kn-contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: start; }
.kn-contact-info { display: flex; flex-direction: column; gap: 22px; margin-top: 8px; }
.kn-ci-item { display: flex; align-items: flex-start; gap: 16px; }
.kn-ci-item > div:last-child { min-width: 0; }
.kn-ci-icon { width: 46px; height: 46px; background: var(--accent-tint); border: 1px solid var(--accent-border); border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.kn-ci-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kn-ci-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 4px; }
.kn-ci-value { font-size: 14px; font-weight: 600; color: var(--fg); white-space: pre-line; }

.kn-form { display: flex; flex-direction: column; gap: 16px; }
.kn-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.kn-form-field { display: flex; flex-direction: column; gap: 6px; }
.kn-form-field label { font-size: 13px; font-weight: 600; color: var(--fg); }
.kn-form-field input, .kn-form-field textarea {
  background: var(--form-bg); border: 1.5px solid var(--form-border);
  border-radius: 8px; padding: 12px 14px; font-family: inherit; font-size: 14px;
  color: var(--form-fg); outline: none;
  transition: border-color 0.2s, background-color 0.3s ease, color 0.3s ease;
  width: 100%;
  min-width: 0;
}
.kn-form-field input:focus, .kn-form-field textarea:focus { border-color: var(--accent); }
.kn-form-field textarea { resize: vertical; min-height: 110px; }
.kn-form-submit { background: var(--accent); color: var(--btn-gold-fg); border: none; padding: 14px 32px; border-radius: 8px; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; align-self: flex-start; transition: opacity 0.2s; }
.kn-form-submit:hover { opacity: 0.85; }
.kn-form-success { padding: 36px; text-align: center; background: var(--accent-tint); border: 1px solid var(--accent-border); border-radius: 14px; }
.kn-body-sm { font-size: 14px; color: var(--fg-muted); }

/* MAP */
.kn-map { position: relative; width: 100%; height: 450px; background: #0a1628; }
.kn-map iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(0.15) contrast(1.05); }
.kn-map-link { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--brand-gold, #c9a217); color: #0c1b33; padding: 12px 22px; border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.08); transition: transform 0.15s, opacity 0.15s; white-space: nowrap; z-index: 2; }
.kn-map-link:hover { transform: translateX(-50%) translateY(-1px); opacity: 0.92; }

/* FOOTER */
.kn-footer { background: var(--footer-bg); border-top: 1px solid rgba(255,255,255,0.07); padding: 36px; }
.kn-footer-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.kn-footer-logo img { height: 44px; width: auto; mix-blend-mode: lighten; display: block; }

/* WHATSAPP BUTTON */
.kn-wa-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(37,211,102,0.40), 0 2px 8px rgba(0,0,0,0.20);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.kn-wa-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 28px rgba(37,211,102,0.55), 0 4px 12px rgba(0,0,0,0.25);
}
.kn-wa-icon {
  width: 32px;
  height: 32px;
  color: #ffffff;
  flex-shrink: 0;
}
.kn-wa-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(15,23,42,0.92);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.kn-wa-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: rgba(15,23,42,0.92);
}
.kn-wa-btn:hover .kn-wa-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
@media (max-width: 640px) {
  .kn-wa-btn { bottom: 16px; right: 16px; width: 56px; height: 56px; }
  .kn-wa-tooltip { display: none; }
}
.kn-footer-copy { font-size: 13px; color: var(--footer-fg); }

@media (max-width: 900px) {
  .kn-certs-grid,
  .kn-blog-grid,
  .kn-contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kn-contact-grid {
    gap: 44px;
  }
}

@media (max-width: 640px) {
  .kn-sec {
    padding: 64px 20px;
  }
  .kn-hero-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
  .kn-certs-grid,
  .kn-blog-grid,
  .kn-contact-grid,
  .kn-form-row {
    grid-template-columns: 1fr;
  }
  .kn-contact-grid {
    gap: 34px;
  }
  .kn-footer {
    padding: 30px 20px;
  }
}
