/* =========================================================
   Tracker Bits — estilos personalizados
   Paleta: negro / azul eléctrico / blanco
   ========================================================= */

:root {
    --tb-bg:        #0A0E1A;
    --tb-bg-2:      #0E1428;
    --tb-card:      #111A2E;
    --tb-card-2:    #172441;
    --tb-border:    #1F2A44;
    --tb-blue:      #3B82F6;
    --tb-blue-2:    #60A5FA;
    --tb-blue-deep: #1D4ED8;
    --tb-text:      #E8EBF2;
    --tb-muted:     #8A93A8;
}

html { scroll-behavior: smooth; }

body {
    background: var(--tb-bg);
    color: var(--tb-text);
    overflow-x: hidden;
}

/* Selección con acento azul */
::selection { background: var(--tb-blue); color: white; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--tb-bg); }
::-webkit-scrollbar-thumb { background: var(--tb-card-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--tb-blue-deep); }

/* =========================================================
   NAVBAR
   ========================================================= */
#navbar.scrolled {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--tb-border);
}

/* =========================================================
   HERO Y FONDOS
   ========================================================= */
.hero-glow {
    background:
        radial-gradient(60% 60% at 80% 20%, rgba(59,130,246,0.18) 0%, transparent 60%),
        radial-gradient(50% 50% at 20% 80%, rgba(29,78,216,0.16) 0%, transparent 60%);
}

.bg-grid {
    background-image:
        linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
}

/* =========================================================
   TIPOGRAFÍA
   ========================================================= */
.text-gradient {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 50%, #1D4ED8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.kicker {
    display: inline-block;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tb-blue-2);
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 999px;
}

/* =========================================================
   BOTONES
   ========================================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--tb-blue) 0%, var(--tb-blue-deep) 100%);
    color: white;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 999px;
    transition: all 0.25s ease;
    box-shadow:
        0 8px 24px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 12px 32px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tb-text);
    font-weight: 500;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid var(--tb-border);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s ease;
}
.btn-ghost:hover {
    border-color: var(--tb-blue);
    background: rgba(59, 130, 246, 0.08);
}

/* =========================================================
   FOTOS Y FALLBACKS
   ========================================================= */
.photo-frame { position: relative; }
.photo-fallback-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(59,130,246,0.08), rgba(29,78,216,0.04)),
        radial-gradient(circle at 30% 20%, rgba(59,130,246,0.15), transparent 50%);
}
.photo-frame:not(.photo-fallback) .photo-fallback-content { display: none; }

/* =========================================================
   PILARES (Sobre mí)
   ========================================================= */
.pillar-card {
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}
.pillar-card:hover {
    border-color: var(--tb-blue);
    transform: translateY(-2px);
}
.pillar-icon { font-size: 24px; line-height: 1; }

/* =========================================================
   MÉTRICAS
   ========================================================= */
.metric-card {
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: block;
    color: inherit;
    text-decoration: none;
}
a.metric-card { cursor: pointer; }
a.metric-card:focus-visible {
    outline: 2px solid var(--tb-blue);
    outline-offset: 3px;
}
.metric-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.metric-arrow {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 18px;
    color: var(--tb-muted);
    opacity: 0.4;
    transition: all 0.3s ease;
    pointer-events: none;
    line-height: 1;
}
.metric-card:hover .metric-arrow {
    opacity: 1;
    color: var(--tb-blue-2);
    transform: translate(2px, -2px);
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tb-blue), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.metric-card:hover::before { opacity: 1; }

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 18px;
}
.metric-number {
    display: inline-block;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: white;
}
.metric-suffix {
    display: inline-block;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--tb-blue-2);
    margin-left: 2px;
}
.metric-label {
    margin-top: 8px;
    font-size: 14px;
    color: var(--tb-muted);
    font-weight: 500;
}

/* =========================================================
   SERVICIOS
   ========================================================= */
