/* ===== IOS / SAFARI FIXES ===== */

html {
  background-color: #050816;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
body {
  background-color: var(--bg, #050816);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 100svh;
}
.hero,
.section,
.project-card,
.hero-card,
.hero-visual,
.projects-grid {
 touch-action: pan-y pinch-zoom;
}

video,
canvas,
img {
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.bg-video {
  will-change: transform;
}

.hero-visual,
.hero-card,
.project-card {
  transform: translateZ(0);
}
:root {
  --bg: #050816;
  --bg2: #0b1224;
  --panel: rgba(255, 255, 255, .06);
  --panel-border: rgba(255, 255, 255, .1);
  --text: #f5f7ff;
  --muted: rgba(245, 247, 255, .7);
  --soft: rgba(245, 247, 255, .5);
  --accent1: #00eaff;
  --accent2: #3b82f6;
  --glow1: rgba(0, 234, 255, .16);
  --glow2: rgba(59, 130, 246, .14);
  --glow3: rgba(123, 97, 255, .12);
  --radius: 24px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .35);
  --max: 1200px;
}

/* COLORES POR PÁGINA */

body.page-home {
  --bg: #050816;
  --bg2: #0b1224;
  --accent1: #00eaff;
  --accent2: #3b82f6;
  --glow1: rgba(0, 234, 255, .15);
  --glow2: rgba(59, 130, 246, .14);
  --glow3: rgba(123, 97, 255, .12);
}

body.page-visuales {
  --bg: #040816;
  --bg2: #0a1022;
  --accent1: #00eaff;
  --accent2: #7b61ff;
  --glow1: rgba(0, 234, 255, .20);
  --glow2: rgba(123, 97, 255, .18);
  --glow3: rgba(80, 60, 255, .20);
}

body.page-visualizers {
  --bg: #031611;
  --bg2: #09241d;
  --accent1: #00ff88;
  --accent2: #00c2ff;
  --glow1: rgba(0, 255, 136, .20);
  --glow2: rgba(0, 194, 255, .18);
  --glow3: rgba(0, 255, 180, .14);
}

body.page-interactivos {
  --bg: #160805;
  --bg2: #22100a;
  --accent1: #ff7a00;
  --accent2: #ff00c8;
  --glow1: rgba(255, 122, 0, .20);
  --glow2: rgba(255, 0, 200, .18);
  --glow3: rgba(255, 80, 0, .14);
}

/* BASE */

* {
  box-sizing: border-box;
}

/* FIX 1: scroll-behavior duplicado eliminado — solo se declara una vez arriba en iOS fixes */

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, var(--glow1), transparent 35%),
    radial-gradient(circle at 80% 10%, var(--glow2), transparent 30%),
    radial-gradient(circle at 50% 100%, var(--glow3), transparent 35%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment: scroll;
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;

-webkit-font-smoothing: antialiased;

-moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--max), 92%);
  margin: 0 auto;
}

.bg-grid {

  position: fixed;

  inset: 0;

  pointer-events: none;

  background-image:

    linear-gradient(
      rgba(255,255,255,.028) 1px,
      transparent 1px
    ),

    linear-gradient(
      90deg,
      rgba(255,255,255,.028) 1px,
      transparent 1px
    );

  background-size: 40px 40px;

  mask-image:
    radial-gradient(
      circle at center,
      black 42%,
      transparent 88%
    );

 opacity:

  calc(
    0.08 +
    (var(--globalAtmosphere, 0) * 0.16)
  );

  z-index: 0;

  transform:

  translate3d(

    calc(
      (var(--mx, 50%) - 50%) * 0.012
    ),

    calc(
      (var(--my, 50%) - 50%) * 0.012
    ),

    0
  )

  scale(
    calc(
      1 +
      (var(--energy, 0) * 0.006)
    )
  );

  filter:

  blur(
    calc(
      .18px +
      (var(--energy, 0) * .4px)
    )
  )

 brightness(
  calc(
    0.92 +
    (var(--globalAtmosphere, 0) * 0.06)
  )
);

  will-change:
    transform,
    opacity;
}

/* HEADER */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(4, 16, 29, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  min-width: max-content;
}

.brand-mark {
  position: relative;
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: transparent;
}

.v-nav {
  position: relative;
  z-index: 2;
  display: block;
  width: 86%;
  height: 86%;
  transform: translateY(-5px);
}

