/* ==========================================================================
   Key Solutions — Design System Utilities, Responsive Polish & Spacing Fixes
   Follows anti-ai-slop-frontend & elite-web-experience master skill principles:
   - Precision vertical rhythm & tokenized spacing
   - 100% responsive without horizontal overflow
   - Balanced bento cards with zero empty dead voids
   - Harmonious component padding, typography hierarchy, and state coverage
   - Multi-Archetype Backgrounds from 21st.dev (Grid, Dots, Glow, Diagonal, Pillars)
   - Zero image cutoffs / responsive aspect containers
   - Full CSS Grid 12-column layout for Split Hero Archetypes
   ========================================================================== */

/* Universal Layout & Overflow Prevention */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Spacing Utilities (Ensures complete coverage for all Tailwind tokens)
   -------------------------------------------------------------------------- */
.pt-1  { padding-top: 0.25rem !important; }
.pt-2  { padding-top: 0.5rem !important; }
.pt-3  { padding-top: 0.75rem !important; }
.pt-4  { padding-top: 1rem !important; }
.pt-6  { padding-top: 1.5rem !important; }
.pt-8  { padding-top: 2rem !important; }
.pt-10 { padding-top: 2.5rem !important; }
.pt-12 { padding-top: 3rem !important; }
.pt-14 { padding-top: 3.5rem !important; }
.pt-16 { padding-top: 4rem !important; }
.pt-20 { padding-top: 5rem !important; }
.pt-24 { padding-top: 6rem !important; }
.pt-28 { padding-top: 7rem !important; }

.pb-2  { padding-bottom: 0.5rem !important; }
.pb-3  { padding-bottom: 0.75rem !important; }
.pb-4  { padding-bottom: 1rem !important; }
.pb-5  { padding-bottom: 1.25rem !important; }
.pb-6  { padding-bottom: 1.5rem !important; }
.pb-8  { padding-bottom: 2rem !important; }
.pb-10 { padding-bottom: 2.5rem !important; }
.pb-12 { padding-bottom: 3rem !important; }
.pb-14 { padding-bottom: 3.5rem !important; }
.pb-16 { padding-bottom: 4rem !important; }
.pb-20 { padding-bottom: 5rem !important; }
.pb-24 { padding-bottom: 6rem !important; }
.pb-28 { padding-bottom: 7rem !important; }

.py-6  { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-8  { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.py-10 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.py-12 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.py-14 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
.py-16 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
.py-20 { padding-top: 5rem !important; padding-bottom: 5rem !important; }
.py-24 { padding-top: 6rem !important; padding-bottom: 6rem !important; }
.py-28 { padding-top: 7rem !important; padding-bottom: 7rem !important; }

.mt-4  { margin-top: 1rem !important; }
.mt-6  { margin-top: 1.5rem !important; }
.mt-8  { margin-top: 2rem !important; }
.mt-10 { margin-top: 2.5rem !important; }
.mt-12 { margin-top: 3rem !important; }
.mt-14 { margin-top: 3.5rem !important; }
.mt-16 { margin-top: 4rem !important; }
.mt-20 { margin-top: 5rem !important; }

.mb-4  { margin-bottom: 1rem !important; }
.mb-6  { margin-bottom: 1.5rem !important; }
.mb-8  { margin-bottom: 2rem !important; }
.mb-10 { margin-bottom: 2.5rem !important; }
.mb-12 { margin-bottom: 3rem !important; }
.mb-14 { margin-bottom: 3.5rem !important; }
.mb-16 { margin-bottom: 4rem !important; }

.gap-5  { gap: 1.25rem !important; }
.gap-6  { gap: 1.5rem !important; }
.gap-7  { gap: 1.75rem !important; }
.gap-8  { gap: 2rem !important; }
.gap-10 { gap: 2.5rem !important; }
.gap-12 { gap: 3rem !important; }
.gap-14 { gap: 3.5rem !important; }
.gap-16 { gap: 4rem !important; }

/* --------------------------------------------------------------------------
   Grid Layout Coverage (Ensures 12-column grid works across all viewports)
   -------------------------------------------------------------------------- */
.grid-cols-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
}

@media (min-width: 1024px) {
  .lg\:grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }
  .lg\:col-span-7 {
    grid-column: span 7 / span 7 !important;
  }
  .lg\:col-span-5 {
    grid-column: span 5 / span 5 !important;
  }
}

/* --------------------------------------------------------------------------
   Height and Dimension Utilities
   -------------------------------------------------------------------------- */
