/* =========================================================
   05 — SECTIONS
   - Hero
   - Tabs
   - Showcase (Video)
   - Workflow
   - Work
   - Stats
========================================================= */

/* =========================================================
   NAVBAR SYSTEM — SCROLL BEHAVIOR
========================================================= */

:root{
  --nav-height: 72px;
}

/* ===== NAVBAR BASE (TOP) ===== */

.nav{
  height: var(--nav-height);

  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

/* ===== NAVBAR ON SCROLL ===== */

.nav.is-scrolled{
  background: rgba(10,14,24,.75);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
/* =====================================================
   HERO (legacy)
===================================================== */
.hero{ padding-top: 64px; }

.hero__grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
  align-items:stretch;
}

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

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius:999px;
  background: rgba(255,255,255,.04);
  color: rgba(233,236,242,.78);
  margin:0 0 14px 0;
}

.hero__title{
  margin:0 0 12px 0;
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing:-.03em;
  line-height:1.02;
}

.hero__sub{
  margin:0 0 18px 0;
  max-width: 60ch;
  color: rgba(233,236,242,.70);
}

/* =====================================================
   HERO v2
===================================================== */
.hero2{
  padding-top: 64px;
  padding-bottom: 86px;
  position: relative;
}

.hero2::before{
  content:"";
  position:absolute;
  inset:-160px -80px -120px -80px;
  background:
    radial-gradient(1100px 560px at 18% 42%, rgba(58,123,255,.28), transparent 60%),
    radial-gradient(900px 560px at 70% 35%, rgba(179,139,255,.22), transparent 60%),
    radial-gradient(800px 520px at 55% 90%, rgba(125,249,255,.12), transparent 60%);
  pointer-events:none;
  z-index:-1;
}

.hero2__wrap{ display:grid; gap:22px; }

.hero2__top{
  text-align:center;
  display:grid;
  gap:10px;
  justify-items:center;
}

.hero2__title{
  margin:0;
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing:-.035em;
  line-height:1.03;
}

.hero2__sub{
  margin:0;
  color: rgba(233,236,242,.72);
  max-width:70ch;
}
/* =====================================================
   HERO X — PSYCHOLOGY + CONVERSION
===================================================== */

.heroX{
  padding-top: calc(var(--nav-height) + 4px);
  padding-bottom: 110px;
  position: relative;
}
/* ===== HEADLINE ===== */

.heroX__head{
  text-align:center;
  max-width: 900px;
  margin: 0 auto 36px;
}

.heroX__head h1{
  font-size: clamp(40px, 5vw, 72px);
  letter-spacing: -.04em;
  line-height: 1.02;
  margin:0;
}

.heroX__head h1 span{
  background: linear-gradient(90deg, #7df9ff, #b38bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.heroX__head p{
  margin:18px auto 0;
  font-size: 18px;
  color: rgba(233,236,242,.70);
  max-width: 60ch;
}

/* ===== PANEL ===== */

.heroX__panel{
  width: min(1100px, 100%);
  margin: 0 auto;

  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.08);

  background:
    radial-gradient(900px 400px at 20% 10%, rgba(125,249,255,.12), transparent 60%),
    radial-gradient(900px 400px at 80% 90%, rgba(179,139,255,.10), transparent 60%),
    rgba(10,14,24,.92);   /* 👈 ligeramente más sólido */

  backdrop-filter: blur(6px);  /* 👈 antes 20px 💀 */

  padding: 18px;

  box-shadow: 0 20px 60px rgba(0,0,0,.45);  /* 👈 sombra más barata */
}

/* ===== TABS ===== */

.heroX__tabs{
  display:flex;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  margin-bottom: 16px;
}

.heroX__tab{
  flex:1;
  height: 46px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: rgba(233,236,242,.60);
  font-weight: 600;
  cursor:pointer;
  transition:.25s ease;
}

.heroX__tab:hover{
  color: white;
  background: rgba(255,255,255,.06);
}

.heroX__tab.is-active{
  background: white;
  color: black;
}

/* ===== VIDEO ===== */

.heroX__videoWrap{
  position:relative;
  border-radius: 18px;
  overflow:hidden;
  background:#000;
}

.heroX__video{
  width:100%;
  height:100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ===== CONTROLS ===== */

.heroX__controls{
  position:absolute;
  left: 16px;
  bottom: 16px;
  display:flex;
  gap:10px;
}

.heroX__controls button{
  border:0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,.55);
  color:white;
  font-weight:600;
  cursor:pointer;
}

