/* LokaTech Theme — Premium Design System */
/* Design tokens (colors, fonts, transitions) are generated from theme.yaml design_tokens */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
  width: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Links --- */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base), opacity var(--transition-base);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: none;
}

/* --- Micro-interactions: Buttons --- */

a[class*="rounded-lg"],
button {
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base),
    filter var(--transition-base) !important;
}

a[class*="rounded-lg"]:hover:not(.mobile-nav-item):not(.mega-dropdown a):not(.mega-trigger > a),
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.25);
}

a[class*="rounded-lg"]:active,
button:active {
  transform: translateY(0);
}

/* --- Micro-interactions: Cards --- */

.card-hover {
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

div[class*="rounded-2xl"][class*="border"]:not(.mega-dropdown *):not(.mobile-bottom-nav *) {
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

div[class*="rounded-2xl"][class*="border"]:not(.mega-dropdown *):not(.mobile-bottom-nav *):hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1) !important;
}

/* ═══════════════════════════════════════════
   STAGGERED REVEAL ANIMATIONS
   Elements enter at different times for async feel
   ═══════════════════════════════════════════ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(60px) rotate(1deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

/* Staggered grid children — each card enters separately */
.stagger-grid > * {
  opacity: 0;
  animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.stagger-grid > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-grid > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-grid > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-grid > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-grid > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-grid > *:nth-child(6) { animation-delay: 0.6s; }

/* Heading reveal */
.reveal-heading {
  opacity: 0;
  animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.reveal-sub {
  opacity: 0;
  animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* Section-level stagger */
section:nth-child(odd) .reveal-heading { animation-name: fadeInLeft; }
section:nth-child(even) .reveal-heading { animation-name: fadeInRight; }

/* ═══════════════════════════════════════════
   FLOATING BLOBS — animated decorative shapes
   ═══════════════════════════════════════════ */

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(20px, -30px) rotate(3deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.blob-sm {
  width: 200px;
  height: 200px;
  filter: blur(60px);
  animation: floatSlow 12s ease-in-out infinite;
}

.blob-lg {
  width: 500px;
  height: 500px;
  filter: blur(120px);
  animation: float 15s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   ANIMATED GRADIENT — hero background
   ═══════════════════════════════════════════ */

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background-size: 200% 200%;
  animation: gradientShift 8s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   GRID PATTERN OVERLAY (hero)
   ═══════════════════════════════════════════ */

.grid-pattern {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ═══════════════════════════════════════════
   BENTO GRID — asymmetric layout
   ═══════════════════════════════════════════ */

.bento-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: auto auto;
  }
  .bento-grid > *:first-child {
    grid-row: span 2;
  }
}

/* ═══════════════════════════════════════════
   ASYMMETRIC OFFSETS — elements slightly shifted
   ═══════════════════════════════════════════ */

.offset-up { transform: translateY(-1.5rem); }
.offset-down { transform: translateY(1.5rem); }

@media (min-width: 1024px) {
  .offset-up-lg { transform: translateY(-2.5rem); }
  .offset-down-lg { transform: translateY(2.5rem); }
}

/* ═══════════════════════════════════════════
   GLOW LINE — animated accent
   ═══════════════════════════════════════════ */

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.glow-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  animation: glowPulse 3s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   DECORATIVE SHAPES
   ═══════════════════════════════════════════ */

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

.spin-slow {
  animation: spin-slow 20s linear infinite;
}

/* ═══ Header ═══ */

header[class*="sticky"] {
  transition: box-shadow var(--transition-base), background-color var(--transition-base);
}

/* ═══ Mega Menu ═══ */

.mega-trigger > .mega-dropdown {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition:
    opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.2s;
}

.mega-trigger:hover > .mega-dropdown {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mega-trigger:hover > a {
  color: #0f172a;
  background-color: #f8fafc;
}

/* ═══ Mobile Bottom Navigation ═══ */

.mobile-bottom-nav {
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.mobile-nav-item {
  min-width: 56px;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
  color: var(--color-primary) !important;
}

.mobile-nav-item:active {
  transform: scale(0.95);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 767px) {
  footer {
    margin-bottom: 4rem;
  }
}

/* --- Prose --- */

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.prose h1 { font-size: 2.5rem; margin-top: 0; }
.prose h2 { font-size: 1.75rem; margin-top: 3rem; }
.prose h3 { font-size: 1.25rem; margin-top: 2.5rem; }

.prose p {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.prose img {
  border-radius: 0.75rem;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.prose blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1.25rem;
  font-style: italic;
  color: var(--color-muted);
}

.prose code {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  padding: 0.15em 0.35em;
  font-size: 0.875em;
}

.prose pre {
  background: var(--color-navy);
  color: #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow-x: auto;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
}

/* --- Hero polish --- */

.hero-gradient {
  background: radial-gradient(ellipse at 30% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
}

/* --- Focus states --- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Logo hover --- */

nav a img {
  transition: opacity var(--transition-base);
}

nav a:hover img {
  opacity: 0.8;
}

/* --- Skip link --- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  z-index: 9999;
  font-weight: 600;
}

/* --- Selection color --- */

::selection {
  background-color: var(--color-primary-light);
  color: var(--color-navy);
}

/* --- Line clamp --- */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

