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

:root {
  --blue:    #00d4ff;
  --purple:  #7b2fff;
  --pink:    #ff2d78;
  --green:   #00ffb2;
  --dark:    #060812;
  --glass:   rgba(255,255,255,0.05);
  --border:  rgba(255,255,255,0.10);
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── ANIMATED BACKGROUND BLOBS ── */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.35;
  will-change: transform;
  transition: transform 0.12s ease-out;
}
.blob-1 { width: 520px; height: 520px; background: var(--blue);   top: -160px; left: -120px; }
.blob-2 { width: 440px; height: 440px; background: var(--pink);   top: 40%;  right: -140px; }
.blob-3 { width: 380px; height: 380px; background: var(--purple); bottom: -120px; left: 30%; }
.blob-4 { width: 280px; height: 280px; background: var(--green);  top: 20%;  left: 45%; opacity: 0.18; }

/* ── NOISE TEXTURE OVERLAY ── */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
}

/* ── WRAPPER ── */
.wrapper { position: relative; z-index: 3; max-width: 1200px; margin: 0 auto; padding: 0 28px; }

/* ── DIM OVERLAY ── */
#dim-overlay {
  position: fixed; inset: 0; z-index: 2;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.45s cubic-bezier(.22,1,.36,1);
}
body.card-focused #dim-overlay {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Dim & shrink non-hovered cards */
.cards-grid.card-focused .card-tech:not(.card-active) {
  opacity: 0.38;
  transform: scale(0.975) translateY(0);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(.22,1,.36,1), border-color 0.3s, box-shadow 0.3s;
}
/* When center card is active (hovered), undo the dim and allow zoom */
.cards-grid.card-focused .card-tech.card-active {
  opacity: 1;
  transform: scale(1.07) translateY(-6px) !important;
}
.cards-grid.card-focused .tilt-left:not(.card-active) {
  opacity: 0.38;
  transition: opacity 0.4s ease, transform 0.55s cubic-bezier(.22,1,.36,1);
}
.cards-grid.card-focused .tilt-right:not(.card-active) {
  opacity: 0.38;
  transition: opacity 0.4s ease, transform 0.55s cubic-bezier(.22,1,.36,1);
}
/* Boost the active (hovered) card above the dim overlay */
.card.card-active {
  z-index: 4;
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 16px 0 20px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--blue);
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.25);
  padding: 6px 16px; border-radius: 100px;
  margin-bottom: 24px;
  animation: fadeUp 0.7s ease both;
}
.hero-eyebrow span { width: 6px; height: 6px; background: var(--blue); border-radius: 50%; animation: pulse 2s ease infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.7)} }
.hero h1 {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -0.5px;
  animation: fadeUp 0.7s 0.1s ease both;
}
.hero h1 .grad-blue  { background: linear-gradient(90deg, #38beff, #2255d4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p {
  font-size: 0.88rem; color: rgba(255,255,255,0.55); font-weight: 300;
  max-width: 500px; margin: 18px auto 0; line-height: 1.7;
  animation: fadeUp 0.7s 0.2s ease both;
}

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

/* ── CONNECTION LINES ── */
.cards-grid-wrapper {
  position: relative;
  overflow: visible;
}
.connection-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
}
.conn-line {
  opacity: 0.75;
  stroke-dasharray: 6 5;
  animation: dashMove 2.5s linear infinite;
}
@keyframes dashMove {
  to { stroke-dashoffset: -22; }
}
.conn-node {
  opacity: 0.9;
}
@keyframes pulseRing {
  0%   { r: 5;  opacity: 0.8; }
  100% { r: 14; opacity: 0; }
}
.pulse-ring {
  animation: pulseRing 2s ease-out infinite;
}
.pulse-left   { animation-delay: 0s; }
.pulse-right  { animation-delay: 0.3s; }
.pulse-center-l { animation-delay: 0.6s; }
.pulse-center-r { animation-delay: 0.9s; }

/* ── GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto;
  gap: 20px;
  padding-bottom: 80px;
  align-items: stretch;
  overflow: visible;
}
.card-main { grid-column: auto; }

/* ── CARD ── */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px;
  overflow: visible;
  backdrop-filter: blur(16px);
  transition: transform 0.55s cubic-bezier(.22,1,.36,1), border-color 0.3s, box-shadow 0.3s;
  animation: fadeUp 0.7s ease both;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  min-height: 360px;
}
/* Clip only the internal glow/bg effects, not the card itself */
.card-glow, .card::before {
  border-radius: 20px;
}
.card-inner-clip {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.card:nth-child(1) { animation-delay: 0.25s; }
.card:nth-child(2) { animation-delay: 0.35s; }
.card:nth-child(3) { animation-delay: 0.45s; }

/* Left card: tilt inward */
.tilt-wrapper {
  transition: transform 0.55s cubic-bezier(.22,1,.36,1);
  overflow: visible;
}
.tilt-left {
  transform: perspective(1200px) rotateY(14deg) scale(0.94);
  transform-origin: center center;
}
.tilt-left:hover {
  transform: perspective(1200px) rotateY(0deg) scale(1);
}
.tilt-right {
  transform: perspective(1200px) rotateY(-14deg) scale(0.94);
  transform-origin: center center;
}
.tilt-right:hover {
  transform: perspective(1200px) rotateY(0deg) scale(1);
}

.card-soft:hover, .card-studio:hover { transform: translateY(-6px); }
.card:hover { transform: translateY(-6px); }

/* Center card zoom — must come AFTER .card:hover to win cascade */
.card-tech.card-main {
  transition: transform 0.6s cubic-bezier(.34,1.56,.64,1), border-color 0.3s, box-shadow 0.5s ease;
}
.card-tech.card-main:hover {
  transform: scale(1.06) translateY(-6px) !important;
  box-shadow: 0 32px 80px rgba(0,212,255,0.28), 0 0 0 1px rgba(0,212,255,0.35);
}

/* Accent glow strip — clipped inside card via card-inner-clip */
.card-inner-clip::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.card-tech   .card-inner-clip::before { background: linear-gradient(90deg, var(--blue), var(--purple)); box-shadow: 0 0 24px var(--blue); }
.card-soft   .card-inner-clip::before { background: linear-gradient(90deg, var(--green), var(--blue));  box-shadow: 0 0 24px var(--green); }
.card-studio .card-inner-clip::before { background: linear-gradient(90deg, var(--purple), var(--pink)); box-shadow: 0 0 24px var(--purple); }

.card:hover.card-tech   { border-color: rgba(0,212,255,0.4);    box-shadow: 0 24px 64px rgba(0,212,255,0.12); }
.card:hover.card-soft   { border-color: rgba(0,255,178,0.4);    box-shadow: 0 24px 64px rgba(0,255,178,0.12); }
.card:hover.card-studio { border-color: rgba(123,47,255,0.45);  box-shadow: 0 24px 64px rgba(255,45,120,0.12); }

/* Center card elevation */
.card-tech.card-main {
  transform: scale(1.0) translateY(0px);
  box-shadow: 0 8px 48px rgba(0,212,255,0.15), 0 0 0 1px rgba(0,212,255,0.18);
  border-color: rgba(0,212,255,0.22);
  z-index: 2;
}

/* Card BG glow */
.card-glow {
  position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0;
}
.card-tech   .card-glow { width: 340px; height: 340px; background: rgba(0,212,255,0.1);   top: -80px; right: -60px; }
.card-soft   .card-glow { width: 280px; height: 280px; background: rgba(0,255,178,0.1);   bottom: -60px; right: -40px; }
.card-studio .card-glow { width: 320px; height: 320px; background: rgba(123,47,255,0.12); top: -60px; right: -60px; }

/* Per-card background gradients */
.card-soft   { background: linear-gradient(135deg, rgba(0,212,255,0.13) 0%, rgba(0,255,220,0.06) 60%, rgba(6,8,18,0.7) 100%); }
.card-tech   { background: linear-gradient(135deg, rgba(0,80,255,0.16) 0%, rgba(0,140,255,0.08) 60%, rgba(6,8,18,0.7) 100%); }
.card-studio { background: linear-gradient(135deg, rgba(255,45,120,0.16) 0%, rgba(200,30,90,0.07) 60%, rgba(6,8,18,0.7) 100%); }

.card-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; }

/* Card header row */
.card-header {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 14px;
}
.card-tech .card-header,
.card-studio .card-header {
  margin-bottom: 6px;
}
.card-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.card-tech   .card-icon { background: rgba(0,212,255,0.12); border: 1px solid rgba(0,212,255,0.3); }
.card-soft   .card-icon { background: rgba(0,255,178,0.10); border: 1px solid rgba(0,255,178,0.3); }
.card-studio .card-icon { background: rgba(123,47,255,0.12); border: 1px solid rgba(123,47,255,0.3); }

.card-badge {
  font-size: 0.48rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px;
}
.card-tech   .card-badge { background: rgba(0,212,255,0.10); color: var(--blue);   border: 1px solid rgba(0,212,255,0.25); }
.card-soft   .card-badge { background: rgba(0,255,178,0.10); color: var(--green);  border: 1px solid rgba(0,255,178,0.25); }
.card-studio .card-badge { background: rgba(255,45,120,0.10); color: var(--pink);  border: 1px solid rgba(255,45,120,0.25); }