.v-nav path {
  fill: none;
  stroke: url(#vGradient);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  filter:
    drop-shadow(0 0 8px var(--accent1))
    drop-shadow(0 0 18px var(--accent2));
  animation:
    drawV 2s ease-out forwards,
    glowV 3s infinite ease-in-out;
}

.v-canvas {
  position: absolute;
  left: -7px;
  top: -7px;
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  pointer-events: none;
  z-index: 4;
}

.brand-text span,
.mini strong {
  display: block;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.brand-text small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1;
  color: #94a3b8;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 14px;
  color: #cbd5e1;
  position: relative;
  transition: 0.3s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  transition: 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 6px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #04101d !important;
  font-weight: 600;
}

.nav-cta::after {
  display: none;
}

/* HERO */

.hero {
  position: relative;
  z-index: 1;
  padding: 92px 0 58px;
}

.hero-silence-layer {

  position: absolute;

  inset: 0;

  pointer-events: none;

  z-index: 0;

  background:

    radial-gradient(

      circle at center,

      transparent 0%,

      rgba(0,0,0,.04) 58%,

      rgba(0,0,0,.16) 100%
    );

  opacity:

  calc(
    0.58 +
    (var(--globalAtmosphere, 0) * 0.12)
  );

  mix-blend-mode: normal;

  will-change: opacity;
}

.hero-grid {
  position: relative;

  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 28px;
  align-items: center;
}

.hero-content p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 680px;
  text-shadow:
  0 1px 2px rgba(0,0,0,.22);
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: .96;
  margin: 0 0 18px;
  max-width: 9.5ch;
}

h1 span {
  background: linear-gradient(135deg, #ffffff, var(--accent1) 45%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--accent1);
  font-weight: 700;
  font-size: .84rem;
  margin-bottom: 18px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.center-actions {
  justify-content: center;
}

.hero-points {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-points span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--soft);
  font-size: .86rem;
}

/* BOTONES */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: .22s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #05111d;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  box-shadow: 0 14px 35px color-mix(in srgb, var(--accent2) 35%, transparent);
}

.btn-secondary {
  color: #fff;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
}

/* HERO CARD */

.hero-card {
  position: relative;
 contain: layout;

isolation: isolate;

transform:

  translate3d(0,0,0)

  scale(
    calc(
      1 +
      (var(--atmosphere, 0) * 0.004)
    )
  );

  backface-visibility: hidden;

  -webkit-backface-visibility: hidden;
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .04));
  border: 1px solid color-mix(
  in srgb,
  var(--accent1) calc(8% + (var(--atmosphere, 0) * 28%)),
  rgba(255,255,255,.06)
);
  box-shadow:
  0 10px 24px rgba(0,0,0,.22),
  0 38px 120px rgba(0,0,0,.16),
  0 0 0 1px rgba(255,255,255,.022),
  0 0 60px color-mix(in srgb, var(--accent1) 18%, transparent),
  0 0 120px color-mix(in srgb, var(--accent1) 10%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
  transition:

  transform 0.9s cubic-bezier(.22,.61,.36,1),

  box-shadow 1.2s ease,

  border-color 1s ease,

  background 1.2s ease;
}

.hero-visual {
  position: relative;
  height: 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  background:

  radial-gradient(

    circle at center,

    rgba(255,255,255,.03),

    rgba(0,0,0,.22)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  contain: layout style;

isolation: isolate;

transform:
  translate3d(0,0,0);

will-change:
  transform,
  opacity;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;

  filter:
  brightness(.82)
  saturate(.88)
  contrast(1.02);

transform: scale(1.018);
}

#bgFX {
  position: absolute;
  inset: 0;
  opacity: .58;

mix-blend-mode: screen;

filter:
  blur(.4px)
  saturate(108%);
  z-index: 2;
  pointer-events: none;
  transform:
  translate3d(0,0,0);

will-change:
  transform,
  opacity;

backface-visibility: hidden;

-webkit-backface-visibility: hidden;
}

.hero-mini-stats {
  display: flex;
  gap: 12px;
  margin-top: 15px;
}

.mini {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
 background:
  rgba(255,255,255,.035);
  text-align: center;
border:
  1px solid
  rgba(255,255,255,.045);
}

.mini strong {
  font-size: 14px;
}

.mini small {
  font-size: 11px;
  color: var(--soft);
}

/* SECCIONES */

.section {
  position: relative;
  z-index: 1;
  padding: 64px 0;
  overflow-x: clip;
  overflow-y: clip;
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0 0 10px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

/* PROYECTOS */

.projects-grid {

  position: relative;

  display: grid;

  perspective: 1600px;
transform-style: preserve-3d;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(200px, 1fr)
    );

  gap: 28px;

  isolation: isolate;

}

.projects-grid::before {

  content: "";

  position: absolute;

  inset: -8%;

  background:

    radial-gradient(

      circle at 50% 50%,

      color-mix(
        in srgb,
        var(--accent1) 6%,
        transparent
      ),

      transparent 72%
    );

  opacity:
calc(

  0.004 +

  (var(--breath, 0) * 0.012) +

  (var(--globalAtmosphere, 0) * 0.028)
);

filter:

blur(
  calc(
    72px +
    (var(--globalAtmosphere, 0) * 18px)
  )
)

brightness(
  calc(
    0.92 +
    (var(--globalAtmosphere, 0) * 0.08)
  )
);

  pointer-events: none;

  z-index: -1;

  will-change:
    opacity,
    filter;
}

