/* =========================================================
   BrainBroth Studio – styles.css (FULL)
   - Incluye HOME + subpáginas + modal
   - Subpáginas aisladas con clases bb- / subpage-*
   - No toca index.html (solo CSS)
========================================================= */

/* ========== Variables ========== */
:root {
  --bg: #000;
  --accent: #ff5cce;
  --green: #00ff40;
  --text: #fff;
  --muted: #b3b3b3;
  --border: #222;
  --max-width: 1120px;
}

/* ========== Reset ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ========== Layout Helpers ========== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: auto;
  padding-left: 2%;
  padding-right: 2%;
}

/* ========== Header / Nav ========== */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  height: 72px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  text-decoration: none !important;
}

/* Blindaje: el logo NO puede crecer aunque exista img{width:100%} en algún lado */
header .logo-img{
  height: 32px !important;
  width: auto !important;
  max-height: 32px !important;
  max-width: 32px !important;
  object-fit: contain !important;
  display: block;
  flex-shrink: 0;
}

.logo-text{
  display:flex;
  align-items:baseline;
  gap:.6rem;
}

.logo-name{
  font-weight:700;
  letter-spacing:0.08em;
}

.logo-tagline{
  font-weight:300;
  opacity:.7;
  letter-spacing:0.06em;
  font-size:.95rem;
}

/* Nav links */
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  transition: color 0.18s ease;
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  height: 32px;
  text-decoration: none;
}

/* Underline base (oculta) */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}

/* Hover underline */
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }

/* Active por scroll */
.nav-links a.active { color: #fff; }
.nav-links a.active::after { width: 100%; }

/* CTA contacto (sin underline rosa nunca) */
.nav-links a.nav-cta::after {
  display: none !important;
  width: 0 !important;
}

/* Botón contacto (header) */
.nav-cta {
  padding: 0 2rem;
  background: #fff;
  color: #000 !important;
  border-radius: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
}

.nav-cta:hover {
  background: var(--green);
  color: #000 !important;
  transition: background .2s ease;
}

/* Toggle mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

/* ========== Hero (Home) ========== */
.hero-full {
  position: relative;
  height: calc(100vh - 72px);
  width: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-video-wrapper {
  max-width: 60vw;
  max-height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Textos de esquina */
.hero-corner {
  position: absolute;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-bottom-left { bottom: 2rem; left: 2rem; }

/* ========== Secciones (Home) ========== */
section { padding: 5rem 0; }

.section-label {
  font-size: .75rem;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.section-title {
  font-size: 2rem;
  margin-bottom: .8rem;
}

.section-subtitle {
  max-width: 500px;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ========== Grid base ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

/* Cards base */
.project-card {
  background: #111;
  padding: 1rem;
  border-radius: .6rem;
  border: 1px solid #222;
}

/* Thumb con imagen (categorías) */
.project-thumb-img {
  height: 170px;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
}

.project-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-title {
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.project-meta {
  color: var(--muted);
  line-height: 1.5;
}

/* Aire entre imagen y texto */
.project-body { margin-top: 1.2rem; }

/* Categorías: 4 en desktop */
.categories-grid { grid-template-columns: repeat(4, 1fr); }

/* Category card hover */
.category-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
  will-change: transform;
}

.category-card:hover {
  transform: scale(1.04);
  z-index: 2;
  background: var(--accent);
  border-color: var(--accent);
}

.category-card:hover .project-title,
.category-card:hover .project-meta {
  color: #000;
}

/* ========== Demo Reel ========== */
.reel-frame {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #222;
  background: #000;
  aspect-ratio: 16 / 9;
}

.reel-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* ========== About ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.about-text {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.about-pillbox {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-start;
}

.about-pill {
  border: 1px solid #222;
  background: #0e0e0e;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: #fff;
}

/* ========== Clients ========== */
.client-logos{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2.2rem;
  align-items: center;
  margin-top: 2rem;
}

.client-logos img{
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
  margin: auto;
  opacity: .85;
  filter: grayscale(100%);
  transition: opacity .2s ease, filter .2s ease, transform .2s ease;
}

.client-logos img:hover{
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.04);
}

/* ========== Contact form ========== */
.contact-form {
  margin-top: 1.8rem;
  border: 1px solid #222;
  background: #0b0b0b;
  border-radius: 16px;
  padding: 1.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-field label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  background: #000;
  color: #fff;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  outline: none;
  font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}

/* Botón estilo header */
.btn-contact {
  background: #fff;
  color: #000;
  border: 0;
  border-radius: 0.8rem;
  padding: 0.8rem 1.2rem;
  height: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.btn-contact:hover {
  background: var(--green);
  transform: scale(1.02);
}

.contact-email {
  color: var(--muted);
  text-decoration: none;
}
.contact-email:hover { color: #fff; }

/* ========== Footer ========== */
footer {
  padding: 2rem 0;
  border-top: 1px solid #222;
  text-align: center;
  color: var(--muted);
}

.footer-socials{
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.footer-socials a{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #222;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.footer-socials a svg{
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-socials a:hover{
  background: var(--green);
  color: #000;
  border-color: var(--green);
  transform: scale(1.08);
}

/* ========== Floating Contact Button ========== */
.floating-contact{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;

  background: #fff;
  color: #000;
  text-decoration: none;

  border-radius: 0.95rem;
  padding: 0.95rem 1.25rem;
  width: 150px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.25);

  transition: background .2s ease, transform .2s ease, opacity .2s ease;
}

.floating-contact:hover{
  background: var(--green);
  transform: scale(1.02);
}

.floating-contact.is-hidden{
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* ========== Modal base (para subpáginas) ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}
.modal.is-open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(1080px, 92vw);
  margin: 6vh auto;
  border-radius: 18px;
  border: 1px solid #222;
  background: #0b0b0b;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  height: 40px;
  width: 40px;
  border-radius: 12px;
  border: 1px solid #222;
  background: #000;
  color: #fff;
  cursor: pointer;
  z-index: 3;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 0;
  min-height: 70vh;
}

.modal-media {
  position: relative;
  background: #000;
  border-right: 1px solid #222;
  display: grid;
  place-items: center;
}

.modal-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.modal-stage img,
.modal-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-info { padding: 1.4rem 1.4rem 1.6rem; }

.modal-kicker {
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

.modal-title { font-size: 1.6rem; margin-bottom: .8rem; }

.modal-desc {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.modal-chip {
  border: 1px solid #222;
  background: #000;
  color: #fff;
  padding: .45rem .65rem;
  border-radius: 999px;
  font-size: .85rem;
}

/* Watermark (si quieres que aplique en modal de subpáginas) */
.modal-media::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 120px;
  height: 36px;
  background-image: url("media/LogoBB.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: right bottom;
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(100%) brightness(2);
}

/* ========== Subpáginas (hero y back link) ========== */
.subpage-hero { padding: 3.5rem 0 2rem 0; }
.subpage-title { font-size: 2.4rem; margin-top: 0.3rem; margin-bottom: 0.6rem; }
.subpage-subtitle { color: var(--muted); max-width: 720px; line-height: 1.6; }
.subpage-content { padding-top: 2rem; }

.subpage-back { margin-top: 2rem; }
.back-link { color: var(--muted); text-decoration: none; }
.back-link:hover { color: #fff; }

/* =========================================================
   SUBPÁGINAS: GALERÍA MASONRY (AISLADA)
   - SOLO se activa en elementos con class bb-gallery / bb-gallery-item
========================================================= */
.bb-gallery{
  column-count: 3;
  column-gap: 18px;
}

.bb-gallery-item{
  break-inside: avoid;
  display: block;
  position: relative;
  margin: 0 0 18px 0;
  text-decoration: none;
  color: inherit;

  border-radius: 14px;
  overflow: hidden;
  background: #000;

  transition: transform .2s ease, filter .2s ease;
  transform: translateZ(0);
}

.bb-gallery-item img{
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain; /* NO recorta */
}

.bb-gallery-item:hover{
  transform: scale(1.01);
  filter: brightness(1.05);
}

.bb-gallery-title{
  position: absolute;
  top: 12px;
  right: 12px;

  font-size: .85rem;
  letter-spacing: .10em;
  text-transform: uppercase;
  font-weight: 600;

  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(6px);
  color: #fff;

  padding: .35rem .55rem;
  border-radius: 999px;

  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}

.bb-gallery-item:hover .bb-gallery-title,
.bb-gallery-item:focus .bb-gallery-title{
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1000px){
  .bb-gallery{ column-count: 2; }
}
@media (max-width: 520px){
  .bb-gallery{ column-count: 1; }
  .bb-gallery-title{ opacity: 1; transform: none; }
}

/* =========================================================
   SUBPÁGINAS: MODAL SCROLL (AISLADO)
   - SOLO si el modal tiene class subpage-modal-scroll
========================================================= */
.subpage-modal-scroll .modal-media{
  display: block;
  overflow: hidden;
}

/* Stage scrolleable */
.subpage-modal-scroll .modal-stage{
  height: 70vh;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

/* Media en columna (no recorta) */
.subpage-modal-scroll .modal-stage img,
.subpage-modal-scroll .modal-stage video{
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  border: 1px solid #222;
  background: #000;
}

.subpage-modal-scroll .modal-stage video{
  max-height: 70vh;
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 900px) {
  /* Modal: se apila */
  .modal-panel { margin: 4vh auto; }
  .modal-grid { grid-template-columns: 1fr; min-height: 78vh; }
  .modal-media { border-right: 0; border-bottom: 1px solid #222; }
  .modal-media::after { opacity: 0.25; width: 110px; height: 34px; }

  /* Clients */
  .client-logos { grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }

  /* About */
  .about-grid { grid-template-columns: 1fr; }

  /* Floating btn */
  .floating-contact { right: 16px; bottom: 16px; width: auto; }

  /* Contact */
  .form-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .btn-contact { width: 100%; }
  .contact-email { text-align: center; }
}

@media (max-width: 768px) {
  /* Hero: video recortado */
  .hero-video-wrapper {
    max-width: 100vw;
    max-height: calc(100vh - 72px);
    width: 100%;
    height: 100%;
  }

  .hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 80%;
  }

  /* Nav mobile */
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 72px;
    right: 1.5rem;
    background: #000;
    border-radius: 12px;
    border: 1px solid #222;
    flex-direction: column;
    padding: .8rem 1rem;
    gap: 1rem;
    display: none;
  }

  .nav-links.open { display: flex; }

  /* Categorías en mobile: 2x2 */
  .categories-grid { grid-template-columns: repeat(2, 1fr); }

  /* Títulos */
  .project-title { font-size: 1.1rem; }
}

@media (max-width: 520px){
  .client-logos { grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
  .client-logos img { max-height: 48px; }
}

/* ==============================
   YOUTUBE EN MODAL (ÚNICO BLOQUE)
   ============================== */
.subpage-modal-scroll .modal-youtube{
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #222;
  background: #000;
  flex: 0 0 auto;           /* evita que flex lo aplaste raro */
}

/* Altura real 16:9 */
.subpage-modal-scroll .modal-youtube::before{
  content: "";
  display: block;
  padding-top: 56.25%;
}

.subpage-modal-scroll .modal-youtube iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ======================================
   Navegación lateral entre categorías
   (SOLO DESKTOP)
====================================== */

.category-nav {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  pointer-events: none; /* no bloquea el contenido */
  z-index: 20;
}

.category-arrow {
  pointer-events: auto;
  position: absolute;
  top: 0;
  transform: translateY(-50%);

  width: 56px;
  height: 56px;

  display: flex;
 /*align-items: center;*/
  justify-content: center;

  font-size: 3rem;
  line-height: 1;
  font-weight: 300;

  color: #fff;
  text-decoration: none;

  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 999px;

  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.category-arrow.left {
  left: 24px;
}

.category-arrow.right {
  right: 24px;
}

.category-arrow:hover {
  background: var(--green);
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

/* ❌ Ocultar en mobile */
@media (max-width: 768px) {
  .category-nav {
    display: none;
  }
}
