/* ================================================
   MIVY Portfolio - Design System 2025
   Vercel Industrial Aesthetic (Grid + Spotlight)
   ================================================ */

/* -------------------- CSS Variables -------------------- */
:root {
  /* Colors - Industrial Monochrome */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-dots: #111111;

  /* Text Colors */
  --text-primary: #ededed;
  /* Softer white for less eye fatigue */
  --text-secondary: #a1a1a1;
  --text-tertiary: #666666;

  /* Accents (Subtle) */
  --accent-glow: rgba(255, 255, 255, 0.15);
  --border-subtle: #222222;
  /* Slightly lighter for better definition */
  --border-strong: #333333;
  --border-active: #555555;

  /* Spacing Scale - Refined */
  --space-xs: 0.5rem;
  /* 8px */
  --space-sm: 1rem;
  /* 16px */
  --space-md: 1.5rem;
  /* 24px */
  --space-lg: 2.5rem;
  /* 40px */
  --space-xl: 4rem;
  /* 64px */
  --space-2xl: 6rem;
  /* 96px */
  --space-3xl: 8rem;
  /* 128px */
  --space-4xl: 10rem;
  /* 160px */

  /* Typography Scale (Tight Tracking) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --text-5xl: 4.5rem;
  --text-6xl: 5.5rem;

  /* Font */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --tracking-tight: -0.04em;
  --tracking-normal: -0.01em;

  /* Transitions (Snappy) */
  --transition-fast: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* -------------------- Reset & Base -------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: auto;
  /* Managed by Lenis */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-primary);
  overflow-x: hidden;
  /* Prevent horizontal scroll globally */
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  letter-spacing: var(--tracking-normal);
  overflow-x: hidden;
  position: relative;
  /* Ensure overflow works */
  width: 100%;
}

/* Selection Color */
::selection {
  background: #333;
  color: #fff;
}

/* -------------------- Typography -------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  color: #ffffff;
}

h1 {
  font-size: var(--text-5xl);
  letter-spacing: -0.05em;
  font-weight: 700;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 500;
}

h4 {
  font-size: var(--text-base);
  font-weight: 500;
}

p {
  color: var(--text-secondary);
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* -------------------- Layout -------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  /* Consistent outer padding */
}

/* Increased Section Spacing */
section {
  padding: var(--space-3xl) 0;
  /* Massive vertical spacing */
  position: relative;
  /* border-bottom: 1px solid var(--border-subtle); removed for cleaner look */
}

/* Add separator line only where needed or subtle gradient */
section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-subtle) 20%, var(--border-subtle) 80%, transparent 100%);
}

section:last-child::after {
  display: none;
}


/* -------------------- Background (Grid + Noise) -------------------- */
.webgl-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  /* UPDATED: Above bg-noise */
  pointer-events: none;
}

/* Background Noise Overlay */
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -2;
  /* UPDATED: Behind aurora */
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* -------------------- Components: Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0 24px;
  height: 48px;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-full);
  /* Rounded full for Vercel vibe */
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.btn-primary:hover {
  background: #e0e0e0;
  border-color: #e0e0e0;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

/* -------------------- Components: Cards (Spotlight) -------------------- */
/* -------------------- Components: Cards (Premium 2025) -------------------- */
.card {
  background: rgba(10, 10, 10, 0.95);
  /* Gradient Border Trick using transparent border + box-shadow */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);

  /* Depth & Inner Glows */
  box-shadow:
    0 4px 24px -1px rgba(0, 0, 0, 0.2),
    /* Drop Shadow */
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08),
    /* Top Edge Highlight (simulated light) */
    inset 0 0 20px rgba(255, 255, 255, 0.01);
  /* Subtle inner ambience */

  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px) scale(1.005);

  box-shadow:
    0 20px 40px -4px rgba(0, 0, 0, 0.4),
    /* Deeper Drop Shadow */
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
    /* Brighter Top Edge */
    inset 0 0 30px rgba(255, 255, 255, 0.03);
  /* Enhanced ambience */
}

/* Optional: Subtle gradient overlay on hover */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  z-index: 0;
}

.card:hover::before {
  opacity: 1;
}

/* Small tag styles */
.tag {
  display: inline-flex;
  padding: 4px 10px;
  font-size: 0.70rem;
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  /* Squeracle */
  background: rgba(255, 255, 255, 0.02);
}