.project-card {
  position: relative;

 overflow: visible;

backface-visibility: hidden;

-webkit-backface-visibility: hidden;

/* FIX 4: transform-style: preserve-3d declarado una sola vez */
transform-style: preserve-3d;

  border-radius: 28px;

border: 1px solid
  color-mix(
    in srgb,
    var(--accent1) 10%,
    rgba(255,255,255,.06)
  );

background:

  linear-gradient(

    180deg,

    rgba(
      255,
      255,
      255,

      calc(
        0.032 +
        (var(--energy) * 0.010)
      )
    ),

    rgba(
      255,
      255,
      255,

      calc(
        0.010 +
        (var(--proximity) * 0.004)
      )
    )
  ),

  rgba(
    3,
    5,
    12,

    calc(
      0.78 -
      (var(--proximity) * 0.025)
    )
  );

 transform:
   translateY(var(--liftY, 0px))
  scale(var(--liftScale, 1))
 translate3d(
  calc(var(--magneticX, 0px) * 0.82),
  calc(var(--magneticY, 0px) * 0.82),
   calc((var(--breath, 0) - 0.5) * 1.2px)
  )
scale(
  calc(
    1 +
    (var(--proximity) * 0.018)
  )
)
 rotateX(var(--tiltX, 0deg))
rotateY(var(--tiltY, 0deg))
rotateZ(
  calc(
    var(--tiltY, 0deg) * 0.018
  )
)

translateX(
  calc(
    var(--depthShiftX, 0px)
  )
)

translateY(
  calc(
    var(--depthShiftY, 0px)
  )
);

  transition:
    transform 0.72s cubic-bezier(.22,.61,.36,1),
    box-shadow 0.45s ease,
    border-color 0.3s ease;

 will-change:

  transform,

  opacity;

contain:
  layout;

  isolation: isolate;

opacity:
  calc(

    0.70 +

    (var(--proximity) * 0.18) +

    (var(--energy) * 0.04) +

    (var(--fieldPresence, 0) * 0.12)
  );

  --proximity: 0;
  --energy: 0;
  --breath: 0;

  user-select: none;
  -webkit-user-select: none;

  pointer-events: auto;
}


.project-card:hover .project-thumb img {
  transform: scale(1.08);
}

.project-badge {
  position: absolute;

  transform:

  translateZ(92px)

  translateX(
    calc(var(--tiltY, 0deg) * 0.16)
  )

  translateY(
    calc(var(--tiltX, 0deg) * -0.16)
  )

  rotateZ(
    calc(var(--tiltY, 0deg) * 0.024)
  );
  top: 12px;
  left: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  border: 1px solid var(--accent1);
  font-size: 12px;
  transition:

transform 1.35s cubic-bezier(.12,.82,.18,1),

opacity 1.1s ease,

filter 1.2s ease;
}

.project-body {

  position: relative;

  z-index: 2;

  transform:

  translateZ(
    calc(
      64px +
      (var(--proximity) * 28px)
    )
  )

  translateX(
    calc(var(--tiltY, 0deg) * 0.12)
  )

  translateY(
    calc(var(--tiltX, 0deg) * -0.12)
  )

  rotateZ(
    calc(var(--tiltY, 0deg) * 0.012)
  );

  padding: 22px 20px;

  will-change: transform;

  transition:

transform 1.08s cubic-bezier(.16,.84,.24,1),

filter 1.2s ease,

opacity 1s ease;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.project-top h3 {
  margin: 0;
  font-size: 1.2rem;
}

.project-tag {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--accent1);
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent1) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent1) 20%, transparent);
}

.project-body p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
z-index: 30;
transform:
  translateZ(110px)
  translateX(calc(var(--tiltY, 0deg) * 0.12))
  translateY(calc(var(--tiltX, 0deg) * -0.12));
 transition:

transform .82s cubic-bezier(.18,.78,.22,1),

opacity .9s ease;
}

/* ABOUT / CONTACTO */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.glass {
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .035));
  border: 1px solid rgba(255, 255, 255, .1);
}

.glass h3,
.glass h2 {
  margin-top: 0;
}

.glass p {
  color: var(--muted);
  line-height: 1.6;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.skills span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--soft);
  font-size: .84rem;
}

.contact-box {
  text-align: center;
}

/* FOOTER */

footer {
  position: relative;
  z-index: 1;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--soft);
  font-size: .9rem;
}

/* ANIMACIONES */

