/* ============================================================
   VIRUCA.ES — Global CSS
   Victor Rubio · UX/UI Designer · viruca.es
   ============================================================ */

/* ── Fonts — Plus Jakarta Sans (display) + DM Sans (body) ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=DM+Sans:wght@300;400;500&family=JetBrains+Mono:wght@400&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Colors */
  --color-bg:         #080808;
  --color-surface:    #111111;
  --color-surface-2:  #1A1A1A;
  --color-accent:     #C8FF00;
  --color-accent-dim: #9FCC00;
  --color-white:      #FFFFFF;
  --color-gray-1:     #CCCCCC;
  --color-gray-2:     #888888;
  --color-gray-3:     #444444;
  --color-gray-4:     #2A2A2A;
  --color-border:     rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Font Sizes */
  --fs-hero:   clamp(48px, 8vw, 120px);
  --fs-h1:     clamp(34px, 5.5vw, 76px);
  --fs-h2:     clamp(26px, 3.8vw, 50px);
  --fs-h3:     clamp(18px, 2.2vw, 28px);
  --fs-h4:     clamp(15px, 1.6vw, 19px);
  --fs-body:   clamp(14px, 1.1vw, 16px);
  --fs-small:  13px;
  --fs-label:  11px;

  /* Spacing */
  --max-width:     1440px;
  --content-width: 1200px;
  --padding-x:     clamp(20px, 5vw, 80px);
  --gap:           clamp(16px, 2vw, 32px);
  --section-gap:   clamp(80px, 10vw, 140px);

  /* Borders */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   32px;
  --radius-full: 999px;

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:    0.2s;
  --dur-base:    0.4s;
  --dur-slow:    0.8s;

  /* Z-index layers */
  --z-video:   0;
  --z-base:    1;
  --z-above:   10;
  --z-nav:     100;
  --z-overlay: 200;
  --z-loader:  999;
  --z-cursor:  9999;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--color-bg);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

@media (pointer: coarse) { body { cursor: auto; } }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--color-gray-1);
}

/* ── Links — sin subrayado global ─────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

a:hover { text-decoration: none; }

img, video { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

button {
  cursor: none;
  border: none;
  background: none;
  font-family: var(--font-body);
}

@media (pointer: coarse) { button { cursor: pointer; } }

/* ── Label ────────────────────────────────────────────────── */
.v-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.v-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--color-accent);
}

/* ── Layout ───────────────────────────────────────────────── */
.v-container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--padding-x);
}

.v-container--wide { max-width: var(--max-width); }
.v-section { padding-block: var(--section-gap); }

/* ── Background Video ─────────────────────────────────────── */
.v-video-bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-video);
  overflow: hidden;
  pointer-events: none;
}

.v-video-bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
}

.v-video-bg__blur-layer,
.v-video-bg__overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Capa de blur delante del video: arriba casi nítido, abajo borroso */
.v-video-bg__blur-layer {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.12) 42%,
    rgba(0, 0, 0, 0.72) 68%,
    rgba(0, 0, 0, 1) 100%
  );
  mask-image: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.12) 42%,
    rgba(0, 0, 0, 0.72) 68%,
    rgba(0, 0, 0, 1) 100%
  );
}

.v-video-bg__blur-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(14px) saturate(0.85);
  transform: scale(1.08);
  opacity: 0.92;
}

/* Capa de overlay delante del video */
.v-video-bg__overlay-layer {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.18) 0%,
    rgba(0, 0, 0, 0.52) 36%,
    rgba(0, 0, 0, 0.82) 58%,
    rgba(0, 0, 0, 0.95) 100%
  );
}

/* Desktop: negro casi opaco ocupando los 2/3 inferiores */
@media (min-width: 1024px) {
  .v-video-bg__overlay-layer {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.14) 0%,
      rgba(0, 0, 0, 0.46) 28%,
      rgba(0, 0, 0, 0.80) 42%,
      rgba(0, 0, 0, 0.92) 56%,
      rgba(0, 0, 0, 0.95) 66%,
      rgba(0, 0, 0, 0.95) 100%
    );
  }
}

/* Asegura que todo el contenido esté por encima del vídeo */
#v-nav, #v-mobile-menu, main, #v-footer,
#v-cookie-banner, #v-loader, #v-cursor-outer, #v-cursor-inner,
#v-curtain, #v-progress {
  position: relative;
  z-index: var(--z-base);
}

#v-nav, #v-mobile-menu { z-index: var(--z-nav); }
#v-cookie-banner       { z-index: var(--z-overlay); }
#v-loader              { z-index: var(--z-loader); }
#v-cursor-outer,
#v-cursor-inner        { z-index: var(--z-cursor); }
#v-progress            { z-index: calc(var(--z-nav) + 1); }