.service-card {
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.service-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}
.service-card h3 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-top: 16px;
    color: white;
}
.service-card p {
    color: var(--tb-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 8px;
}
.service-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(29,78,216,0.05));
    border: 1px solid rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tb-blue-2);
}
.service-card-wide {
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(29,78,216,0.05) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}
.service-card-wide h3 { font-size: 22px; }

/* =========================================================
   COLABORACIONES (LOGOS)
   ========================================================= */
.brand-card {
    aspect-ratio: 16/10;
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    color: var(--tb-muted);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    padding: 18px 16px;
    overflow: hidden;
}
.brand-card:hover {
    border-color: var(--tb-blue);
    color: white;
    transform: translateY(-2px);
}
.brand-logo {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
}
.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(20%) brightness(1.05);
    transition: filter 0.25s ease, transform 0.25s ease;
}
.brand-card:hover .brand-logo img {
    filter: grayscale(0%) brightness(1.1);
    transform: scale(1.04);
}
.brand-name {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tb-muted);
    transition: color 0.25s ease;
}
.brand-card:hover .brand-name {
    color: white;
}
.brand-card-empty {
    background: transparent;
    border-style: dashed;
    color: rgba(138, 147, 168, 0.6);
    font-style: italic;
}
.brand-card-empty:hover {
    color: var(--tb-blue-2);
    border-color: var(--tb-blue);
}

/* =========================================================
   CASOS DE USO
   ========================================================= */
.case-card {
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 20px;
    padding: 22px 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: all 0.3s ease;
}
.case-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateX(4px);
}
.case-num {
    flex-shrink: 0;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: transparent;
    background: linear-gradient(135deg, var(--tb-blue-2), var(--tb-blue-deep));
    -webkit-background-clip: text;
    background-clip: text;
    line-height: 1;
}
.case-card h3 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: white;
}
.case-card p {
    color: var(--tb-muted);
    font-size: 14px;
    margin-top: 4px;
    line-height: 1.6;
}

/* =========================================================
   SHOW
   ========================================================= */
.chip {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tb-blue-2);
}

.show-feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--tb-border);
    border-radius: 16px;
    padding: 18px;
}
.show-feature-num {
    font-size: 24px;
    line-height: 1;
}
.show-feature h4 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: white;
}
.show-feature p {
    color: var(--tb-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 4px;
}

/* =========================================================
   PORTFOLIO / VÍDEOS
   ========================================================= */
.video-card {
    transition: transform 0.3s ease;
}
.video-card:hover { transform: translateY(-3px); }

.video-embed {
    position: relative;
    aspect-ratio: 9/16;
    border-radius: 18px;
    overflow: hidden;
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
}
.video-embed iframe,
.video-embed video,
.video-embed blockquote {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background:
        linear-gradient(135deg, rgba(59,130,246,0.06), rgba(29,78,216,0.03)),
        repeating-linear-gradient(45deg, rgba(31,42,68,0.4) 0 12px, transparent 12px 24px);
}
.video-placeholder-label {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tb-blue-2);
}
.video-placeholder-hint {
    font-size: 12px;
    color: var(--tb-muted);
    text-align: center;
    padding: 0 16px;
}

.video-title {
    margin-top: 12px;
    font-size: 14px;
    color: var(--tb-muted);
}

/* =========================================================
   CONTACTO / REDES
   ========================================================= */
.social-card {
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 16px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    color: var(--tb-text);
}
.social-card:hover {
    border-color: var(--tb-blue);
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.06);
}
.social-card span {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    font-size: 15px;
}
.social-card small {
    color: var(--tb-muted);
    font-size: 12px;
}

/* =========================================================
   ANIMACIÓN REVEAL AL HACER SCROLL
   ========================================================= */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .btn-primary:hover, .btn-ghost:hover, .metric-card:hover, .service-card:hover,
    .brand-card:hover, .case-card:hover, .video-card:hover, .social-card:hover,
    .pillar-card:hover { transform: none; }
}

/* =========================================================
   PILLAR CARDS — botones que llevan a "Ejemplos"
   (sobreescribe el .pillar-card original cuando es <button>)
   ========================================================= */