@keyframes drawV {
  from {
    stroke-dashoffset: 200;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes glowV {
  0%, 100% {
    filter:
      drop-shadow(0 0 5px var(--accent1))
      drop-shadow(0 0 12px var(--accent2));
  }

  50% {
    filter:
      drop-shadow(0 0 12px var(--accent1))
      drop-shadow(0 0 26px var(--accent2));
  }
}

/* RESPONSIVE */

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

  .hero-card {
    min-height: 360px;
  }

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

@media (max-width: 768px) {
  .header-inner {
    padding: 8px 12px;
    align-items: center;
  }

  .brand-text span {
    font-size: 14px;
  }

  .brand-text small {
    font-size: 10px;
  }

  .nav-links {
    gap: 10px;
  }

  .nav-links a {
    font-size: 12px;
  }

  .nav-cta {
    padding: 5px 9px;
  }

  .hero {
    padding-top: 64px;
  }

  .btn {
    min-height: 44px;
    padding: 0 14px;
    font-size: 13px;
    position: relative;
z-index: 40;
pointer-events: auto;
touch-action: manipulation;
  }

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

  .hero-mini-stats {
    flex-direction: column;
  }

  .footer-line {
    flex-direction: column;
    text-align: center;
  }

  .project-card::before {

  opacity:
    calc(
      0.04 +
      (var(--proximity) * 0.12)
    );

  filter:
    blur(22px);

}

.project-card::after {

  opacity:
    calc(
      0.004 +
      (var(--proximity) * 0.08)
    );

  filter:
    blur(28px);
}

  .project-card {

  transform:

    translate3d(

      calc(var(--magneticX, 0px) * 0.55),

      calc(var(--magneticY, 0px) * 0.55),

      0
    )

    rotateX(
      calc(var(--tiltX, 0deg) * 0.26)
    )

    rotateY(
      calc(var(--tiltY, 0deg) * 0.26)
    );
 }

  .bg-video {

  filter:
    brightness(.74)
    saturate(.82)
    contrast(1.01);

}

  .bg-grid {

  opacity: .08;

  filter: blur(.3px);
}
}

@media (max-width: 520px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
  }

  h1 {
    font-size: clamp(2.3rem, 13vw, 3.8rem);
  }

  .hero-card {
    padding: 16px;
    min-height: 300px;
    transform:

  translate3d(0,0,0)

  scale(
    calc(
      1 +
      (var(--atmosphere, 0) * 0.002)
    )
  );
  }
}

/* ============================= */
/* VISART APPLE CARDS FINAL */
/* ============================= */

.project-card:hover {
  opacity: 1;

  border-color:
  color-mix(
    in srgb,
    var(--accent1) 42%,
    rgba(255,255,255,.08)
  );

 box-shadow:

 0 1px 2px rgba(0,0,0,.34),

 0 12px 24px rgba(0,0,0,.26),

  0 42px 96px rgba(0,0,0,.26),

  0 78px 160px rgba(0,0,0,.14),

  0 0 26px
  color-mix(
    in srgb,
    var(--accent1) 12%,
    transparent
  );
}

  

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;

background:

  radial-gradient(

   circle at

calc(var(--haloX, 50%) + 4%)
calc(var(--haloY, 30%) - 3%),

    color-mix(
      in srgb,
      var(--accent1) 32%,
      transparent
    ) 0%,

    color-mix(
      in srgb,
      var(--accent2) 12%,
      transparent
    ) 24%,

    transparent 58%
  ),

  linear-gradient(

    145deg,

    rgba(255,255,255,.085),

    rgba(255,255,255,.015) 42%,

    rgba(0,0,0,.08)
  );

opacity:
calc(

  0.045 +

  (var(--proximity) * 0.24) +

  (var(--energy) * 0.06) +

  (var(--foregroundAuthority, 0) * 0.08)
);
transition:

  opacity .9s ease,

  transform 1.1s cubic-bezier(.22,.61,.36,1),

  filter 1.2s ease;
  pointer-events: none;
  z-index: 3;
 mix-blend-mode: plus-lighter;
  filter:

blur(
  calc(
    22px +
    (var(--energy) * 10px) +
    (var(--breath) * 6px)
  )
)

brightness(
  calc(
    1.02 +
    (var(--foregroundAuthority, 0) * 0.12)
  )
)

contrast(
  calc(
    1.08 +
    (var(--depthPresence, 0) * 0.08)
  )
)

saturate(1.18);

  will-change: transform, opacity;
transform:

  translate3d(
    calc(var(--magneticX, 0px) * -0.18),
    calc(var(--magneticY, 0px) * -0.18),
    0
  )

  scale(
    calc(
      1.012 +
      (var(--energy) * 0.004) +
      (var(--atmosphericDepth, 0) * 0.008)
    )
  )

  translateZ(
    calc(
      var(--depthPresence, 0) * -6px
    )
  );

backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}

.project-card:hover::before {
  opacity:
    calc(
      0.22 +
      (var(--proximity) * 0.34) +
      (var(--energy) * 0.08)
    );
}

.project-card::after {

  content: "";

  position: absolute;

  inset: -24px;

  border-radius: 34px;
 mix-blend-mode: screen;

  background:
    radial-gradient(
      circle at
   var(--haloX, 50%)
   var(--haloY, 50%),

      color-mix(
        in srgb,
        var(--accent1) 38%,
        transparent
      ) 0%,

      color-mix(
        in srgb,
        var(--accent2) 18%,
        transparent
      ) 28%,

      transparent 72%
    );

opacity:
  calc(

    0.008 +

    (var(--proximity) * 0.095) +

    (var(--energy) * 0.018)
  );

  filter:

blur(
  calc(
    18px +
    (var(--energy) * 10px)
  )
)

brightness(
  calc(
    1 +
    (var(--foregroundAuthority, 0) * 0.08)
  )
);
  transform:

    translate3d(
      calc(var(--magneticX, 0px) * -0.24),
      calc(var(--magneticY, 0px) * -0.24),
      0
    )

    translateZ(0)
    scale(
  calc(
    1.004 +

    (var(--energy) * 0.004) +

    (var(--breath) * 0.018)
  )
);

  pointer-events: none;

  z-index: -1;

 will-change:
  opacity;
}

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;

  border-radius: 22px;

  background:

  radial-gradient(

    circle at 50% 50%,

    rgba(255,255,255,.022),

    transparent 72%
  );

