/* =====================================================
   KarpLabs — Component Styles
   karplabs.in
   ===================================================== */

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
  white-space: nowrap;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--md-primary-600);
  color: white;
  border-color: var(--md-primary-600);
}
.btn-primary:hover {
  background-color: var(--md-primary-700);
  border-color: var(--md-primary-700);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

.btn-ghost {
  background-color: transparent;
  color: var(--md-primary-600);
  border-color: var(--md-primary-600);
}
.btn-ghost:hover {
  background-color: var(--md-primary-50);
  color: var(--md-primary-700);
  border-color: var(--md-primary-700);
}

.btn-ghost-white {
  background-color: transparent;
  color: white;
  border-color: rgba(255,255,255,0.55);
}
.btn-ghost-white:hover {
  background-color: rgba(255,255,255,0.12);
  color: white;
  border-color: rgba(255,255,255,0.85);
}

.btn-white {
  background-color: white;
  color: var(--md-primary-700);
  border-color: white;
}
.btn-white:hover {
  background-color: var(--md-primary-50);
  color: var(--md-primary-700);
  box-shadow: var(--shadow-2);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.875rem;
  min-height: 36px;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.4;
}
.badge-ios     { background-color: #e8f0fe; color: #1a73e8; }
.badge-android { background-color: #e6f4ea; color: #137333; }
.badge-web     { background-color: #fff3e0; color: #e65100; }
.badge-beta    { background-color: #fce4ec; color: #b71c1c; }

/* ─── Navbar ─── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--md-primary-700);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.site-nav.scrolled {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1);
}

@media (prefers-color-scheme: dark) {
  .site-nav.scrolled {
    background-color: rgba(18, 18, 18, 0.92);
  }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo__wordmark {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}
/* PLACEHOLDER: when logo SVG is ready, add it as <img> inside .nav-logo */

.site-nav.scrolled .nav-logo__wordmark {
  color: var(--md-primary-700);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background-color 0.2s;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-links a:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.site-nav.scrolled .nav-links a {
  color: var(--md-on-surface-muted);
}
.site-nav.scrolled .nav-links a:hover {
  color: var(--md-primary-600);
  background-color: var(--md-primary-50);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-cta .btn {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.35);
  padding: 8px 18px;
  font-size: 0.875rem;
  min-height: 36px;
}
.nav-cta .btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.65);
  color: white;
  transform: none;
  box-shadow: none;
}

.site-nav.scrolled .nav-cta .btn {
  background-color: var(--md-primary-600);
  color: white;
  border-color: var(--md-primary-600);
}
.site-nav.scrolled .nav-cta .btn:hover {
  background-color: var(--md-primary-700);
  border-color: var(--md-primary-700);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: white;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.site-nav.scrolled .nav-toggle span {
  background-color: var(--md-on-surface);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--md-primary-900);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.nav-mobile-overlay.active {
  opacity: 1;
}
.nav-mobile-overlay a {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  padding: 14px 40px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
  min-height: 56px;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}
.nav-mobile-overlay a:hover,
.nav-mobile-overlay a:focus-visible {
  color: white;
  background-color: rgba(255, 255, 255, 0.08);
}
.nav-mobile-overlay .btn {
  margin-top: 16px;
  font-size: 1rem;
  min-height: 52px;
  padding: 14px 40px;
}
.nav-mobile-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color 0.2s;
}
.nav-mobile-close:hover { color: white; }

@media (max-width: 768px) {
  .nav-links,
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ─── Section Header ─── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header__eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--md-primary-600);
  margin-bottom: 12px;
  display: block;
}
.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--md-on-surface);
  margin-bottom: 12px;
}
.section-header p {
  font-size: 1.0625rem;
  color: var(--md-on-surface-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Product Card ─── */
.product-card {
  background: var(--md-surface);
  border: 1.5px solid var(--md-divider);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.product-card:hover {
  box-shadow: var(--shadow-3);
  border-color: var(--md-primary-500);
  transform: translateY(-3px);
  color: inherit;
}

.product-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* PLACEHOLDER: replace with <img src="..." alt="..."> when app icon is ready */
.product-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.03em;
}
.product-card__icon--waulty {
  background: linear-gradient(135deg, var(--md-primary-600) 0%, var(--md-secondary-500) 100%);
}

.product-card__badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 4px;
}

.product-card__name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--md-on-surface);
  margin-bottom: 4px;
}
.product-card__tagline {
  font-size: 0.875rem;
  color: var(--md-on-surface-muted);
  font-weight: 500;
  margin-bottom: 0;
}

.product-card__divider {
  height: 1px;
  background: var(--md-divider);
  margin: 16px 0;
}

.product-card__desc {
  font-size: 0.875rem;
  color: var(--md-on-surface-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--md-primary-600);
  margin-top: auto;
  transition: gap 0.2s ease, color 0.2s ease;
}
.product-card:hover .product-card__cta {
  gap: 10px;
  color: var(--md-primary-700);
}

/* ─── Feature Grid Item ─── */
.feature-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-icon {
  width: 48px;
  height: 48px;
  background-color: var(--md-primary-50);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg {
  width: 22px;
  height: 22px;
  color: var(--md-primary-600);
}
.feature-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--md-on-surface);
}
.feature-item p {
  font-size: 0.9375rem;
  color: var(--md-on-surface-muted);
  line-height: 1.65;
}

/* ─── Footer ─── */
.site-footer {
  background-color: var(--md-primary-900);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

/* PLACEHOLDER: replace .footer-brand__wordmark with <img> SVG logo */
.footer-brand__wordmark {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.footer-brand__tagline {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: 10px;
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  transition: background-color 0.2s, color 0.2s;
  text-decoration: none;
}
.footer-social a:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: white;
}
.footer-social a svg {
  width: 16px;
  height: 16px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col ul a {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col ul a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.35);
}

/* Scroll reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Form elements (shared) ─── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--md-on-surface);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--md-on-surface);
  background: var(--md-surface-variant);
  border: 1.5px solid var(--md-divider);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  min-height: 44px;
}
.form-control:focus,
.form-control:focus-visible {
  border-color: var(--md-primary-500);
  box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.12);
}
.form-control::placeholder {
  color: var(--md-on-surface-muted);
  opacity: 0.65;
}
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-error {
  display: none;
  font-size: 0.8125rem;
  color: #b71c1c;
  margin-top: 4px;
}
.form-group.has-error .form-control {
  border-color: #b71c1c;
}
.form-group.has-error .form-error {
  display: block;
}

.form-success {
  display: none;
  padding: 14px 16px;
  background: #e8f5e9;
  border-radius: var(--radius-sm);
  color: #1b5e20;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-top: 12px;
  border: 1px solid #a5d6a7;
}
.form-success.visible { display: block; }

/* ─── Responsive footer ─── */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 576px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