.card h2 {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 900; line-height: 1.15;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.75);
}
.card h3 {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 900; line-height: 1.15;
  margin-bottom: 10px;
}
.card-tech   h3 { color: var(--blue); text-shadow: 0 0 40px rgba(0,212,255,0.5); }
.card-soft   h3 { color: var(--green); text-shadow: 0 0 40px rgba(0,255,178,0.5); }
.card-studio h3 { background: linear-gradient(90deg, var(--purple), var(--pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.card-desc {
  font-size: 0.84rem; color: rgba(255,255,255,0.5); font-weight: 300;
  line-height: 1.6; max-width: 480px; margin-bottom: 16px;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; justify-content: center; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 500;
  padding: 4px 11px; border-radius: 100px;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.tag .dot { width: 4px; height: 4px; border-radius: 50%; }
.card-tech   .tag .dot { background: var(--blue); }
.card-soft   .tag .dot { background: var(--green); }
.card-studio .tag .dot { background: var(--pink); }

/* CTA Button */
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 600;
  padding: 10px 22px; border-radius: 100px;
  border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: all 0.3s cubic-bezier(.22,1,.36,1);
  position: relative; overflow: hidden;
}
.cta-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.cta-btn:hover::after { transform: translateX(100%); }

.btn-tech {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.4);
  color: var(--blue);
  box-shadow: 0 0 20px rgba(0,212,255,0.12);
}
.btn-tech:hover {
  background: rgba(0,212,255,0.18);
  box-shadow: 0 0 32px rgba(0,212,255,0.28);
  transform: translateX(4px);
}
.btn-soft {
  background: rgba(0,255,178,0.08);
  border-color: rgba(0,255,178,0.35);
  color: var(--green);
  box-shadow: 0 0 20px rgba(0,255,178,0.1);
}
.btn-soft:hover {
  background: rgba(0,255,178,0.15);
  box-shadow: 0 0 32px rgba(0,255,178,0.25);
  transform: translateX(4px);
}
.btn-studio {
  background: rgba(123,47,255,0.1);
  border-color: rgba(123,47,255,0.4);
  color: #c084fc;
  box-shadow: 0 0 20px rgba(123,47,255,0.12);
}
.btn-studio:hover {
  background: rgba(123,47,255,0.18);
  box-shadow: 0 0 32px rgba(255,45,120,0.28);
  transform: translateX(4px);
}

.arrow { font-size: 1.1rem; transition: transform 0.25s; }
.cta-btn:hover .arrow { transform: translateX(5px); }

/* ── BOTTOM LABEL (badge moved to bottom) ── */
.card-label-bottom {
  margin-top: auto;
  padding-top: 20px;
}
.card-label-bottom .card-badge {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.45);
}

/* ── DIVIDER ── */
.divider-row {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 16px;
  color: rgba(255,255,255,0.2); font-size: 0.75rem;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 4px 0;
}
.divider-row::before, .divider-row::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  background: rgba(6,8,18,0.8);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 3;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
}
.footer-left { font-size: 0.82rem; color: rgba(255,255,255,0.35); }
.footer-left strong { color: rgba(255,255,255,0.65); font-weight: 600; }
.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--glass);
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem; text-decoration: none;
  transition: all 0.25s;
}
.social-links a:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(0,212,255,0.08);
}
.footer-right { font-size: 0.78rem; color: rgba(255,255,255,0.25); text-align: center; width: 100%; }

/* ── RESPONSIVE ── */
@media (max-width: 780px) {
  html, body { overflow-x: clip; max-width: 100vw; }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 60px;
    padding-top: 12px;
    padding-left: 6px;
    padding-right: 6px;
  }
  .card-main  { grid-column: 1; }
  .card {
    padding: 20px 18px;
    min-height: 280px;
    border-radius: 16px;
    overflow: visible;
    max-width: 100%;
  }
  .nav-links { display: none; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 0.82rem; }
  .hero { padding: 12px 0 16px; }

  /* Allow cards to scale without clipping — only html/body clips horizontal scroll */
  .wrapper { padding: 0 20px; max-width: 100%; overflow: visible; }
  .cards-grid-wrapper { overflow: visible; max-width: 100%; }

  /* Clip card glows so they don't spill outside */
  .card-glow { display: none; }

  /* Constrain all SVGs inside cards */
  .card svg { max-width: 100% !important; height: auto !important; }
  .card-icon svg { max-width: 80px !important; height: 80px !important; }
  .card-tech .card-icon svg { max-width: 160px !important; height: 160px !important; }

  /* ── REMOVE TILT ON MOBILE — cards are straight ── */
  .tilt-left,
  .tilt-right {
    transform: none !important;
    transition: transform 0.4s cubic-bezier(.22,1,.36,1);
    max-width: 100%;
  }

  /* ── SIDE CARD HOVER / TOUCH ZOOM ON MOBILE ── */
  .tilt-left:hover,
  .tilt-left:focus-within,
  .tilt-right:hover,
  .tilt-right:focus-within {
    transform: scale(1.04) translateY(-5px) !important;
  }

  /* Override dim/shrink for mobile — side cards zoom instead */
  .cards-grid.card-focused .tilt-left:not(.card-active),
  .cards-grid.card-focused .tilt-right:not(.card-active) {
    opacity: 1;
    transform: none !important;
  }
  .cards-grid.card-focused .tilt-left.card-active,
  .cards-grid.card-focused .tilt-right.card-active {
    transform: scale(1.04) translateY(-5px) !important;
    opacity: 1;
  }

  /* Smaller tags and buttons */
  .tag { font-size: 0.68rem; padding: 3px 9px; }
  .tags { gap: 6px; margin-bottom: 14px; }
  .cta-btn { font-size: 0.78rem; padding: 9px 18px; }
  .card-label-bottom { padding-top: 14px; }
}