/* ===== BAR ===== */

.heroX__bar{
  width: min(1100px, 100%);
  margin: 18px auto 0;

  display:flex;
  justify-content:space-between;
  align-items:center;
}
/* ===== TAB TRANSITIONS ===== */

.heroX__videoWrap{
  position: relative;
  overflow: hidden;
}

/* capa animable */
.heroX__video{
  transition:
    opacity .55s ease,
    transform .7s cubic-bezier(.2,.6,.2,1),
    filter .6s ease;
}

/* estado saliente */
.heroX__video{
  transition:
    opacity .55s ease,
    transform .7s cubic-bezier(.2,.6,.2,1);
}

/* ===== TITLE ANIMATION ===== */

#tabTitle{
  transition:
    opacity .35s ease,
    transform .45s cubic-bezier(.2,.6,.2,1);
}

#tabTitle.is-changing{
  opacity: 0;
  transform: translateY(6px);
}

/* ===== TAB ACTIVE POLISH ===== */

.heroX__tab{
  position: relative;
  overflow: hidden;
}

.heroX__tab::after{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(circle at center, rgba(255,255,255,.35), transparent 65%);
  opacity:0;
  transition:.4s ease;
}

.heroX__tab.is-active::after{
  opacity:.25;
}
/* =====================================================
   VIDEO SHOWCASE
===================================================== */
.showcase{
  width: min(980px, 100%);
  margin: 10px auto 0;
  display:grid;
  gap: 14px;
}

.showcase__frame{
  position:relative;
  border-radius: 22px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(900px 400px at 20% 20%, rgba(125,249,255,.10), transparent 60%),
    radial-gradient(900px 420px at 80% 80%, rgba(179,139,255,.10), transparent 55%),
    rgba(255,255,255,.03);
  box-shadow: 0 34px 90px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  transform: translateZ(0);
}

/* default hero ratio (wide) */
.showcase__frame:not(.yt){
  aspect-ratio: 16 / 7;
}

/* YouTube-like ratio */
.showcase__frame.yt{
  aspect-ratio: 16 / 9;
  background:#000;
  border: 1px solid rgba(255,255,255,.10);
}

.showcase__video{
  width:100%;
  height:100%;
  display:block;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
  transform: scale(1.01);
}

/* overlays no bloquean clicks */
.showcase__overlay,
.showcase__shine{
  pointer-events:none;
}

/* Controls overlay */
.showcase__controls{
  position:absolute;
  left: 14px;
  bottom: 14px;
  z-index: 30;
  display:flex;
  gap: 10px;
}

.ctrl{
  appearance:none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.92);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: .2s ease;
}
.ctrl:hover{
  background: rgba(0,0,0,.60);
  border-color: rgba(255,255,255,.28);
}