/* ── Custom Cursor ────────────────────────────────────────── */
#v-cursor-outer,
#v-cursor-inner {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform;
}

#v-cursor-outer {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  transition: width 0.15s var(--ease-out),
              height 0.15s var(--ease-out),
              border-color 0.15s ease;
}

#v-cursor-inner {
  width: 6px;
  height: 6px;
  background: var(--color-white);
  transition: opacity 0.05s ease;
}

body.cursor-hover #v-cursor-outer {
  width: 60px;
  height: 60px;
  border-color: var(--color-accent);
}

body.cursor-hover #v-cursor-inner { opacity: 0; }
body.cursor-click #v-cursor-outer { transform: translate(-50%, -50%) scale(0.8); }

/* ── Navigation — siempre hamburguesa ────────────────────── */
#v-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: 20px var(--padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--dur-base) ease, padding var(--dur-base) ease;
}

#v-nav.nav--scrolled {
  padding-block: 14px;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

/* Logo imagen */
.v-nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.v-nav__logo img {
  height: 32px;
  width: auto;
  display: block;
  transition: opacity var(--dur-fast) ease;
}

.v-nav__logo:hover img { opacity: 0.75; }

/* Ocultar links de escritorio — menú siempre hamburguesa */
.v-nav__links,
.v-nav__cta { display: none !important; }

/* Hamburguesa — siempre visible */
.v-nav__hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
  cursor: none;
  z-index: calc(var(--z-nav) + 2);
  position: relative;
  background: none;
  border: none;
  flex-shrink: 0;
}

@media (pointer: coarse) { .v-nav__hamburger { cursor: pointer; } }

.v-nav__hamburger span {
  display: block;
  height: 1.5px;
  background: var(--color-white);
  transition: all var(--dur-base) var(--ease-out);
  transform-origin: left center;
}

/* X al abrir */
.v-nav__hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translateY(-1px);
}
.v-nav__hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.v-nav__hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(1px);
}

/* ── Mobile / Full-screen Menu ────────────────────────────── */
#v-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-nav) - 1);
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: var(--padding-x);
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) ease;
}

#v-mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.v-mobile-menu__link {
  font-family: var(--font-display);
  font-size: clamp(32px, 7vw, 60px);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: block;
  padding: 10px 0;
  text-decoration: none;
  transition: color var(--dur-fast) ease, transform var(--dur-base) var(--ease-out);
}

.v-mobile-menu__link:hover {
  color: var(--color-accent);
  transform: translateX(8px);
}

.v-mobile-menu__footer {
  position: absolute;
  bottom: 48px;
  left: var(--padding-x);
  right: var(--padding-x);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.v-mobile-menu__email {
  font-size: 13px;
  color: var(--color-gray-2);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.v-mobile-menu__email:hover { color: var(--color-accent); }

/* ── Buttons ──────────────────────────────────────────────── */
.v-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--dur-base) var(--ease-out);
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: none;
  text-decoration: none;
}

@media (pointer: coarse) { .v-btn { cursor: pointer; } }

.v-btn--primary {
  padding: 14px 28px;
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 700;
}

.v-btn--primary:hover {
  background: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 255, 0, 0.2);
}

.v-btn--outline {
  padding: 13px 27px;
  border: 1px solid var(--color-border);
  color: var(--color-white);
  background: transparent;
}

.v-btn--outline:hover {
  border-color: var(--color-white);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.v-btn__arrow {
  display: inline-flex;
  transition: transform var(--dur-fast) ease;
}

.v-btn:hover .v-btn__arrow { transform: translate(3px, -3px); }

/* ── Tags ─────────────────────────────────────────────────── */
.v-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-gray-2);
  font-family: var(--font-mono);
  background: var(--color-surface);
  white-space: nowrap;
}

/* ── Page Loader ──────────────────────────────────────────── */
#v-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#v-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.v-loader__logo-img {
  height: 44px;
  width: auto;
  display: block;
  opacity: 0.9;
}

.v-loader__bar {
  width: 180px;
  height: 1px;
  background: var(--color-gray-4);
  position: relative;
  overflow: hidden;
}

.v-loader__bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--color-accent);
  animation: loaderBar 1.2s var(--ease-out) forwards;
}

@keyframes loaderBar {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ── Page Transition Curtain ──────────────────────────────── */
#v-curtain {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-loader) - 1);
  background: var(--color-bg);
  transform: scaleY(0);
  transform-origin: bottom;
}

/* ── Scroll Progress ──────────────────────────────────────── */
#v-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.1s linear;
}

/* ── Footer ───────────────────────────────────────────────── */
#v-footer {
  border-top: 1px solid var(--color-border);
  padding: 60px var(--padding-x);
}

