/* =========================================================
   Desierto Creativo — Design tokens
   ========================================================= */
:root {
  --bg: #0a0a0a;
  --bg-alt: #111111;
  --ink: #f5f3ee;
  --ink-dim: #a9a49b;
  --teal: #3f8288;
  --maroon: #8c2a34;
  --line: rgba(245, 243, 238, 0.12);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-caps: 'Jost', sans-serif;
  --font-body: 'Inter', sans-serif;

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* subtle film-grain texture over everything */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(10,10,10,0.92), rgba(10,10,10,0));
  transition: background 0.3s ease;
}

.header-inner {
  width: 100%;
  padding: 6px 32px 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0;
  padding-left: 0;
}

.brand-logo {
  height: 200px;
  width: auto;
  display: block;
}
@media (max-width: 780px) {
  .brand-logo { height: 140px; }
}
@media (max-width: 480px) {
  .brand-logo { height: 100px; }
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 36px;
  font-family: var(--font-caps);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-desktop a {
  opacity: 0.85;
  transition: opacity 0.2s ease;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav-desktop a:hover { opacity: 1; border-color: var(--teal); }

.nav-cta {
  border: 1px solid var(--line) !important;
  padding: 8px 18px !important;
  border-radius: 2px;
}
.nav-cta:hover { border-color: var(--teal) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 1px;
  background: var(--ink);
  display: block;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0 24px 24px;
  gap: 18px;
  font-family: var(--font-caps);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 14px;
}
.nav-mobile.open { display: flex; }

@media (max-width: 780px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 260px 24px 80px;
  overflow: hidden;
  background-image: url('assets/hero-bg.jpg');
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(10,10,10,0.85) 0%,
    rgba(10,10,10,0.70) 40%,
    rgba(10,10,10,0.30) 70%,
    rgba(10,10,10,0.15) 100%
  );
  z-index: 0;
}

/* =========================================================
   Hero — contenido
   ========================================================= */

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.eyebrow {
  font-family: var(--font-caps);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--ink-dim);
  margin: 0 0 28px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.08;
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}
.hero-title em {
  font-style: italic;
  color: var(--teal);
}

.hero-lede {
  font-size: 18px;
  color: var(--ink-dim);
  max-width: 480px;
  margin: 0 0 40px;
  font-weight: 300;
}

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

.btn {
  font-family: var(--font-caps);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px 30px;
  border-radius: 2px;
  transition: all 0.25s ease;
  display: inline-block;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--teal);
  color: var(--ink);
}
.btn-ghost {
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--maroon);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  z-index: 2;
}
.scroll-cue span {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--teal), transparent);
  display: block;
}

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding: 120px 24px;
}
.section-alt {
  background: var(--bg-alt);
}
.section-inner {
  max-width: var(--container);
  margin: 0 auto;
}
.section-inner.narrow {
  max-width: 720px;
}

.kicker {
  font-family: var(--font-caps);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--teal);
  margin: 0 0 18px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 1.2;
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}

.body-text {
  font-size: 17px;
  color: var(--ink-dim);
  max-width: 640px;
  margin: 0 0 22px;
  font-weight: 300;
}
.body-text.emphasis {
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
}
.section-intro { margin-bottom: 56px; }

/* =========================================================
   Hero — efectos animados
   ========================================================= */

/* Canvas de partículas */
.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Destellos de luz */
.hero-glows {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: glowPulse var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
}
.glow-1 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(63,130,136,0.35), transparent 70%);
  top: 10%; right: 25%;
  --dur: 5s; --delay: 0s;
}
.glow-2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201,168,76,0.28), transparent 70%);
  top: 30%; right: 8%;
  --dur: 4s; --delay: 1.8s;
}
.glow-3 {
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(63,130,136,0.22), transparent 70%);
  bottom: 20%; right: 35%;
  --dur: 6s; --delay: 3s;
}
@keyframes glowPulse {
  0%   { opacity: 0;    transform: scale(0.85); }
  40%  { opacity: 1;    transform: scale(1.05); }
  70%  { opacity: 0.6;  transform: scale(1);    }
  100% { opacity: 0;    transform: scale(0.85); }
}

/* Canvas de líneas de contorno */
.hero-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Lámpara parpadeante */
.lamp-flicker {
  position: absolute;
  /* Posición aproximada de la lámpara de escritorio en la imagen */
  bottom: 38%;
  right: 52%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,210,120,0.95) 0%, rgba(255,160,40,0.6) 40%, transparent 75%);
  filter: blur(6px);
  z-index: 2;
  pointer-events: none;
  animation: lampFlicker 3s ease-in-out infinite;
}
@keyframes lampFlicker {
  0%   { opacity: 0.9;  transform: scale(1);    filter: blur(6px); }
  8%   { opacity: 0.3;  transform: scale(0.7);  filter: blur(3px); }
  10%  { opacity: 0.85; transform: scale(0.95); filter: blur(5px); }
  12%  { opacity: 0.2;  transform: scale(0.6);  filter: blur(2px); }
  14%  { opacity: 0.9;  transform: scale(1);    filter: blur(6px); }
  50%  { opacity: 0.85; transform: scale(0.98); filter: blur(6px); }
  52%  { opacity: 0.4;  transform: scale(0.75); filter: blur(4px); }
  54%  { opacity: 0.9;  transform: scale(1);    filter: blur(6px); }
  100% { opacity: 0.9;  transform: scale(1);    filter: blur(6px); }
}