.tag--accent {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* -------------------- Section: Header (Floating Dock 2025) -------------------- */
.header {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: 90vw;
  z-index: 100;
  padding: 8px 12px;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header--scrolled {
  background: rgba(5, 5, 5, 0.95);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  gap: var(--space-lg);
}

/* Logo anchor - prevent extra spacing */
.header__inner>a {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  padding: 0;
  margin: 0;
}

.header__logo {
  height: 28px;
  width: auto;
  /* Make logo simpler/smaller for dock */
  filter: contrast(1.2) brightness(1.2);
  display: block;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.header__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Adjust contact button in header */
.header .btn-primary {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  margin-left: 8px;
}

/* -------------------- Section: Hero (Vercel Style) -------------------- */
/* Adjusted Hero for better spacing */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 140px;
  padding-bottom: var(--space-3xl);
  position: relative;
  overflow: hidden;
  /* Fix: Contain the 800px glow to prevent mobile zoomed-out view */
  text-align: center;
}

/* Ensure container inside hero is centered */
.hero>.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Glow behind hero text */
.hero::before {
  content: '';
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  /* Increased blur */
}

.hero__content {
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  margin-bottom: var(--space-lg);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.hero__badge:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.hero__title {
  opacity: 0;
  margin-bottom: var(--space-sm);
  /* Reduced margin */
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  letter-spacing: -0.04em;
  /* Relaxed from -0.06em to prevent clipping */
  font-weight: 800;
  line-height: 0.95;
  /* Tighter line height */
  overflow: visible;
  padding-right: 0.1em;
  /* Buffer to prevent last letter clipping */
}

.hero__title span {
  background: linear-gradient(to bottom, #FFFFFF 0%, #666666 100%);
  /* High contrast gradient */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  padding-bottom: 0.2em;
  /* Prevents gradient clipping on descenders */
  padding-right: 0.1em;
  /* Prevents horizontal clipping */
  margin-bottom: -0.1em;
  /* Compensate for layout */
}

.hero__subtitle {
  opacity: 0;
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 680px;
  line-height: 1.6;
  font-weight: 400;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-4xl);
}

/* -------------------- Section Header -------------------- */
.section-header {
  margin-bottom: var(--space-3xl);
  text-align: center;
  /* Center section headers typically */
}

.section-header__label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  /* Muted label */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.section-header__title {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.section-header__subtitle {
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-secondary);
}


/* -------------------- Section: Projects (Bento) -------------------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(320px, auto);
  /* Taller cards */
  gap: var(--space-md);
}

.bento-item {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  position: relative;
}

.bento-item__badges {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.bento-item__badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: rgb(129, 140, 248);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.bento-item__badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.bento-item--featured {
  grid-column: span 8;
  grid-row: span 2;
}

.bento-item--medium {
  grid-column: span 4;
  grid-row: span 2;
}

.bento-item--small {
  grid-column: span 4;
}

.bento-item__tag {
  margin-bottom: var(--space-sm);
  align-self: flex-start;
  /* Ensure it doesn't stretch */
}

.bento-item__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  font-weight: 600;
}

.bento-item__description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.bento-item__image {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  flex-grow: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-md);
  /* Space before techs/link */
}

/* Vignette Gradient Overlay - Subtle */
.bento-item__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.6) 100%);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* On hover, reduce vignette intensity */
.bento-item__image:hover::after {
  opacity: 0.3;
}

.bento-item__image img {
  /* removed opacity to prevent "washed out" dark look */
  filter: brightness(0.8);
  transition: all 0.4s ease;
  display: block;
  /* ensure no line-height gap */
}

.bento-item__image:hover img {
  filter: brightness(1);
  transform: scale(1.05);
}

.bento-item__techs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.bento-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: auto;
}

.bento-item__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
  /* Reset for <button> elements */
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
}

.bento-item__link:hover {
  opacity: 1;
}

/* -------------------- Section: Services -------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.service-card {
  padding: var(--space-xl);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  color: #fff;
}

.service-card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.service-card__description {
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
  line-height: 1.6;
}

.service-card__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: auto;
  /* Push features to bottom */
}

.service-card__feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.service-card__feature svg {
  width: 16px;
  height: 16px;
  color: var(--text-primary);
  opacity: 0.7;
}

/* -------------------- Section: CTA -------------------- */
.cta {
  padding: var(--space-4xl) 0;
}

.cta__box {
  padding: var(--space-4xl) var(--space-xl);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.cta__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
  background: linear-gradient(180deg, #fff 0%, #999 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* -------------------- Footer -------------------- */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  position: relative;
  z-index: 10;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  position: relative;
}

.footer__links {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.footer__link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  background: transparent;
}

.footer__link svg {
  width: 24px;
  height: 24px;
}

.footer__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  transform: translateY(-2px);
}

