/* ===========================
   MAD PINEAPPLE – CTRL.XYZ STYLE
   Deep black, neon pink accent,
   glassmorphism cards, bento grid
   =========================== */

/* === Variables === */
:root {
  --bg: #050505;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: #ffffff;
  --text-bright: #ffffff;
  --text-dim: #ffffff;
  --accent: #ec4899;
  --accent-2: #d946ef;
  --accent-3: #22d3ee;
  --gradient: linear-gradient(135deg, #ec4899 0%, #d946ef 50%, #22d3ee 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(217,70,239,0.08));
  --glow: rgba(236,72,153,0.25);
  --glow-strong: rgba(236,72,153,0.4);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Utility === */
.text-muted { color: var(--text); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.875rem; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===========================
   HEADER
   =========================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.875rem 0;
  background: rgba(5,5,5,0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px var(--glow));
}
.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

/* Nav */
.nav {
  display: flex;
  gap: 0.25rem;
}
.nav a {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 999px;
  transition: var(--transition);
}
.nav a:hover, .nav a.active {
  color: var(--text-bright);
  background: rgba(255,255,255,0.06);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 999px;
  transition: var(--transition);
  font-size: 0.9rem;
  white-space: nowrap;
}
.btn-primary {
  padding: 0.8rem 2rem;
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 20px var(--glow);
  font-size: 1rem;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--glow-strong);
  background: #f472b6;
}
.btn-sm { padding: 0.45rem 1.2rem; font-size: 0.8rem; }
.btn-ghost {
  padding: 0.8rem 2rem;
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-size: 1rem;
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}
.btn-full { width: 100%; }

/* Mobile */
.mobile-toggle {
  display: none;
  color: var(--text-bright);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
}
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.mobile-menu a:hover, .mobile-menu a.active {
  color: var(--text-bright);
}

@media (max-width: 768px) {
  .nav, .header-inner > .btn { display: none; }
  .mobile-toggle { display: flex; }
}

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10rem 0 6rem;
  overflow: hidden;
}

/* Video Background */
.hero-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}
.hero-vid.active {
  opacity: 0.4;
}
/* Liquid Text Effect */
.liquid-text {
  display: inline-block;
}
.mag-char {
  display: inline-block;
  background: linear-gradient(90deg, #ec4899, #d946ef, #22d3ee, #ec4899, #d946ef);
  background-size: 100vw 100%;
  background-attachment: fixed;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: liquidFlow 8s linear infinite;
  transition: transform 0.2s cubic-bezier(0.25,0.46,0.45,0.94);
  will-change: transform;
}
.hero-title:hover .mag-char {
  animation-duration: 2s;
}
@keyframes liquidFlow {
  0% { background-position: 0vw 50%; }
  100% { background-position: 100vw 50%; }
}
.liquid-glow {
  position: absolute;
  inset: -20px;
  background: linear-gradient(90deg, rgba(236,72,153,0.15), rgba(217,70,239,0.1), rgba(34,211,238,0.15), rgba(236,72,153,0.15));
  background-size: 200% 100%;
  animation: liquidFlow 8s linear infinite;
  filter: blur(40px);
  z-index: -1;
  border-radius: 20px;
  pointer-events: none;
}
.hero .container {
  position: relative;
  z-index: 3;
}
.hero .hero-glow {
  z-index: 2;
}
.hero-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, rgba(236,72,153,0.12) 0%, rgba(217,70,239,0.06) 35%, transparent 65%);
  pointer-events: none;
  animation: glowPulse 8s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -55%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -55%) scale(1.15); }
}
.hero-tag {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(4rem, 10vw, 7.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text-bright);
  margin-bottom: 2rem;
  padding: 1.5rem 0.5rem;
  margin-left: -0.5rem;
}
.mag-char {
  display: inline-block;
  background: linear-gradient(90deg, #ec4899, #d946ef, #22d3ee, #ec4899, #d946ef);
  background-size: 100vw 100%;
  background-attachment: fixed;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: liquidFlow 8s linear infinite;
  transition: transform 0.2s cubic-bezier(0.25,0.46,0.45,0.94);
  will-change: transform;
  padding: 0.3em 0.1em;
  margin: -0.3em -0.1em;
}
.hero-desc {
  font-size: 1.2rem;
  line-height: 1.85;
  color: #ffffff;
  max-width: 650px;
  margin: 2rem auto 3.5rem;
  letter-spacing: 0.01em;
}
.hero-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero { padding: 8rem 0 4rem; }
  .hero-desc { font-size: 1rem; }
}

/* ===========================
   SECTIONS
   =========================== */
.section {
  padding: 7rem 0;
  position: relative;
}
.section-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  margin-bottom: 2rem;
  padding: 1rem 0.5rem;
  margin-left: -0.5rem;
}