/* =========================================================
   Hero — fin efectos animados
   ========================================================= */
/* =========================================================
   Sección Nosotros — fondo imagen difuminada
   ========================================================= */
.section#nosotros {
  position: relative;
  overflow: hidden;
}
.section#nosotros::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('assets/bg-nosotros.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.12;
  filter: blur(3px) saturate(0.7);
  transform: scale(1.05);
  z-index: 0;
}
.section#nosotros::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 25%,
    rgba(10,10,10,0.55) 65%,
    rgba(10,10,10,0.97) 100%
  );
  z-index: 0;
}
.section#nosotros .section-inner {
  position: relative;
  z-index: 1;
}

/* =========================================================
   Reveal on scroll
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* si JavaScript está deshabilitado, mostrar todo el contenido sin animación */
.no-js .reveal { opacity: 1; transform: none; }

/* =========================================================
   Sección Servicios — fondo imagen del estudio
   ========================================================= */
.section#servicios {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
}
.section#servicios::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('assets/bg-servicios.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.14;
  filter: blur(1px) saturate(0.8);
  transform: scale(1.04);
  z-index: 0;
}
/* Difuminado en los 4 bordes con degradados hacia el fondo */
.section#servicios::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(17,17,17,0.98) 0%,
      rgba(17,17,17,0.3) 15%,
      transparent 35%,
      transparent 65%,
      rgba(17,17,17,0.3) 85%,
      rgba(17,17,17,0.98) 100%
    ),
    linear-gradient(to right,
      rgba(17,17,17,0.95) 0%,
      rgba(17,17,17,0.2) 12%,
      transparent 30%,
      transparent 70%,
      rgba(17,17,17,0.2) 88%,
      rgba(17,17,17,0.95) 100%
    );
  z-index: 0;
}
.section#servicios .section-inner {
  position: relative;
  z-index: 1;
}


   ========================================================= */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 44px 56px;
}
@media (max-width: 700px) {
  .service-grid { grid-template-columns: 1fr; }
}

.service-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.service-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 6px;
  border-radius: 50%;
  border: 1px solid var(--teal);
  position: relative;
}
.service-mark::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  background: var(--maroon);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.service-item h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 8px;
}
.service-item p {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 0;
  font-weight: 300;
}

/* =========================================================
   Portafolio
   ========================================================= */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
@media (max-width: 900px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}

.portfolio-card {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 340px;
  background: var(--bg-alt);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 22px;
}
.portfolio-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  transition: opacity 0.4s ease, transform 0.5s ease;
}
.portfolio-card:hover img {
  opacity: 0.85;
  transform: scale(1.04);
}
.portfolio-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.9), transparent 60%);
}
.portfolio-meta {
  position: relative;
  z-index: 1;
}
.portfolio-cat {
  font-family: var(--font-caps);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: #ffffff;
  display: block;
  margin-bottom: 6px;
  text-shadow:
    0 0 8px rgba(63,130,136,0.9),
    0 1px 3px rgba(0,0,0,0.9);
}
/* Tarjeta como enlace */
a.portfolio-card {
  display: flex;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.portfolio-card::after {
  content: "↗";
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 13px;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  background: rgba(0,0,0,0.5);
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--font-caps);
  letter-spacing: 0.08em;
}
a.portfolio-card:hover::after {
  opacity: 1;
}
.portfolio-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
}
.portfolio-card.placeholder .portfolio-cat { color: var(--ink-dim); }
.portfolio-card.placeholder .portfolio-name { color: var(--ink-dim); font-style: normal; }

/* =========================================================
   Contacto
   ========================================================= */
.contact-links {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
}
.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.25s ease;
}
.contact-links a:last-child { border-bottom: 1px solid var(--line); }
.contact-link:hover { padding-left: 10px; color: var(--teal); }