.footer__copyright {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* -------------------- Animation Utilities -------------------- */
.animate-on-scroll {
  opacity: 1;
  /* GSAP handles animation, this prevents FOUC */
}

/* -------------------- Responsive -------------------- */
/* Large Tablets & Small Desktops */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }

  .hero__title {
    font-size: clamp(3rem, 7vw, 5rem);
  }
}

@media (max-width: 1024px) {
  .bento-item--featured {
    grid-column: span 12;
  }

  .bento-item--medium {
    grid-column: span 6;
  }

  .bento-item--small {
    grid-column: span 6;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-lg: 1.5rem;
    --space-xl: 3rem;
  }

  .header__nav {
    display: none;
  }

  .hero {
    padding-top: 100px;
  }

  .bento-item--medium,
  .bento-item--small {
    grid-column: span 12;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .cta__title {
    font-size: 2rem;
  }
}

/* =========================================
   NEW FEATURES IMPLEMENTATION
   ========================================= */

/* 1. Infinite Marquee (Stack) */
.stack-marquee {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.stack-track {
  display: flex;
  gap: var(--space-xl);
  /* Large gap between items */
  width: max-content;
  animation: scroll-left 40s linear infinite;
}

.stack-marquee:hover .stack-track {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }

  /* Assumes track contains 2 sets, moves half way */
}

/* Adjust stack items for marquee context */
.stack-item {
  width: 200px;
  /* Fixed width for uniform scroll */
  padding: var(--space-lg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(10, 10, 10, 0.95);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.stack-item:hover {
  background: var(--bg-secondary);
  border-color: var(--border-active);
}

/* 2. 3D Tilt Effect Utilities */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

.tilt-content {
  transform: translateZ(20px);
  /* Internal elements pop out */
}

/* 3. Command Palette (Ctrl+K) */
.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  /* Centering */
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cmd-palette.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cmd-palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.cmd-palette__modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: #0f0f0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(1);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-palette.hidden .cmd-palette__modal {
  transform: scale(0.95);
}

.cmd-palette__input-wrapper {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.cmd-palette__input-wrapper svg {
  color: var(--text-tertiary);
}

.cmd-palette__input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  outline: none;
}

.cmd-palette__input::placeholder {
  color: var(--text-tertiary);
}

.cmd-palette__shortcut {
  font-size: 10px;
  background: var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.cmd-palette__results {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.1s;
}

.cmd-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
}

.cmd-item:hover,
.cmd-item.active {
  background: var(--bg-dots);
  color: var(--text-primary);
}

.cmd-item.active svg,
.cmd-item:hover svg {
  color: var(--text-primary);
}

.cmd-palette__footer {
  padding: 10px 20px;
  background: var(--bg-dots);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
}

kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* 4. Header Status Widget */
.status-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  margin-right: var(--space-md);
  /* Separate from links */
  user-select: none;
  font-family: var(--font-mono);
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: #10B981;
  /* Emerald 500 */
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
  }

  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

.status-text {
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.status-location {
  color: var(--text-tertiary);
  font-weight: 700;
  padding-left: 4px;
  border-left: 1px solid var(--border-subtle);
  /* subtle divider */
  margin-left: 4px;
}

.status-time {
  color: var(--text-primary);
  /* Tech feel */
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  font-family: var(--font-mono);
}

/* 5. Code Showcase Widget (Show Don't Tell) */
.code-showcase {
  margin: var(--space-2xl) 0;
  width: 100%;
  max-width: 600px;
  perspective: 1000px;
}

.code-window {
  background: rgba(15, 15, 15, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transform: rotateX(2deg);
  /* Initial subtle tilt */
  transition: transform 0.4s ease;
}

.code-window:hover {
  transform: rotateX(0deg) scale(1.02);
}

.code-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.window-controls {
  display: flex;
  gap: 6px;
  margin-right: 16px;
}

.window-controls span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.5;
}

.window-controls span:nth-child(1) {
  background: #FF5F56;
}

.window-controls span:nth-child(2) {
  background: #FFBD2E;
}

.window-controls span:nth-child(3) {
  background: #27C93F;
}

.window-filename {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.code-content {
  padding: 20px;
  margin: 0;
  font-family: 'Fira Code', monospace;
  /* Fallback if not loaded, assume user has monospace */
  font-size: 13px;
  line-height: 1.6;
  color: #a1a1a1;
  text-align: left;
  overflow-x: auto;
}

/* Syntax Highlighting Tokens (Simple) */
.token-keyword {
  color: #c586c0;
}

/* purple */
.token-function {
  color: #dcdcaa;
}

/* yellow */
.token-string {
  color: #ce9178;
}

/* orange */
.token-comment {
  color: #6a9955;
}

/* green */
.token-variable {
  color: #9cdcfe;
}

/* blue */

/* 6. System Status Footer */
.footer__status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
  padding: 12px 20px;
  margin-bottom: var(--space-xl);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: #27C93F;
  /* Green */
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(39, 201, 63, 0.4);
}

.status-label {
  color: var(--text-tertiary);
}

.status-value {
  color: var(--text-primary);
  font-weight: 500;
}

.status-key {
  padding: 2px 6px;
  background: var(--border-subtle);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

.status-desc {
  color: var(--text-tertiary);
  font-size: 11px;
}

@media (max-width: 600px) {
  .footer__status-bar {
    flex-direction: column;
    gap: 12px;
    border-radius: var(--radius-lg);
  }

  .desktop-only {
    display: none;
  }
}

/* -------------------- Section: Soluciones Modal (Professional 2025 UX) -------------------- */
.solutions-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.solutions-modal--active {
  opacity: 1;
  visibility: visible;
}

.solutions-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.solutions-modal__container {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  min-height: 0;
  /* Required for flexbox scroll to work */
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  /* Keep for border-radius clipping */
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-base);
}

.solutions-modal--active .solutions-modal__container {
  transform: scale(1) translateY(0);
}

.solutions-modal__header {
  padding: var(--space-xl) var(--space-xl) var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.solutions-modal__title-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.solutions-modal__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.solutions-modal__title {
  font-size: var(--text-3xl);
  font-weight: 600;
}

.solutions-modal__close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.solutions-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.solutions-modal__content {
  padding: 0 var(--space-xl) var(--space-xl);
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  /* Required for flexbox scroll to work */
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);

  /* Custom Scrollbar for 2025 Aesthetic */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.solutions-modal__content::-webkit-scrollbar {
  width: 6px;
}

.solutions-modal__content::-webkit-scrollbar-track {
  background: transparent;
}

.solutions-modal__content::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.solutions-modal__image-wrapper {
  margin-bottom: var(--space-lg);
  display: block;
  user-select: none;
}

.solutions-modal__image-wrapper.hidden {
  display: none;
}

.solutions-modal__image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Scroll Indicator - 2025 UX Trend */
.solutions-modal__scroll-indicator {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  margin-top: calc(-1 * var(--space-md));
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.solutions-modal__scroll-indicator:hover {
  transform: translateY(4px);
}

.solutions-modal__scroll-indicator:active {
  transform: translateY(6px);
}

/* Mobile touch optimization */
@media (max-width: 768px) {
  .solutions-modal__scroll-indicator {
    padding: var(--space-lg) var(--space-xl);
    margin-top: calc(-1 * var(--space-sm));
    /* Larger touch target for mobile */
    min-height: 80px;
    -webkit-tap-highlight-color: transparent;
  }

  .scroll-indicator__icon {
    width: 28px;
    height: 28px;
  }

  .scroll-indicator__text {
    font-size: 11px;
  }
}

.solutions-modal__scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-indicator__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  position: relative;
  overflow: hidden;
}

.scroll-indicator__line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0.6),
      transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateY(40px);
    opacity: 0;
  }
}