isolation: isolate;

transform:
  translateZ(8px);

will-change:
  transform;
}

.project-thumb img {

  z-index: 2;

  width: 100%;

  height: 100%;

  object-fit: cover;

  transform-origin:
    center center;

  transition:
    transform .92s cubic-bezier(.22,.61,.36,1),
    filter .72s ease;

  transform:

    translateZ(
      calc(
        36px +
        (var(--proximity) * 16px)
      )
    )

    scale(
      calc(
        1.003 +
        (var(--energy) * 0.003)
      )
    )

    translateX(
      calc(
        var(--tiltY, 0deg) * 0.035
      )
    )

    translateY(
      calc(
        var(--tiltX, 0deg) * -0.035
      )
    );

  filter:

brightness(
  calc(
    0.82 +
    (var(--proximity) * 0.12) +
    (var(--depthPresence, 0) * 0.06)
  )
)

saturate(
  calc(
    0.88 +
    (var(--proximity) * 0.08)
  )
)

contrast(
  calc(
    1.06 +
    (var(--proximity) * 0.06) +
    (var(--depthPresence, 0) * 0.04)
  )
)

blur(
  calc(
    (1 - var(--focusDepth, 1)) * 0.45px
  )
);

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  will-change:
    transform;
}


.project-card:hover .project-thumb img {
  transform: scale(1.035);
}

.project-thumb::after {

  content: "";

  position: absolute;

  inset: 0;

  background:

    linear-gradient(
      to top,
      rgba(0,0,0,.78),
      transparent 62%
    ),

    radial-gradient(

      circle at

      calc(var(--mx, 50%) + 2%)
      calc(var(--my, 0%) - 6%),

      rgba(255,255,255,.16),

      transparent 42%
    );

  opacity:
calc(

  0.34 +

  (var(--proximity) * 0.22) +

  (var(--energy) * 0.05) +

  (var(--foregroundAuthority, 0) * 0.16)
);

  transition:
    opacity .55s ease,
    background-position .8s ease;

  mix-blend-mode: normal;

  
transform: translate3d(0,0,0);
  will-change:
    opacity,
    transform;

  pointer-events: none;
}

.project-featured {
  grid-column: span 2;
  min-height: 100%;
}

.project-featured .project-thumb {
  aspect-ratio: 16 / 8;
}

.project-featured .project-top h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.project-featured .project-body p {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .project-featured {
    grid-column: span 1;
  }

  .project-featured .project-thumb {
    aspect-ratio: 16 / 9;
  }
}
/* ============================= */
/* VISART PREMIUM HERO GLOBAL */
/* ============================= */



.hero::before {

  content: "";

  position: absolute;

  inset: 0;

  background:

    radial-gradient(

      circle at 18% 22%,

      color-mix(
        in srgb,
        var(--accent1) 12%,
        transparent
      ),

      transparent 34%
    ),

    radial-gradient(

      circle at 72% 14%,

      color-mix(
        in srgb,
        var(--accent2) 10%,
        transparent
      ),

      transparent 38%
    ),

    radial-gradient(

      circle at 50% 120%,

      rgba(255,255,255,.025),

      transparent 62%
    );

  pointer-events: none;

 opacity:

  calc(
    0.22 +
    (var(--globalAtmosphere, 0) * 0.24)
  );

 filter:

  blur(
    calc(
      18px +
      (var(--globalAtmosphere, 0) * 26px)
    )
  )

  saturate(
    calc(
      1 +
      (var(--globalAtmosphere, 0) * 0.08)
    )
  );

  z-index: -1;

  transform:
    translate3d(0,0,0);

  will-change:
    opacity,
    filter;
}

.hero-content {
  position: relative;
  z-index: 4;

  max-width: 680px;

  isolation: isolate;
}

.hero-content::before {

  content: "";

  position: absolute;

  left: -42px;

  top: -34px;

  width: 160px;

  height: 160px;

  border-radius: 999px;

  background:

    radial-gradient(

      circle,

      color-mix(
        in srgb,
        var(--accent1) 10%,
        transparent
      ),

      transparent 72%
    );

  filter:
    blur(24px);

  opacity: .72;

  pointer-events: none;

  z-index: -1;
}

.eyebrow {
  box-shadow:
    0 0 18px color-mix(in srgb, var(--accent1) 22%, transparent),
    inset 0 0 12px rgba(255,255,255,.04);
}

h1 {
  letter-spacing: -0.065em;
  text-wrap: balance;
}

h1 span {
  position: relative;
  filter:
  drop-shadow(
    0 0 8px
    color-mix(
      in srgb,
      var(--accent1) 18%,
      transparent
    )
  );
}

h1 span::after {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: -8px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent1) 45%, transparent);
  opacity: .75;
}

.hero-actions .btn {
  position: relative;
  overflow: hidden;
}

.hero-actions .btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
  transform: translateX(-120%);
  transition: .6s ease;
}

.hero-actions .btn-primary:hover::before {
  transform: translateX(120%);
}

