:root {
  --bg-main: #05050a;
  --bg-secondary: #0b0b14;
  --bg-soft: #11111f;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.15);
  --accent-strong: #4c5bff;
  --text-main: #f7f7ff;
  --text-muted: #a0a0c0;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.65);
  --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.4);
  --transition-fast: 0.2s ease-out;
  --transition-med: 0.3s ease-out;
}

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

html, 
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #16162b 0, #05050a 45%, #000 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

.page-wrapper {
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Sections */

.section {
  background: radial-gradient(circle at top right, rgba(124, 92, 255, 0.1), transparent 55%),
    linear-gradient(135deg, rgba(12, 12, 30, 0.96), rgba(5, 5, 10, 0.98));
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.section-light {
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.1), transparent 55%),
    linear-gradient(135deg, #101020, #070712);
}

.section + .section {
  margin-top: 4px;
}

.section-header {
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #eaeaff;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: stretch;
  padding: 22px 18px;
}

.hero-content {
  z-index: 1;
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.hero-subtitle {
  margin: 0 0 18px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-accent {
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  min-height: 140px;
  will-change: transform, box-shadow, opacity;
  animation: float-accent 6.5s ease-in-out infinite both;
  margin-top: 12px;
  transition:
    transform 260ms var(--transition-fast),
    box-shadow 260ms var(--transition-fast),
    border-color 260ms var(--transition-fast),
    outline 260ms var(--transition-fast);
  border: 1px solid rgba(255,255,255,0.03);
  outline: 0 solid transparent;

  /* replaced image with an embedded background video + subtle dark gradient overlay */
  background-image: linear-gradient(180deg, rgba(6,6,12,0.45), rgba(6,6,12,0.35));
  background-color: #07070b; /* fallback */
}

/* ensure the embedded video fills the accent box */
.hero-accent video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
  /* keep pointer events off so the box remains clickable for other controls if needed */
  pointer-events: none;
  z-index: 0;
}

/* keep hover/focus highlight for the accent box to emphasize its border */
.hero-accent:hover,
.hero-accent:focus-within {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 26px 60px rgba(0,0,0,0.28);
  border-color: rgba(124,92,255,0.45);
  outline: 2px solid rgba(124,92,255,0.06);
}

.hero-accent::before {
  content: "";
  position: absolute;
  inset: 18px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  backdrop-filter: blur(6px);
  opacity: 0.9;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  animation: inner-pulse 3.8s ease-in-out infinite both;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 550;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0a0912;
  box-shadow: 0 14px 30px rgba(88, 70, 255, 0.6);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(88, 70, 255, 0.7);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(88, 70, 255, 0.55);
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-main);
  background: rgba(8, 8, 18, 0.7);
  box-shadow: var(--shadow-subtle);
}

.btn-outline:hover {
  background: rgba(18, 18, 35, 0.9);
  border-color: rgba(124, 92, 255, 0.8);
  transform: translateY(-1px);
}

.btn-outline:active {
  transform: translateY(0);
}

.btn-large {
  padding: 12px 26px;
  font-size: 1rem;
}

/* Cards */

.cards-grid {
  display: grid;
  gap: 12px;
}

.card {
  background: rgba(7, 7, 19, 0.96);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 14px 13px;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med),
    background var(--transition-med);
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0;
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.25), transparent 55%);
  transition: opacity var(--transition-med), transform var(--transition-med);
  transform: translate3d(-10px, 10px, 0);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  border-color: rgba(124, 92, 255, 0.6);
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.15), transparent 55%),
    rgba(7, 7, 19, 0.96);
}

