/* page.css — KI Technology Landing Page Styles */

/* ========== HEADER ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid oklch(from var(--color-border) l c h / 0.3);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header--scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.nav-link:hover {
  color: var(--color-text);
}
.nav-link.cta-link {
  color: var(--color-primary);
}
.nav-link.cta-link:hover {
  color: var(--color-primary-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive),
              background var(--transition-interactive);
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text);
}

.nav-mobile {
  display: none;
  padding: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.nav-mobile[aria-hidden="false"] {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.nav-mobile-link {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) 0;
  transition: color var(--transition-interactive);
}
.nav-mobile-link:hover,
.nav-mobile-link:active {
  color: var(--color-text);
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .mobile-menu-btn { display: flex; }
}

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    oklch(from var(--color-bg) l c h / 0.7) 0%,
    oklch(from var(--color-bg) l c h / 0.5) 40%,
    oklch(from var(--color-bg) l c h / 0.85) 100%
  );
}
.hero-gradient-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, oklch(from var(--color-primary) l c h / 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, oklch(from var(--color-primary) l c h / 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 50%, oklch(from var(--color-primary) l c h / 0.03) 0%, transparent 70%);
  animation: mesh-shift 15s ease-in-out infinite alternate;
}
@property --mesh-opacity {
  syntax: '<number>';
  initial-value: 1;
  inherits: false;
}
@keyframes mesh-shift {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* Subtle grain texture overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: var(--space-20) var(--space-4) var(--space-12);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: oklch(from var(--color-primary) l c h / 0.08);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.15);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: var(--space-8);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.hero-scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  opacity: 0.5;
}
.scroll-dot {
  animation: scroll-bounce 2s ease-in-out infinite;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.3; }
}

/* ========== BUTTONS ========== */
.btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive),
              border-color var(--transition-interactive);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 24px oklch(from var(--color-primary) l c h / 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  border-color: var(--color-text-muted);
  background: oklch(from var(--color-text) l c h / 0.04);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* ========== SECTIONS ========== */
.section {
  padding: clamp(var(--space-16), 8vw, var(--space-32)) var(--space-4);
}
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: var(--space-3);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* ========== PRODUCTS ========== */
.products {
  background: var(--color-surface);
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: var(--space-6);
}

.product-card {
  position: relative;
  background: oklch(from var(--color-surface-2) l c h / 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid oklch(from var(--color-border) l c h / 0.5);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
a.product-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.product-card:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.35);
  box-shadow: 0 0 50px oklch(from var(--color-primary) l c h / 0.08),
              inset 0 1px 0 oklch(from var(--color-primary) l c h / 0.06);
  transform: translateY(-2px);
}

.product-card--gold {
  border-color: oklch(from var(--color-gold) l c h / 0.25);
  background: linear-gradient(135deg, var(--color-surface-2) 0%, oklch(from var(--color-gold) l c h / 0.04) 100%);
}
.product-card--gold:hover {
  border-color: oklch(from var(--color-gold) l c h / 0.45);
  box-shadow: 0 0 50px oklch(from var(--color-gold) l c h / 0.1),
              inset 0 1px 0 oklch(from var(--color-gold) l c h / 0.08);
  transform: translateY(-2px);
}

.product-badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: oklch(from var(--color-gold) l c h / 0.15);
  color: var(--color-gold);
}
.product-badge--beta {
  background: oklch(from var(--color-primary) l c h / 0.15);
  color: var(--color-primary);
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.product-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: oklch(from var(--color-primary) l c h / 0.08);
  margin-bottom: var(--space-5);
}
.product-icon--gold {
  background: oklch(from var(--color-gold) l c h / 0.1);
}

.product-name {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.product-name--gold {
  color: var(--color-gold);
}
.product-desc {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ========== WHY KI ========== */
.why {
  background: var(--color-bg);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-6);
}
.why-card {
  position: relative;
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-border) l c h / 0.3);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.why-card:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.2);
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.2);
}
.why-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), oklch(from var(--color-primary) l c h / 0.2));
}
.why-title {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.why-desc {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ========== STATS ========== */
.stats {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--space-8);
  text-align: center;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}
.stat-number--accent {
  color: var(--color-primary);
}
.stat-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-detail {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ========== ABOUT ========== */
.about {
  background: var(--color-bg);
}
.about-inner {
  max-width: var(--content-default);
  margin-inline: auto;
  text-align: center;
}
.about-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  margin-top: var(--space-3);
  letter-spacing: -0.02em;
}
.about-text {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 720px;
  margin-inline: auto;
}

.about-team {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}
.team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.team-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}
.team-role {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  max-width: 320px;
}
.team-divider {
  width: 1px;
  height: 48px;
  background: var(--color-divider);
}
@media (max-width: 768px) {
  .team-divider {
    width: 48px;
    height: 1px;
  }
}

.about-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-interactive);
}
.about-link:hover {
  color: var(--color-text);
}

/* ========== CTA SECTION ========== */
.cta-section {
  background: var(--color-surface);
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--color-primary), transparent) 1;
}
.cta-inner {
  text-align: center;
  max-width: var(--content-default);
  margin-inline: auto;
  padding: var(--space-12) 0;
}
.cta-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}
.cta-text {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-inline: auto;
  line-height: 1.6;
}
.cta-actions {
  margin-bottom: var(--space-6);
}
.cta-contact-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.cta-link-item {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.cta-link-item:hover {
  color: var(--color-primary);
}
.cta-divider {
  color: var(--color-text-faint);
}
.cta-address {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ========== FOOTER ========== */
.site-footer {
  padding: var(--space-12) var(--space-4);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer-copy {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer-link {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.footer-link:hover {
  color: var(--color-text-muted);
}

/* ========== SCROLL ANIMATIONS ========== */
/* Controlled via JS IntersectionObserver for universal reliability */
.fade-in {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in.is-visible {
  opacity: 1;
}

/* Stagger children in grids */
.products-grid .product-card:nth-child(1) { transition-delay: 0ms; }
.products-grid .product-card:nth-child(2) { transition-delay: 60ms; }
.products-grid .product-card:nth-child(3) { transition-delay: 120ms; }
.products-grid .product-card:nth-child(4) { transition-delay: 180ms; }
.products-grid .product-card:nth-child(5) { transition-delay: 240ms; }
.products-grid .product-card:nth-child(6) { transition-delay: 300ms; }

.why-grid .why-card:nth-child(1) { transition-delay: 0ms; }
.why-grid .why-card:nth-child(2) { transition-delay: 60ms; }
.why-grid .why-card:nth-child(3) { transition-delay: 120ms; }
.why-grid .why-card:nth-child(4) { transition-delay: 180ms; }

.stats-grid .stat-item:nth-child(1) { transition-delay: 0ms; }
.stats-grid .stat-item:nth-child(2) { transition-delay: 80ms; }
.stats-grid .stat-item:nth-child(3) { transition-delay: 160ms; }
.stats-grid .stat-item:nth-child(4) { transition-delay: 240ms; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero-title {
    font-size: var(--text-2xl);
  }
  .hero-sub {
    font-size: var(--text-base);
  }
  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }
  .hero-ctas .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
  .products-grid {
    grid-template-columns: 1fr;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }
  .footer-links {
    justify-content: center;
  }
  .about-title {
    font-size: var(--text-xl);
  }
  .cta-title {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-content {
    padding-top: var(--space-24);
  }
}