.contact-label {
  font-family: var(--font-caps);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--ink-dim);
}
.contact-value {
  font-family: var(--font-display);
  font-size: 20px;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  padding: 56px 24px 40px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer-logo {
  height: 40px;
  margin: 0 auto 20px;
  opacity: 0.85;
}
.footer-social {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 20px;
  font-family: var(--font-caps);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-social a {
  color: var(--ink-dim);
  transition: color 0.2s ease;
}
.footer-social a:hover {
  color: var(--teal);
}
.site-footer p {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin: 0 0 4px;
}
.footer-credit {
  margin-bottom: 6px !important;
}
.footer-credit a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-credit a:hover {
  color: var(--ink);
}

/* =========================================================
   RESPONSIVE — Ajustes móvil completos
   ========================================================= */

/* Tablet y móvil grande */
@media (max-width: 768px) {
  /* Hero: reducir padding top por el logo */
  .hero {
    padding: 200px 20px 60px;
    /* En móvil centramos en el equipo (zona derecha-centro de la imagen) */
    background-position: 65% center;
  }
  /* En móvil el overlay oscurece más para legibilidad del texto */
  .hero::after {
    background: linear-gradient(
      to bottom,
      rgba(10,10,10,0.75) 0%,
      rgba(10,10,10,0.45) 40%,
      rgba(10,10,10,0.55) 70%,
      rgba(10,10,10,0.85) 100%
    );
  }
  .hero-lede { font-size: 16px; }

  /* Secciones: menos padding */
  .section { padding: 80px 20px; }

  /* Sección nosotros: imagen de fondo centrada en móvil */
  .section#nosotros::before {
    background-position: center center;
    opacity: 0.10;
  }

  /* Servicios: imagen centrada */
  .section#servicios::before {
    background-position: center center;
    opacity: 0.12;
  }

  /* Contacto */
  .contact-value { font-size: 16px; }
  .contact-link {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    padding: 16px 0;
  }
  .contact-link:hover { padding-left: 6px; }

  /* Footer */
  .footer-social { gap: 18px; }
}

/* Móvil pequeño */
@media (max-width: 480px) {
  /* Logo: asegurar que no desborde */
  .brand-logo {
    height: 80px;
    max-width: 280px;
  }

  /* Hero */
  .hero {
    padding: 170px 16px 50px;
    min-height: 100svh;
    /* En móvil pequeño centramos exactamente en el monitor+cámara */
    background-position: 68% 40%;
    background-size: 180%; /* zoom para que el equipo llene más la pantalla */
  }
  /* Overlay más claro abajo para ver el equipo, más oscuro arriba para el texto */
  .hero::after {
    background:
      linear-gradient(
        to bottom,
        rgba(10,10,10,0.88) 0%,
        rgba(10,10,10,0.60) 30%,
        rgba(10,10,10,0.35) 55%,
        rgba(10,10,10,0.65) 85%,
        rgba(10,10,10,0.90) 100%
      );
  }
  .hero-title { font-size: clamp(2rem, 9vw, 2.8rem); }
  .hero-lede { font-size: 15px; max-width: 100%; }
  .hero-actions { flex-direction: column; gap: 12px; }
  .btn { text-align: center; width: 100%; max-width: 280px; }

  /* Secciones */
  .section { padding: 64px 16px; }
  .section-title { font-size: clamp(1.6rem, 7vw, 2rem); }
  .body-text { font-size: 15px; }
  .body-text.emphasis { font-size: 17px; }

  /* Servicios: grid de 1 columna ya definido, solo ajustar gap */
  .service-grid { gap: 28px 0; }
  .service-item { padding-top: 20px; }
  .service-item h3 { font-size: 18px; }

  /* Portafolio: 1 columna en móvil */
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-card { aspect-ratio: 16 / 9; min-height: 200px; }

  /* Nosotros fondo invisible en móvil muy pequeño para performance */
  .section#nosotros::before { opacity: 0.08; }

  /* Footer */
  .footer-social {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .footer-logo { height: 32px; }
}

/* Asegurar que partículas no desborden en móvil */
@media (max-width: 600px) {
  .hero-glows { display: none; }
  .lamp-flicker { display: none; }
}

/* =========================================================
   Tarjeta Podcast — efectos animados
   ========================================================= */
.portfolio-animated {
  overflow: hidden;
}
.portfolio-animated img {
  opacity: 0.82;
  transition: opacity 0.4s ease, transform 0.5s ease;
}
.portfolio-animated:hover img {
  opacity: 1;
  transform: scale(1.03);
}

/* Canvas de efectos */
.pod-effects {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.pod-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Indicador REC */
.pod-rec {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 4px 10px 4px 8px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
}
.pod-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e03030;
  box-shadow: 0 0 6px rgba(220,40,40,0.8);
  animation: recBlink 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes recBlink {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px rgba(220,40,40,0.8); }
  50%       { opacity: 0.2; box-shadow: 0 0 2px rgba(220,40,40,0.2); }
}

/* Asegurar que el meta quede sobre el canvas */
.portfolio-animated .portfolio-meta {
  position: relative;
  z-index: 2;
}

/* =========================================================
   Efectos canvas — Video promocional y Comercial
   ========================================================= */
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