.hero-card {
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.hero-card-wrap {
  position: relative;
   transform-style: preserve-3d;
}
.hero-glow {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  pointer-events: none;
  z-index: 0;
  box-shadow:
    0 0 calc(45px * var(--heroGlow, 0)) rgba(180, 250, 255, calc(0.95 * var(--heroGlow, 0))),
    0 0 calc(95px * var(--heroGlow, 0)) rgba(0, 234, 255, calc(0.65 * var(--heroGlow, 0))),
    0 0 calc(160px * var(--heroGlow, 0)) rgba(0, 234, 255, calc(0.42 * var(--heroGlow, 0)));
  transition: box-shadow 0.2s ease;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent1) 35%, transparent), transparent 32%),
    radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--accent2) 30%, transparent), transparent 34%);
  opacity:

  calc(
    0.18 +
    (var(--atmosphere, 0) * 0.18)
  );
  filter:

  blur(
    calc(
      24px +
      (var(--atmosphere, 0) * 18px)
    )
  );
  pointer-events: none;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 29px;
 border:
  1px solid
  rgba(255,255,255,.045);
  pointer-events: none;
}

.hero-visual::after {

  content: "";

  position: absolute;

  inset: 0;

  background:

    linear-gradient(
      to top,
      rgba(0,0,0,.68),
      rgba(0,0,0,.22) 42%,
      transparent 72%
    ),

    radial-gradient(

      circle at 50% 18%,

      rgba(255,255,255,.06),

      transparent 46%
    );
  box-shadow:

  inset 0 0 120px rgba(0,0,0,.22),

  inset 0 -40px 80px rgba(0,0,0,.18);

  z-index: 3;

  opacity:

  calc(
    0.72 +
    (var(--globalAtmosphere, 0) * 0.12)
  );

  pointer-events: none;
}

.hero-mini-stats {
  position: relative;
  z-index: 4;
}

.mini {
  backdrop-filter: blur(10px);
  opacity: .88;

backdrop-filter:
  blur(8px)
  saturate(105%);
}

.section-head h2 {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* ============================= */
/* VISART PAGE TRANSITION */
/* ============================= */

body {
  opacity: 1;
}

body.is-leaving {
  animation: pageFadeOut .38s ease forwards;
}

@keyframes pageFadeOut {
  from {
    opacity: 1;
    filter: blur(0);
  }

  to {
    opacity: 0;
    filter: blur(10px);
  }
}

/* ============================= */
/* VISART SCROLL REVEAL */
/* ============================= */

.reveal {
  opacity: 0;
  filter: blur(8px);
  transition:
    opacity .8s ease,
    filter .8s ease;
}

.reveal.is-visible {
  opacity: 1;
  filter: blur(0);
}

.project-card::before,
.project-card::after {
  pointer-events: none !important;
}

.project-card * {
  pointer-events: auto;
}

.project-card a,
.project-card button,
.project-card .btn,
.project-card .project-link {
  position: relative;
  z-index: 30;
  pointer-events: auto !important;
}

/* =====================================================
   VISART RENDER PROFILE — ANDROID
   Target: Chromium/WebView Android
   Strategy: flat compositing, no blend overload,
             GPU layer reduction, filter simplification
===================================================== */

body.platform-android .project-card {
  transform-style: flat;
  contain: layout style;
  will-change: transform, opacity;
}

/* Simplify the 3D child layers — they flatten anyway */
body.platform-android .project-badge,
body.platform-android .project-body,
body.platform-android .project-actions {
  transform: none !important;
  will-change: auto;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
}

/* Desactivar completamente ::before y ::after */
body.platform-android .project-card::before,
body.platform-android .project-card::after {
  display: none !important;
}

/* Fijar opacity — sacarla del RAF loop */
body.platform-android .project-card {
  opacity: 1 !important;
}

/* FIX 2: bloques Android bg-grid y thumb img consolidados —
   eliminadas las declaraciones anteriores redundantes */

/* bg-grid — fijo en Android */
body.platform-android .bg-grid {
  transform: none !important;
  opacity: 0.06 !important;
  filter: none !important;
  will-change: auto !important;
}

/* Reemplazar el halo con box-shadow — esto SÍ
   vive en el compositor sin repaint */
body.platform-android .project-card {
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.38),
    0 24px 64px rgba(0, 0, 0, 0.22);
  transition:
    transform 0.55s cubic-bezier(.22, .61, .36, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}

body.platform-android .project-card:hover {
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.42),
    0 32px 80px rgba(0, 0, 0, 0.26),
    0 0 28px rgba(0, 234, 255, 0.12);
  border-color: rgba(0, 234, 255, 0.35);
}

/* FIX 3: thumb img consolidado — una sola declaración Android */
body.platform-android .project-thumb img {
  filter: brightness(0.85) saturate(0.9);
  transition: transform 0.5s ease, filter 0.4s ease;
  will-change: auto;
  transform: none;
}

body.platform-android .project-card:hover .project-thumb img {
  filter: brightness(0.96) saturate(1.0);
  transform: scale(1.04);
}

/* thumb ::after — desactivar blend mode en Android */
body.platform-android .project-thumb::after {
  mix-blend-mode: normal;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72),
    transparent 58%
  );
  opacity: calc(0.38 + (var(--proximity) * 0.14));
  filter: none;
  transition: opacity 0.5s ease;
}