/* ===========================
   BENTO GRID
   =========================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.bento-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.bento-card:hover::before {
  opacity: 1;
}
.bento-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}
.bento-card p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
}
.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(236,72,153,0.08);
  border: 1px solid rgba(236,72,153,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
}
.bento-lg {
  grid-column: span 1;
}

@media (min-width: 769px) {
  .bento-lg {
    grid-column: span 1;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .bento-lg h3 { font-size: 1.35rem; }
  .bento-lg p { font-size: 0.95rem; }
}

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

/* ===========================
   SPLIT GRID
   =========================== */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 4rem;
  align-items: start;
}
@media (max-width: 768px) {
  .split-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* About */
.about-text p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ===========================
   CARD / FORM
   =========================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
}
.card-form h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

/* Form elements */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
form input,
form select,
form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--text-bright);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  outline: none;
  transition: var(--transition);
  margin-bottom: 0.75rem;
}
form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}
form input::placeholder,
form textarea::placeholder { color: var(--text-dim); }
form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  color: var(--text-dim);
}
form select option {
  background: #111;
  color: var(--text);
}
form textarea {
  min-height: 110px;
  resize: vertical;
}

.form-success {
  text-align: center;
  padding: 2.5rem 0;
}
.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 1.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 0 30px var(--glow);
}
.form-success h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .card { padding: 1.5rem; }
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  padding: 4rem 0 0;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-links h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--text);
  transition: var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ===========================
   ANIMATIONS
   =========================== */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-up.d1 { transition-delay: 0.1s; }
.reveal-up.d2 { transition-delay: 0.2s; }
.reveal-up.d3 { transition-delay: 0.3s; }
.reveal-up.d4 { transition-delay: 0.4s; }

/* ===========================
   LABS PAGE SPECIFIC
   =========================== */

/* Labs Hero */
.labs-hero {
  padding: 10rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.labs-hero .hero-glow {
  width: 600px;
  height: 600px;
}

/* Service Cards Grid */
.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.service-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}
.service-card:hover::before { opacity: 1; }

.service-card .sc-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: rgba(236,72,153,0.08);
  border: 1px solid rgba(236,72,153,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent);
}
.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.65rem;
}
.service-card p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
  flex: 1;
}
.service-card .sc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  transition: var(--transition);
}
.service-card:hover .sc-link { gap: 0.65rem; }

@media (max-width: 900px) {
  .service-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .service-cards { grid-template-columns: 1fr; }
}

/* Labs About Block */
.labs-about {
  padding: 5rem 0;
}
.labs-about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  max-width: 800px;
  margin: 0 auto;
}
.labs-about-card p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}
.labs-about-card p:last-child { margin-bottom: 0; }

/* FAQ */
.faq-section {
  padding: 5rem 0;
}
.faq-grid {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.faq-item:first-child {
  border-top: 1px solid var(--border);
}
.faq-q {
  width: 100%;
  text-align: left;
  padding: 1.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition);
}
.faq-q:hover { color: var(--accent); }
.faq-q .faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--text-dim);
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0;
}
.faq-item.open .faq-a {
  max-height: 300px;
  padding-bottom: 1.25rem;
}
.faq-a p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
}

/* ===========================
   SERVICE PAGE COMPONENTS
   =========================== */

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.5rem;
  transition: var(--transition);
}
.back-link:hover {
  color: var(--accent);
}

/* Process Grid */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.process-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: var(--transition);
}
.process-step:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.step-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}
.process-step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}
.process-step p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}

@media (max-width: 900px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .process-grid { grid-template-columns: 1fr; }
}

/* 4-column benefits grid responsive */
@media (max-width: 900px) {
  .bento-grid[style*="repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 600px) {
  .bento-grid[style*="repeat(4"] {
    grid-template-columns: 1fr !important;
  }
}

/* --- PROJECT BUILDER --- */
.project-builder {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  margin-top: 0;
}
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}
.service-pill {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid #22d3ee;
  color: #22d3ee;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.service-pill:hover {
  background: rgba(34, 211, 238, 0.2);
  transform: translateY(-2px);
}
.service-pill.active {
  background: rgba(217, 70, 239, 0.15);
  border-color: #d946ef;
  color: #d946ef;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(217, 70, 239, 0.3);
}
.builder-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}
.builder-input {
  width: 100%;
  padding: 1rem 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: 0.3s;
}
.builder-input:focus {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.05);
}
.builder-buttons {
  display: flex;
  gap: 1rem;
  width: 100%;
}
.builder-buttons .btn {
  flex: 1;
  text-align: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .builder-buttons {
    flex-direction: column;
  }
}