.scroll-indicator__icon {
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.4);
  animation: bounce-gentle 2s ease-in-out infinite;
}

@keyframes bounce-gentle {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(8px);
  }
}

.scroll-indicator__text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

.solutions-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

@media (max-width: 768px) {
  .solutions-modal__grid {
    grid-template-columns: 1fr;
  }
}

.solutions-modal__bento-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.solutions-modal__bento-item h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.solutions-modal__bento-item p {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}

.solutions-modal__footer {
  padding: var(--space-lg) var(--space-xl);
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

.btn--solution-visit {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn--solution-visit:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

/* -------------------- FAQ Section -------------------- */
.faq {
  padding: var(--space-3xl) 0;
}

.faq-grid {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.faq-item:hover {
  border-color: var(--border-strong);
}

.faq-item[open] {
  border-color: var(--border-active);
}

.faq-item__question {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  transition: color 0.2s ease;
  user-select: none;
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

.faq-item__question::after {
  content: '+';
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--text-tertiary);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.faq-item[open] .faq-item__question::after {
  content: '−';
  color: var(--text-primary);
}

.faq-item__question:hover {
  color: #fff;
}

.faq-item__answer {
  padding: 0 var(--space-lg) var(--space-md);
}

.faq-item__answer p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .faq-item__question {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }

  .faq-item__answer {
    padding: 0 var(--space-md) var(--space-sm);
  }
}