/* Grid — remove perspective overhead */
body.platform-android .projects-grid {
  perspective: none;
  transform-style: flat;
}

/* hero-card — reduce atmosphere scale */
body.platform-android .hero-card {
  transform: translate3d(0, 0, 0) !important;
  will-change: auto;
}
body.platform-android .hero-card::before {
  filter: blur(20px);
  opacity: calc(0.14 + (var(--atmosphere, 0) * 0.10));
  transition: opacity 0.8s ease;
}

/* ─── ANDROID: eliminar transitions de hijos ─────────────
   Causa del flash post-touch: transitions corriendo
   sobre custom properties que vuelven a 0 al salir
   el dedo. Aunque transform sea none, el transition
   event igual dispara repaint en Chromium Android.
──────────────────────────────────────────────────────── */

body.platform-android .project-badge,
body.platform-android .project-body,
body.platform-android .project-actions,
body.platform-android .project-thumb,
body.platform-android .project-thumb img,
body.platform-android .project-thumb::after {
  transition: none !important;
}

/* Fijar opacity de hijos — no depender de vars */
body.platform-android .project-body,
body.platform-android .project-actions {
  opacity: 1 !important;
}

/* =====================================================
   VISART RENDER PROFILE — iOS / Safari
   Target: WebKit iOS
   Strategy: preserve-3d permitido pero acotado,
             filters suavizados, sin plus-lighter,
             compositing layers controlados
===================================================== */

body.platform-ios .project-card {
  transform-style: preserve-3d;
  contain: layout;
  -webkit-transform-style: preserve-3d;
}

/* iOS maneja preserve-3d bien pero los filters
   animados en ::before saturan el compositor */
body.platform-ios .project-card::before {
  mix-blend-mode: screen;
  filter: blur(20px) brightness(1.02) saturate(1.12);
  opacity: calc(0.05 + (var(--proximity) * 0.22));
  transition: opacity 0.7s ease;
  will-change: opacity;
}

body.platform-ios .project-card::after {
  filter: blur(16px);
  opacity: calc(0.008 + (var(--proximity) * 0.08));
  transition: opacity 0.7s ease;
}

/* Reducir capas 3D de hijos — iOS los maneja
   pero en cards con muchos children satura */
body.platform-ios .project-badge {
  transform: translateZ(60px);
}

body.platform-ios .project-body {
  transform: translateZ(32px);
}

body.platform-ios .project-actions {
  transform: translateZ(42px);
}

/* thumb — simplificar blur dinámico */
body.platform-ios .project-thumb img {
  filter:
    brightness(calc(0.84 + (var(--proximity) * 0.10)))
    saturate(calc(0.88 + (var(--proximity) * 0.07)));
  transform:
    translateZ(20px)
    scale(calc(1.002 + (var(--energy) * 0.002)));
  transition: transform 0.8s ease, filter 0.6s ease;
}

/* bg-grid — iOS Safari no necesita los custom props
   dinámicos del grid para compositing correcto */
body.platform-ios .bg-grid {
  transform: translate3d(0, 0, 0);
  opacity: calc(0.07 + (var(--globalAtmosphere, 0) * 0.10));
  will-change: opacity;
}

/* ════════════════════════════════════════
   ANDROID STABILITY PASS — Paso 1
   El movimiento lo maneja solo el motor.
   Quitamos la transición del transform para
   que no pelee con él y se quite el parpadeo.
   ════════════════════════════════════════ */
body.platform-android .project-card {
  transition:
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}

/* ════════════════════════════════════════
   ANDROID STABILITY PASS — Paso 2
   En táctil no hay mouse, pero el navegador
   "finge" un hover al tocar y se queda pegado.
   Aquí lo apagamos.
   ════════════════════════════════════════ */
@media (hover: none) {

  body.platform-android .project-card:hover {
    box-shadow:
      0 8px 28px rgba(0, 0, 0, 0.38),
      0 24px 64px rgba(0, 0, 0, 0.22);
    border-color: color-mix(
      in srgb,
      var(--accent1) 10%,
      rgba(255, 255, 255, .06)
    );
  }

  .project-card:hover .project-thumb img {
    transform: none;
  }
}

/* ════════════════════════════════════════
   ANDROID STABILITY PASS — Paso 3 (color por página)
   ════════════════════════════════════════ */
body.platform-android .project-card:active {
  border-color: color-mix(in srgb, var(--accent1) 35%, transparent);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.42),
    0 32px 80px rgba(0, 0, 0, 0.26),
    0 0 28px color-mix(in srgb, var(--accent1) 22%, transparent);
}

/* ════════════════════════════════════════
   ARREGLO — sombra oscura al pie de la foto
   La bajamos y hacemos que casi no reaccione
   al mouse. Se mantiene el brillo que sigue
   al cursor.
   ════════════════════════════════════════ */