.h-36 { height: 9rem !important; }
.h-40 { height: 10rem !important; }
.h-44 { height: 11rem !important; }
.h-48 { height: 12rem !important; }
.min-h-50 { min-height: 12.5rem !important; }
.min-h-64 { min-height: 16rem !important; }

/* --------------------------------------------------------------------------
   Bento Grid Proportions & Image Clamping (Prevents dead voids or cutoffs)
   -------------------------------------------------------------------------- */
#features .grid > div {
  display: flex;
  flex-direction: column;
}

#features img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.bento-visual-box {
  min-height: 14rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Hero Section Base
   -------------------------------------------------------------------------- */
#hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Archetype Background Styles from 21st.dev */
.bg-pillars-pattern {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0.75;
  background-image: repeating-linear-gradient(to right, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 80px, transparent 80px, transparent 160px);
  -webkit-mask-image: radial-gradient(circle at center, white 0%, white 35%, transparent 75%);
  mask-image: radial-gradient(circle at center, white 0%, white 35%, transparent 75%);
}
html.light .bg-pillars-pattern {
  background-image: repeating-linear-gradient(to right, rgba(0, 0, 0, 0.03) 0, rgba(0, 0, 0, 0.03) 80px, transparent 80px, transparent 160px);
}

.bg-grid-cyber {
  position: absolute;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 85%);
  pointer-events: none;
}
html.light .bg-grid-cyber {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
}

.bg-dots-matrix {
  position: absolute;
  inset: 0;
  background-size: 24px 24px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.15) 1.2px, transparent 1.2px);
  -webkit-mask-image: radial-gradient(circle at 50% 35%, black 20%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 35%, black 20%, transparent 75%);
  pointer-events: none;
}
html.light .bg-dots-matrix {
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.15) 1.2px, transparent 1.2px);
}

.bg-radial-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 600px at 50% 30%, var(--primary, #3b82f6) 0%, transparent 70%);
  opacity: 0.14;
  filter: blur(50px);
  pointer-events: none;
}

.bg-diagonal-accent {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 2px, transparent 0, transparent 40px);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
  mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
  pointer-events: none;
}
html.light .bg-diagonal-accent {
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.03) 0, rgba(0,0,0,0.03) 2px, transparent 0, transparent 40px);
}

/* --------------------------------------------------------------------------
   Photo Container (Aspect preserved, 0 cutoffs)
   -------------------------------------------------------------------------- */
.photo-container-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
}

.photo-container-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-container-hero:hover img {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Radial Button Hover Spotlight
   -------------------------------------------------------------------------- */
.radial-btn {
  --x: 50%;
  --y: 50%;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.radial-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  background: radial-gradient(100px at var(--x) var(--y), rgba(255, 255, 255, 0.18), transparent);
}

.radial-btn:hover::before {
  opacity: 1;
}

html.light .radial-btn::before {
  background: radial-gradient(100px at var(--x) var(--y), rgba(0, 0, 0, 0.08), transparent);
}

/* --------------------------------------------------------------------------
   Glass Floating Navbars (Top rated 21st.dev style variants)
   -------------------------------------------------------------------------- */
.nav-glass {
  background-color: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-glass-pill {
  background-color: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border: 1px solid var(--border);
}

html.light .nav-glass {
  background-color: rgba(250, 250, 250, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

html.light .nav-glass-pill {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Smooth Accordion Body
   -------------------------------------------------------------------------- */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}

.accordion-content.open {
  max-height: 350px;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Marquee Infinite Scroll
   -------------------------------------------------------------------------- */
@keyframes marqueeLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marqueeRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.animate-marquee-left {
  display: flex;
  width: max-content;
  animation: marqueeLeft 35s linear infinite;
  will-change: transform;
}

.animate-marquee-left:hover {
  animation-play-state: paused;
}

.animate-marquee-right {
  display: flex;
  width: max-content;
  animation: marqueeRight 35s linear infinite;
  will-change: transform;
}

.animate-marquee-right:hover {
  animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   Live Bench Pulse & Tabular Numbers
   -------------------------------------------------------------------------- */
.pulse-green {
  box-shadow: 0 0 12px rgba(0, 210, 148, 0.45);
}

.font-mono, .tabular-nums {
  font-feature-settings: "tnum" 1;
}

/* --------------------------------------------------------------------------
   Responsive Layout Harmonization
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  #hero h1 {
    font-size: 2.15rem !important;
    line-height: 1.15 !important;
  }

  .p-6 {
    padding: 1.25rem !important;
  }

  .px-5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .bento-visual-box {
    min-height: 12rem;
  }

  .photo-container-hero {
    aspect-ratio: 16 / 11;
  }
}