.card:hover::before {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.card-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.card-text {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Portfolio */

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

.portfolio-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

/* NEW: make portfolio thumbnails visibly blurred and add a CTA overlay so users must click to open full preview */
.portfolio-image {
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  min-height: 220px; /* larger preview for better visualization */
  cursor: pointer; /* clickable preview */
  border: 1px solid rgba(255,255,255,0.03);
}

/* blur the embedded iframe thumbnail so the small view looks intentionally obfuscated */
.portfolio-image iframe {
  filter: blur(6px) contrast(0.95);
  transition: filter 240ms var(--transition-fast), transform 240ms var(--transition-fast), opacity 240ms var(--transition-fast);
  will-change: filter, transform, opacity;
}

/* overlay hint (semi-transparent) telling user to click/tap for larger preview */
.portfolio-image::after {
  content: "Tocar para ver";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  font-size: 0.95rem;
  color: var(--text-main);
  background: linear-gradient(90deg, rgba(10,10,20,0.72), rgba(20,18,40,0.5));
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 2;
  opacity: 0.98;
}

/* slightly darken the thumbnail on pointer hover to emphasize clickability */
.portfolio-image:active::after,
.portfolio-image:focus::after,
.portfolio-image:hover::after {
  transform: translate(-50%, -50%) scale(0.98);
}

/* keep thumbnail non-interactive even if the iframe would allow interactions */
.portfolio-image iframe,
.portfolio-image > iframe {
  pointer-events: none;
}

/* iframe preview inside portfolio image */
.portfolio-image iframe {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border: 0;
  display: block;
  border-radius: 12px;
  background: linear-gradient(180deg, #06060b, #0b0b14);
  transform-origin: center;
  /* slightly scaled down to indicate thumbnail */
  transform: scale(0.98);
  pointer-events: none; /* prevent interacting with small iframe */
  opacity: 0.98;
}

/* Modal preview styles */
.preview-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.preview-modal[aria-hidden="false"] {
  display: flex;
}

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

.preview-panel {
  position: relative;
  width: min(1200px, 98vw);
  height: min(820px, 92vh);
  border-radius: 10px;
  background: #05050a;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  z-index: 2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-close {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.preview-frame-wrap {
  flex: 1;
  display: block;
  background: #000;
}

.preview-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* small screens adjustments */
@media (max-width: 520px) {
  .preview-panel {
    width: 96vw;
    height: 92vh; /* más alto para mejor visión en teléfonos */
    border-radius: 8px;
  }

  .preview-close {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
  }
}

/* keep original placeholders accessible if needed */
.placeholder-1 { background-image: linear-gradient(135deg, #19c37d, #3b82f6); }
.placeholder-2 { background-image: linear-gradient(135deg, #f97316, #e11d48); }
.placeholder-3 { background-image: linear-gradient(135deg, #22c55e, #06b6d4); }

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Technologies */

.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(0, 0, 0, 0.7));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

/* Reasons / Why me */

.reasons-grid {
  display: grid;
  gap: 8px;
}

.reason {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(10, 10, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reason p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-main);
}

.reason-bullet {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #7c5cff 0, #4c5bff 45%, #0ea5e9 100%);
  box-shadow: 0 0 12px rgba(93, 101, 255, 0.8);
}

/* Final CTA */

.final-cta {
  padding: 20px 18px;
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.2), transparent 55%),
    linear-gradient(135deg, #191937, #080815);
}

.final-cta-inner {
  text-align: center;
}

.final-cta-title {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

/* Scroll / reveal animations */

.reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.99);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Responsive */

@media (max-width: 768px) {
  .page-wrapper {
    padding: 16px 12px 24px;
    gap: 14px;
  }

  .section {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero-accent {
    min-height: 120px;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .hero-subtitle {
    font-size: 0.94rem;
  }

  .hero-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .cards-grid {
    gap: 10px;
  }

  .portfolio-card {
    grid-template-columns: 1fr;
  }

  .portfolio-image {
    min-height: 220px; /* miniaturas más largas en móvil para mejor preview */
  }

  .final-cta-title {
    font-size: 1.1rem;
  }
}

@media (min-width: 769px) {
  .page-wrapper {
    padding-top: 24px;
    padding-bottom: 32px;
  }

  .section {
    padding: 24px 22px;
  }

  .section-header {
    margin-bottom: 20px;
  }

  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* keep portfolio as single column of cards but with a larger image area */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

/* tiny unmute button (mobile-friendly, non-intrusive) */
.audio-unmute {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: rgba(10,10,20,0.8);
  color: var(--text-main);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1400;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}
.audio-unmute:active { transform: translateY(1px); }
.audio-unmute[hidden] { display: none; }

/* New keyframes for floating and pulsing */
@keyframes float-accent {
  0% { transform: translateY(0) rotate(0deg); filter: drop-shadow(0 12px 28px rgba(76,91,255,0.06)); }
  30% { transform: translateY(-6px) rotate(-0.3deg); filter: drop-shadow(0 20px 40px rgba(76,91,255,0.08)); }
  60% { transform: translateY(-3px) rotate(0.2deg); filter: drop-shadow(0 16px 36px rgba(76,91,255,0.07)); }
  100% { transform: translateY(0) rotate(0deg); filter: drop-shadow(0 12px 28px rgba(76,91,255,0.06)); }
}

@keyframes inner-pulse {
  0% { box-shadow: 0 8px 22px rgba(124,92,255,0.04); opacity: 0.95; transform: scale(1); }
  50% { box-shadow: 0 18px 48px rgba(124,92,255,0.12); opacity: 1; transform: scale(1.01); }
  100% { box-shadow: 0 8px 22px rgba(124,92,255,0.04); opacity: 0.95; transform: scale(1); }
}