.project-thumb::after {
  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, .35),
      transparent 48%
    ),
    radial-gradient(
      circle at
      calc(var(--mx, 50%) + 2%)
      calc(var(--my, 0%) - 6%),
      rgba(255, 255, 255, .16),
      transparent 42%
    );
  opacity: calc(
    0.20 +
    (var(--proximity) * 0.10) +
    (var(--energy) * 0.04)
  );
}


/* ════════════════════════════════════════
   TARJETA FLOTANTE — elevación SOLO con sombra,
   sin tocar el transform (así el tilt se conserva).
   ════════════════════════════════════════ */
@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    box-shadow:
      0 2px 4px rgba(0, 0, 0, .30),
      0 20px 30px rgba(0, 0, 0, .55),
      0 45px 60px rgba(0, 0, 0, .35),
  }
}
/* ════════════════════════════════════════
   ARREGLO — el glow del hero sigue el color
   de cada página (antes estaba fijo en cian).
   ════════════════════════════════════════ */
.hero-glow {
  box-shadow:
    0 0 calc(22px * var(--heroGlow, 0))  color-mix(in srgb, var(--accent1) 75%, white),
    0 0 calc(48px * var(--heroGlow, 0))  color-mix(in srgb, var(--accent1) 65%, transparent),
    0 0 calc(80px * var(--heroGlow, 0)) color-mix(in srgb, var(--accent1) 42%, transparent);
}

/* ════════════════════════════════════════
   ARREGLO — glow del hero más rápido,
   como el de las tarjetas.
   ════════════════════════════════════════ */
.hero-glow {
  transition: box-shadow 0.03s ease;
}
/* =========================================================
   VISART FLIP CARDS  —  pegar al FINAL de style.css
========================================================= */

.project-card {
  transform: none !important;
  perspective: 850px;
  overflow: visible;
  background: transparent;
  border: none;
  opacity: 1 !important;
  will-change: auto;
}

.project-card::before,
.project-card::after { display: none !important; }

.project-card-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(.22,.61,.36,1);
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover .project-card-inner { transform: rotateY(180deg); }
}
.project-card.is-flipped .project-card-inner { transform: rotateY(180deg); }

.project-card-front,
.project-card-back {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
 border: 1px solid rgba(255,255,255,.06);
}

.project-card-front {
  background: #03050c;
  transform-style: preserve-3d;
}

.project-card-front .pc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  filter: brightness(.78) saturate(.92);
  transform: translateZ(0);
}

.project-card-front .pc-veil {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
  transform: translateZ(18px);
  background:
    linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.15) 55%, transparent 80%),
    radial-gradient(circle at 50% 22%,
      color-mix(in srgb, var(--accent1) 14%, transparent), transparent 55%);
}

.pc-brand {
  position: absolute;
  left: 0; right: 0; bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transform: translateZ(85px);
}
.pc-brand-row { display: flex; align-items: baseline; gap: 6px; }
.pc-brand-v {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent1) 55%, transparent));
}
.pc-brand-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.pc-brand-sub {
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--soft);
}

.project-card-front .pc-badge {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 4;
  transform: translateZ(55px);
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(0,0,0,.68);
  color: #fff;
  border: 1px solid var(--accent1);
  font-size: 12px;
}
.project-card-front .pc-hint {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 4;
  font-size: 11px;
  color: var(--soft);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.1);
}

.project-card-back {
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  transform-style: preserve-3d;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)),
    rgba(3,5,12,1);
}
.project-card-back .pc-body {
  padding: 26px 22px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform: translateZ(70px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  contain: layout;
}
.project-card-back .pc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.project-card-back .pc-top h3 { margin: 0; font-size: 1.25rem; }
.project-card-back .pc-tag {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--accent1);
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent1) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent1) 20%, transparent);
}
.project-card-back .pc-body p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card:hover .project-card-front,
.project-card.is-flipped .project-card-front,
.project-card:hover .project-card-back,
.project-card.is-flipped .project-card-back {
  box-shadow:
    0 0 38px color-mix(in srgb, var(--accent1) 30%, transparent),
    inset 0 0 60px color-mix(in srgb, var(--accent1) 10%, transparent);
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    box-shadow:
      0 2px 4px rgba(0,0,0,.30),
      0 24px 40px rgba(0,0,0,.45);
  }
}

body.platform-android .project-card,
body.platform-ios .project-card {
  transform: none !important;
}
body.platform-android .project-card-inner {
  transition: transform 0.55s cubic-bezier(.22,.61,.36,1);
}

/* === Imagen tenue de fondo en el reverso === */
.project-card-back {
  overflow:;            /* recorta la imagen de fondo a las esquinas */
}

.project-card-back .pc-back-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  filter: brightness(.28) saturate(.85) blur(1px);
  opacity: .5;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
}

/* El texto por encima de la imagen de fondo */
.project-card-back .pc-body {
  position: relative;
  z-index: 1;
}

/* === Cards con ancho controlado y rejilla centrada === */
.projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  justify-content: center;
}

/* En móvil, una columna que llena el ancho disponible */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
  }
}

/* Escalonar elementos dentro del reverso */
.project-card-back .pc-top   { transform: translateZ(20px); }
.project-card-back .pc-body p { transform: translateZ(10px); }
.project-card-back .project-actions { transform: translateZ(30px); }