/* tag */
.showcase__tag{
  position:absolute;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color: rgba(233,236,242,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.showcase__meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

@media (max-width: 720px){
  .showcase__meta{ flex-direction:column; align-items:flex-start; }
}

/* =====================================================
   SERVICES GRID
===================================================== */

.servicesGrid{
  gap: 26px;
}

.service{
  padding: 8px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.service img{
  width: 100%;
  height: 240px;    /* 👈 DULCE PERFECTO */
  object-fit: cover;
  border-radius: 16px;
}

.service h3{
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: -.02em;
}

.service ul{
  margin: 6px 0 4px;
  padding: 0;
  list-style:none;
  display:grid;
  gap: 6px;
}

.service li{
  font-size: 14px;
  color: rgba(233,236,242,.75);
}

.service .btn{
  margin-top: auto;   /* 👈 Botón siempre alineado abajo */
}
/* =====================================================
   WORK
===================================================== */
.work{
  display:flex;
  flex-direction:column;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.work:hover{
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.05);
}

.work__img{
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.12);
  height: 220px;
}

.work__img img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* =====================================================
   STATS
===================================================== */
.stat__n{
  font-size: clamp(34px, 4vw, 54px);
  margin: 0 0 6px 0;
  letter-spacing: -0.03em;
}

/* === FORCE VIDEO CONTROLS VISIBLE === */
.showcase__frame{
  position: relative;
}

.showcase__controls{
  position: absolute !important;
  left: 18px !important;
  bottom: 18px !important;
  z-index: 9999 !important;
  display: flex !important;
  gap: 10px !important;
  pointer-events: auto !important;
}

/* El video nunca debe quedar encima */
.showcase__video{
  position: relative;
  z-index: 1;
}

/* Botones encima */
.ctrl{
  position: relative;
  z-index: 9999 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
}

/* Por si hay overlays: que no bloqueen clic */
.showcase__overlay,
.showcase__shine{
  pointer-events: none !important;
  z-index: 2;
}

/* Controles arriba de todo */
.showcase__controls{
  z-index: 9999 !important;
}
/* ===== VIDEO CONTROLS (BOTTOM-LEFT) ===== */
.showcase__frame{ position: relative; }

.showcase__controls{
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.ctrl{
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.95);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.ctrl:hover{
  background: rgba(0,0,0,.72);
  border-color: rgba(255,255,255,.28);
}

/* IMPORTANT: overlays no bloquean clicks */
.showcase__overlay,
.showcase__shine{
  pointer-events: none;
}

/* bajo el video  */
.heroX__sequence{
  position: relative;
  height: 180px;

  display:flex;
  align-items:center;
  justify-content:center;

  text-align:center;

  margin-top: 40px;
}

/* Frases */
.heroX__sequenceLine{
  position:absolute;
  left:0;
  right:0;

font-size: clamp(40px, 3.2vw, 72px);
font-weight: 500;
letter-spacing: -0.04em;

  opacity:0;
  transform: translateY(14px);

  transition:
    opacity .7s ease,
    transform 1s cubic-bezier(.2,.6,.2,1);
}

.heroX__sequenceLine.is-visible{
  opacity:1;
  transform: translateY(0);
}

/* Frase final */
.heroX__sequenceLine--final{
  font-weight:600;
}


/* =========================================================
   WORKFLOW GRID — CLEAN / BALANCED / PREMIUM
========================================================= */

.workflowGrid{
  width: min(1100px, 100%);
  margin: 28px auto 10px;   /* 👈 reduce espacio vertical */

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;                /* 👈 separación más elegante */
}

/* Responsive */
@media (max-width: 900px){
  .workflowGrid{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   WORKFLOW CARDS — CONTROLLED SIZE
========================================================= */

.workflowGrid .card{

  /* 👇 TAMAÑO REAL DEL PROBLEMA */
  height: 260px;            /* 👈 FIX tamaño gigante */
  padding: 16px;

  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);

  background:
    radial-gradient(120% 140% at 0% 0%, rgba(125,249,255,.06), transparent 40%),
    radial-gradient(120% 140% at 100% 100%, rgba(179,139,255,.06), transparent 45%),
    rgba(10,14,24,.55);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  position: relative;
  overflow: hidden;

  transition:
    transform .45s cubic-bezier(.2,.6,.2,1),
    border-color .25s ease,
    background .25s ease;
}

/* Hover */
.workflowGrid .card:hover{
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(255,255,255,.22);
}

/* =========================================================
   IMAGE CONTROL (clave para tamaño visual)
========================================================= */

.workflowGrid .card img{
  width: 100%;
  height: 140px;         /* 👈 FIX crítico */
  object-fit: cover;

  border-radius: 16px;

  transition:
    transform .6s cubic-bezier(.2,.6,.2,1),
    filter .35s ease;
}

.workflowGrid .card:hover img{
  transform: scale(1.05);
  filter: saturate(1.1) contrast(1.05);
}

/* =========================================================
   TYPOGRAPHY — BALANCED
========================================================= */

.workflowGrid h3{
  margin: 14px 0 6px;
  font-size: 18px;
  letter-spacing: -.02em;
}

.workflowGrid p{
  margin: 0;
  font-size: 13.5px;
  color: rgba(233,236,242,.60);
  line-height: 1.4;
}

/* =========================================================
   STEP NUMBER — REFINED
========================================================= */

.card__n{
  position: absolute;
  top: 14px;
  left: 14px;

  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;

  color: rgba(255,255,255,.45);
}

/* =========================================================
   SPACING FIX — evita que Selected Work "salte"
========================================================= */

.heroX__sequence{
  margin-bottom: 18px;     /* 👈 CONTROL DEL ESPACIO */
}

/* Este es el fix del "Selected Work demasiado abajo" */
#work.section{
  padding-top: 70px;       /* 👈 antes estaba exagerado */
}