.v-footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap);
  max-width: var(--content-width);
  margin-inline: auto;
  align-items: start;
}

.v-footer__logo {
  display: block;
  margin-bottom: 14px;
  text-decoration: none;
}

.v-footer__logo img {
  height: 28px;
  width: auto;
}

.v-footer__brand p {
  font-size: 13px;
  color: var(--color-gray-3);
  line-height: 1.6;
}

.v-footer__nav-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-gray-3);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.v-footer__nav ul { display: flex; flex-direction: column; gap: 10px; }

.v-footer__nav a {
  font-size: 14px;
  color: var(--color-gray-2);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.v-footer__nav a:hover { color: var(--color-white); }

.v-footer__contact a {
  display: block;
  font-size: 14px;
  color: var(--color-gray-2);
  margin-bottom: 8px;
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.v-footer__contact a:hover { color: var(--color-accent); }

.v-footer__bottom {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.v-footer__bottom p { font-size: 12px; color: var(--color-gray-3); }
.v-footer__legal    { display: flex; gap: 24px; flex-wrap: wrap; }

.v-footer__legal a {
  font-size: 12px;
  color: var(--color-gray-3);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.v-footer__legal a:hover { color: var(--color-white); }

/* ── Reveal Animations ────────────────────────────────────── */
.v-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.v-reveal.visible         { opacity: 1; transform: translateY(0); }

.v-reveal-left            { opacity: 0; transform: translateX(-28px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.v-reveal-left.visible    { opacity: 1; transform: translateX(0); }

.v-reveal-right           { opacity: 0; transform: translateX(28px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.v-reveal-right.visible   { opacity: 1; transform: translateX(0); }

.v-reveal-scale           { opacity: 0; transform: scale(0.96); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.v-reveal-scale.visible   { opacity: 1; transform: scale(1); }

.v-delay-1 { transition-delay: 0.1s; }
.v-delay-2 { transition-delay: 0.2s; }
.v-delay-3 { transition-delay: 0.3s; }
.v-delay-4 { transition-delay: 0.4s; }
.v-delay-5 { transition-delay: 0.5s; }
.v-delay-6 { transition-delay: 0.6s; }

/* ── Image Reveal ─────────────────────────────────────────── */
.v-img-reveal { overflow: hidden; position: relative; }

.v-img-reveal img {
  transform: scale(1.08);
  transition: transform 1.2s var(--ease-out);
}

.v-img-reveal.visible img { transform: scale(1); }

.v-img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-bg);
  transform: scaleY(1);
  transform-origin: top;
  transition: transform 0.9s var(--ease-out);
  z-index: 1;
}

.v-img-reveal.visible::after { transform: scaleY(0); }

/* ── Marquee ──────────────────────────────────────────────── */
.v-marquee {
  overflow: hidden;
  white-space: nowrap;
  border-block: 1px solid var(--color-border);
  padding-block: 16px;
}

.v-marquee__track {
  display: inline-flex;
  gap: 60px;
  animation: marquee 22s linear infinite;
}

.v-marquee__track:hover { animation-play-state: paused; }

.v-marquee__item {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gray-3);
  display: flex;
  align-items: center;
  gap: 60px;
}

.v-marquee__item::after {
  content: '·';
  color: var(--color-accent);
  font-size: 20px;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Cookie Banner ────────────────────────────────────────── */
#v-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(130%);
  z-index: var(--z-overlay);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  max-width: 520px;
  width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.5s var(--ease-spring);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

#v-cookie-banner.show { transform: translateX(-50%) translateY(0); }

.v-cookie__text { font-size: 13px; color: var(--color-gray-1); line-height: 1.6; }
.v-cookie__text a { color: var(--color-accent); text-decoration: none; }
.v-cookie__text a:hover { text-decoration: underline; text-underline-offset: 2px; }
.v-cookie__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.v-cookie__accept {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-bg);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: background var(--dur-fast) ease;
}

.v-cookie__accept:hover { background: var(--color-white); }

.v-cookie__reject {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-gray-2);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  background: transparent;
  transition: all var(--dur-fast) ease;
}

.v-cookie__reject:hover { border-color: var(--color-gray-2); color: var(--color-white); }

/* ── Accessibility ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .v-marquee__track { animation: none; }
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection { background: var(--color-accent); color: var(--color-bg); }

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-gray-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gray-3); }

/* ── Responsive footer ────────────────────────────────────── */
@media (max-width: 768px) {
  .v-footer__grid     { grid-template-columns: 1fr; gap: 32px; }
  .v-footer__bottom   { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 576px) {
  :root { --padding-x: 20px; --section-gap: 64px; }
}