button.pillar-card {
    color: var(--tb-text);
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    position: relative;
}
button.pillar-card:hover {
    background: rgba(59, 130, 246, 0.06);
}
.pillar-arrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--tb-muted);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease, color 0.3s ease;
}
button.pillar-card:hover .pillar-arrow,
button.pillar-card:focus-visible .pillar-arrow {
    opacity: 1;
    max-height: 24px;
    color: var(--tb-blue-2);
}

/* =========================================================
   EJEMPLOS — TABS Y PANELS
   ========================================================= */
.example-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin: 48px auto 36px;
    padding: 6px;
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
}

.example-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--tb-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.example-tab:hover { color: var(--tb-text); }
.example-tab.active {
    background: linear-gradient(135deg, var(--tb-blue), var(--tb-blue-deep));
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}
.example-tab-icon { font-size: 16px; line-height: 1; }

.example-panel { animation: panelFade 0.45s ease; }
.example-panel.hidden { display: none; }

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

.example-video-card { transition: transform 0.3s ease; }
.example-video-card:hover { transform: translateY(-2px); }

/* Variantes de aspect-ratio para distintos contenidos */
.video-embed--horizontal { aspect-ratio: 16/9; }
.video-embed--ig         { aspect-ratio: 9/14; background: #FAFAFA; }
.video-embed--ig iframe  { background: #FAFAFA; }

/* =========================================================
   IG HIGHLIGHT FALLBACK CARD (no embebible)
   ========================================================= */
.ig-highlight-card {
    position: relative;
    aspect-ratio: 9/14;
    border-radius: 18px;
    overflow: hidden;
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--tb-text);
}
.ig-highlight-card:hover {
    border-color: var(--tb-blue);
    transform: translateY(-2px);
}
.ig-highlight-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(225,48,108,0.20), rgba(247,119,55,0.10) 40%, rgba(59,130,246,0.05) 100%),
        radial-gradient(circle at 30% 20%, rgba(247,119,55,0.25), transparent 55%);
}
.ig-highlight-content {
    position: relative;
    text-align: center;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.ig-highlight-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E1306C, #F77737);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 12px 32px rgba(225, 48, 108, 0.35);
}
.ig-highlight-label {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: white;
    line-height: 1.4;
}
.ig-highlight-cta {
    font-size: 13px;
    font-weight: 500;
    color: var(--tb-blue-2);
}

/* =========================================================
   MEDIOS — TARJETAS
   ========================================================= */
.media-card {
    background: var(--tb-card);
    border: 1px solid var(--tb-border);
    border-radius: 20px;
    padding: 28px;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    color: var(--tb-text);
    font-family: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.media-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.media-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tb-blue), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.media-card:hover::before { opacity: 1; }

.media-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(29,78,216,0.06));
    border: 1px solid rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tb-blue-2);
}
.media-card-type {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tb-blue-2);
}
.media-card-title {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: white;
    line-height: 1.2;
    margin: 0;
}
.media-card-desc {
    color: var(--tb-muted);
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    margin: 0;
}
.media-card-cta {
    color: var(--tb-blue-2);
    font-weight: 600;
    font-size: 14px;
    margin-top: 4px;
    transition: transform 0.25s ease;
    display: inline-block;
}
.media-card:hover .media-card-cta {
    transform: translateX(2px);
}

/* =========================================================
   MODAL DE VÍDEO
   ========================================================= */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.video-modal.hidden { display: none; }

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 18, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

.video-modal-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.video-modal-close:hover {
    background: rgba(255,255,255,0.18);
    transform: rotate(90deg);
}

.video-modal-frame {
    aspect-ratio: 16/9;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--tb-border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.video-modal-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .video-modal-close { top: -40px; right: 4px; }
}

/* =========================================================
   RESPONSIVE FINE-TUNING
   ========================================================= */
@media (max-width: 640px) {
    .metric-number { font-size: 36px; }
    .metric-suffix { font-size: 24px; }
    .case-card { padding: 18px; gap: 14px; }
    .case-num { font-size: 26px; }
}
