/* ============================================================
   Black Cloud — Portfolio
   Design system + shared layout (home + projects library)
   ============================================================ */

:root{
  /* Tipografías */
  --font-logo:    'Bebas Neue', sans-serif;
  --font-display: 'Bebas Neue', sans-serif;
  --font-head:    'Barlow Condensed', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Color */
  --bg:        #0a0d0b;
  --bg-soft:   #0c100e;
  --panel:     #0e1311;
  --panel-2:   #0b0f0d;
  --line:      #1d251f;
  --line-soft: #141a16;
  --green:     #1ba06c;
  --green-2:   #25b780;
  --white:     #f3f5f3;
  --text:      #d9ded9;
  --muted:     #9aa39c;
  --muted-2:   #717a72;

  --maxw: 1440px;
  --pad: 72px;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; }
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
ul{ list-style:none; }

.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 var(--pad); }

.eyebrow{
  font-family:var(--font-body);
  font-weight:700;
  font-size:12px;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:var(--green-2);
}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:34px;
  justify-content:space-between;
  font-family:var(--font-body);
  font-weight:700;
  font-size:12px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--white);
  border:1px solid #2c3630;
  background:transparent;
  padding:16px 22px;
  cursor:pointer; white-space:nowrap;
  transition:border-color .25s, color .25s, background .25s;
}
.btn .arrow{ color:var(--green-2); display:flex; }
.btn:hover{ border-color:var(--green); background:rgba(27,160,108,.08); }

/* ---------- header ---------- */
header{
  position:sticky; top:0; z-index:50;
  background:rgba(10,13,11,.86);
  backdrop-filter:blur(10px);
  border-bottom:1px solid transparent;
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  height:96px;
}
.logo{ display:inline-flex; align-items:center; }
.logo img{ height:64px; width:auto; display:block; }
.menu{ display:flex; align-items:center; gap:42px; }
.menu a{
  font-weight:600; font-size:12.5px; letter-spacing:.14em; text-transform:uppercase;
  color:#cfd4cf; padding:6px 0; position:relative; white-space:nowrap;
  transition:color .2s;
}
.menu a:hover{ color:#fff; }
.menu a.active{ color:#fff; }
.menu a.active::after{
  content:""; position:absolute; left:0; right:0; bottom:-2px; height:2px;
  background:var(--green); border-radius:2px;
}
.nav-toggle{ display:none; }

section{ position:relative; }

/* ---------- cards (shared) ---------- */
.card{ background:var(--bg); display:flex; flex-direction:column; }
.card-media{
  position:relative; aspect-ratio:233/156; overflow:hidden; background:#10110f;
}
.card-media img{ width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.card:hover .card-media img{ transform:scale(1.05); }
/* Proyecto sin imagen: póster oscuro intencional en vez de imagen rota. */
.card-media.is-empty{
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(27,160,108,.12), transparent 62%),
    linear-gradient(180deg, #121714, #0c100e);
}
.play{
  position:absolute; inset:0; margin:auto; width:46px; height:46px;
  display:flex; align-items:center; justify-content:center;
  border:1.5px solid rgba(255,255,255,.85); border-radius:50%;
  background:rgba(20,24,21,.28); backdrop-filter:blur(2px);
  color:#fff;
}
.play svg{ margin-left:2px; }
.card-body{ padding:18px 18px 26px; }
.card-cat{
  font-size:10.5px; font-weight:700; letter-spacing:.16em; text-transform:uppercase;
  color:var(--green-2); margin-bottom:9px;
}
.card-title{
  font-family:var(--font-head); font-weight:400; font-size:21px; color:var(--white);
  margin-bottom:10px;
}
.card-desc{ font-size:13px; color:var(--muted); line-height:1.5; font-weight:300; }

/* ---------- footer ---------- */
footer{ border-top:1px solid var(--line); }
.foot{
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  height:88px;
}
.foot .logo img{ height:64px; }
.foot .logo{ margin-left:24px; }
.foot .copy{ font-size:13px; color:var(--muted-2); margin-left:30px; flex:1; }
.socials{ display:flex; gap:14px; }
.foot .socials{ margin:0; }
.foot .socials a{ border:none; width:auto; height:auto; color:#aeb6ae; transition:.2s; }
.foot .socials a:hover{ color:#fff; }

/* ============================================================
   HOME — hero, projects strip, about + contact
   ============================================================ */

/* ---------- hero ---------- */
.hero{ position:relative; }
.hero-inner{
  display:grid; grid-template-columns:1fr; align-items:center;
  min-height:560px;
}
.hero-copy{ max-width:640px; padding:70px 0 70px; position:relative; z-index:2; }
.hero h1{
  font-family:var(--font-display);
  font-weight:400;
  font-size:clamp(56px,7.4vw,116px);
  line-height:.9;
  letter-spacing:.005em;
  margin:20px 0 26px;
  color:var(--white);
  text-transform:uppercase;
  white-space:nowrap;
}
.hero h1 .g{ color:var(--green); }
.hero .lede{
  font-size:19px; color:#c4cbc4; max-width:430px; line-height:1.55; font-weight:300;
}
.hero .btn{ margin-top:34px; }
.hero .socials{ margin-top:34px; }
.hero .socials a{
  width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  border:1px solid #232c26; color:#aeb6ae; transition:.2s;
}
.hero .socials a:hover{ border-color:var(--green); color:#fff; }

.hero-media{
  position:absolute; top:0; right:0; height:100%; width:54%;
  overflow:hidden;
}
.hero-media::before{
  content:""; position:absolute; inset:0; z-index:2;
  background:linear-gradient(90deg,var(--bg) 0%, rgba(10,13,11,.55) 22%, rgba(10,13,11,0) 55%);
}
.hero-media img{ width:100%; height:100%; object-fit:cover; object-position:center 22%; }

/* ---------- projects strip ---------- */
.projects{ padding:64px 0 70px; }
.section-head{
  display:flex; align-items:flex-start; gap:64px; margin-bottom:34px; flex-wrap:wrap;
}
.section-head h2{
  font-family:var(--font-head); font-weight:300; font-size:42px; color:var(--white);
  line-height:1.05; margin-top:10px; letter-spacing:.005em;
}
.section-head .head-desc{
  font-size:14.5px; color:var(--muted); max-width:330px; line-height:1.55; margin-top:6px;
  font-weight:300;
}

.projects-grid{
  display:grid; grid-template-columns:repeat(6,1fr);
  gap:1px; background:var(--line); border:1px solid var(--line);
}
.projects-foot{ display:flex; justify-content:center; margin-top:40px; }

/* carousel dots (solo móvil) */
.carousel-dots{ display:none; justify-content:center; gap:10px; margin-top:24px; }
.carousel-dots button{
  width:8px; height:8px; padding:0; border:none; border-radius:50%;
  background:#2b352e; cursor:pointer; transition:background .25s, width .25s;
}
.carousel-dots button.active{ background:var(--green-2) !important; width:22px !important; border-radius:5px !important; }

/* ---------- about + contact (separados: about arriba, contacto banda abajo) ---------- */
.cta-section{ padding:14px 0 0; }
.cta-wrap{ display:block; }
.about{ display:grid; grid-template-columns:500px 1fr; align-items:stretch; }
.about-img{ overflow:hidden; }
.about-img img{ width:100%; height:100%; object-fit:cover; min-height:500px; display:block; }
.about-body{ padding:44px 0 46px 52px; position:relative; }
.about-body h2,
.contact h2{
  font-family:var(--font-head); font-weight:300; font-size:33px; color:var(--white);
  margin:12px 0 20px; line-height:1.05;
}
.about-body p{ font-size:15px; color:var(--muted); line-height:1.7; margin-bottom:18px; max-width:640px; font-weight:300; }
.about-body .btn{ margin-top:14px; }

.contact{
  text-align:center;
  padding:60px var(--pad);
  margin:48px calc(-1 * var(--pad)) 0;
  background:var(--panel-2);
  display:flex; flex-direction:column; align-items:center;
}
.contact p{ font-size:14px; color:var(--muted); line-height:1.6; max-width:560px; font-weight:300; }
.contact-info{ display:flex; align-items:center; justify-content:center; gap:26px; margin:26px 0 28px; flex-wrap:wrap; }
.contact-info .item{ display:flex; align-items:center; gap:9px; font-size:14px; color:#cdd3cd; }
.contact-info .item svg{ color:var(--green-2); }
.contact-info .dot{ color:#3a443c; }

/* ============================================================
   LIBRARY — Proyectos page
   ============================================================ */

.lib-head{ padding:70px 0 40px; border-bottom:1px solid var(--line); }
.breadcrumb{ font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted-2); margin-bottom:22px; }
.breadcrumb a:hover{ color:var(--green-2); }
.breadcrumb .sep{ margin:0 10px; color:#39423b; }
.lib-head-row{ display:block; }
.lib-head h1{
  font-family:var(--font-display); font-weight:400; font-size:clamp(60px,8.5vw,120px);
  line-height:.9; letter-spacing:.01em; text-transform:uppercase; color:var(--white); margin-top:12px;
}
.lib-head .intro{ font-size:15px; color:var(--muted); max-width:520px; line-height:1.6; font-weight:300; margin-top:22px; }

/* toggle principal (Videos / Imágenes) */
.seg{
  display:inline-flex; gap:0; margin-top:30px;
  border:1px solid var(--line);
}
.seg button{
  font-family:var(--font-head); font-weight:500; font-size:18px;
  letter-spacing:.08em; text-transform:uppercase; color:var(--muted);
  background:transparent; border:none; padding:14px 34px; cursor:pointer;
  transition:.2s; position:relative;
}
.seg button + button{ border-left:1px solid var(--line); }
.seg button:hover{ color:#fff; }
.seg button.active{ color:#06140d; background:var(--green-2); }
.seg .count{ font-family:var(--font-body); font-size:10px; font-weight:700; opacity:.6; margin-left:8px; vertical-align:middle; }

/* library grid */
.lib{ padding:40px 0 90px; }
.lib-part{ display:none; }
.lib-part.active{ display:block; }
.lib-part + .lib-part{ margin-top:0; }
.part-head{ display:flex; align-items:baseline; gap:14px; margin-bottom:26px; }
.part-head h2{
  font-family:var(--font-head); font-weight:300; font-size:30px; color:var(--white);
  line-height:1; letter-spacing:.01em;
}
.part-head .part-count{ font-size:13px; color:var(--muted-2); font-weight:400; }
.lib-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:26px;
}
.lib .card{ border:1px solid var(--line); }
.lib .card.is-hidden{ display:none; }
.lib .card-media{ aspect-ratio:16/10; }
.lib .play{ width:50px; height:50px; }
.lib .card-body{ padding:20px 22px 28px; }
.lib .card-title{ font-size:23px; }
.lib .card-desc{ line-height:1.55; }
.lib-empty{ color:var(--muted); font-size:14px; padding:40px 0; display:none; }

/* ============================================================
   RESPONSIVE — vertical / móvil
   ============================================================ */

@media (max-width:1180px){
  :root{ --pad:48px; }
  .menu{ gap:30px; }

  /* hero */
  .hero-inner{ min-height:auto; }
  .hero-copy{ max-width:none; width:52%; padding:46px 0 56px; }
  .hero-media{ width:48%; }
  .hero h1{ font-size:clamp(54px,8vw,84px); }
  .hero .lede{ font-size:17px; }

  /* projects -> 3 x 2 with gaps, separate cards */
  .projects-grid{
    grid-template-columns:repeat(3,1fr);
    gap:26px; background:transparent; border:none;
  }
  .projects .card{ border:1px solid var(--line); }
  .projects .card-media{ aspect-ratio:16/10; }

  /* about full width, contact becomes centered band below */
  .cta-section{ padding:6px 0 0; }
  .cta-wrap{ display:block; border:none; }
  .about{ grid-template-columns:400px 1fr; }
  .contact{
    border-left:none; border-top:none;
    text-align:center; padding:54px var(--pad) 60px;
    margin:36px calc(-1 * var(--pad)) 0;
    background:var(--panel-2);
    display:flex; flex-direction:column; align-items:center;
  }
  .contact .eyebrow{ margin-bottom:8px; }
  .contact h2{ font-size:30px; }
  .contact p{ max-width:560px; }
  .contact-info{ justify-content:center; }
  .contact .btn{ margin-top:8px; }

  .foot{ flex-wrap:wrap; height:auto; padding:26px 0; }
  .foot .copy{ order:3; flex-basis:100%; text-align:center; margin:14px 0 0; }

  /* library */
  .lib-grid{ grid-template-columns:repeat(2,1fr); gap:22px; }
}

@media (max-width:720px){
  :root{ --pad:24px; }
  .menu{ display:none; }
  .nav-toggle{ display:flex; align-items:center; justify-content:center; width:42px; height:42px; border:1px solid #232c26; color:#cfd4cf; background:transparent; cursor:pointer; }
  /* menú desplegable móvil (nav.js añade .nav-open al header) */
  header.nav-open .menu{
    display:flex; flex-direction:column; align-items:flex-start; gap:4px;
    position:absolute; top:100%; left:0; right:0;
    padding:14px var(--pad) 22px;
    background:rgba(10,13,11,.98); border-bottom:1px solid var(--line);
  }
  header.nav-open .menu a{ width:100%; padding:13px 0; font-size:14px; border-bottom:1px solid var(--line-soft); }
  header.nav-open .menu a:last-child{ border-bottom:none; }
  header.nav-open .menu a.active::after{ display:none; }
  header.nav-open .menu a.active{ color:var(--green-2); }
  header.nav-open .nav-toggle{ border-color:var(--green); color:#fff; }

  /* hero */
  .hero-inner{ display:block; }
  .hero-copy{ width:100%; padding:32px 0 36px; }
  .hero-media{ position:relative; width:100%; height:380px; }
  .hero-media::before{ background:linear-gradient(0deg,var(--bg) 2%, rgba(10,13,11,0) 45%); }
  .hero h1{ font-size:clamp(46px,15vw,72px); white-space:normal; }

  .section-head{ gap:18px; }
  .section-head h2{ font-size:34px; }

  /* projects -> carrusel deslizable */
  .projects-grid{
    display:flex; grid-template-columns:none; gap:16px;
    overflow-x:auto; scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch; scrollbar-width:none;
    margin:0 calc(-1 * var(--pad)); padding:4px var(--pad) 2px;
  }
  .projects-grid::-webkit-scrollbar{ display:none; }
  .projects .card{ scroll-snap-align:center; flex:0 0 82%; }
  .carousel-dots{ display:flex; }

  /* about */
  .about{ display:block; }
  .about-img{ margin:0 0 24px; }
  .about-img img{ min-height:300px; }
  .about-body{ padding:0; }
  .sign{ position:static; display:block; text-align:right; margin-top:10px; }
  .contact{ padding:44px var(--pad) 48px; }

  .foot{ justify-content:center; }
  .foot .socials{ width:100%; justify-content:center; margin-top:6px; order:2; }

  /* library */
  .lib-head{ padding:46px 0 30px; }
  .lib-grid{ grid-template-columns:1fr; gap:20px; }
}

/* ============================================================
   DETAIL / GALLERY (proyecto.html)
   ============================================================ */
.detail{ padding:0 0 90px; }
.video-embed{
  position:relative; width:100%; max-width:980px; aspect-ratio:16/9;
  margin:36px 0 6px; border:1px solid var(--line); background:#000;
}
.video-embed iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

.gallery{ padding:34px 0 0; }
.gallery-grid{ columns:3; column-gap:14px; }
.gallery-item{
  break-inside:avoid; margin:0 0 14px; display:block; width:100%;
  border:1px solid var(--line); background:#10110f; cursor:zoom-in; overflow:hidden;
}
.gallery-item img{ width:100%; display:block; transition:transform .5s ease; }
.gallery-item:hover img{ transform:scale(1.03); }
.gallery-empty{ color:var(--muted); font-size:14px; padding:30px 0; }

/* lightbox */
.lightbox{
  position:fixed; inset:0; z-index:100; background:rgba(4,6,5,.94);
  display:flex; align-items:center; justify-content:center;
}
.lightbox[hidden]{ display:none; }
.lightbox img{
  max-width:92vw; max-height:86vh; object-fit:contain;
  box-shadow:0 10px 60px rgba(0,0,0,.6);
}
.lb-btn{
  position:absolute; top:50%; transform:translateY(-50%);
  width:52px; height:52px; display:flex; align-items:center; justify-content:center;
  background:rgba(20,24,21,.5); border:1px solid #2c3630; color:#fff; cursor:pointer;
  font-size:26px; line-height:1; transition:border-color .2s;
}
.lb-prev{ left:18px; } .lb-next{ right:18px; }
.lb-close{
  position:absolute; top:18px; right:18px; width:46px; height:46px;
  background:rgba(20,24,21,.5); border:1px solid #2c3630; color:#fff; cursor:pointer;
  font-size:18px; transition:border-color .2s;
}
.lb-btn:hover, .lb-close:hover{ border-color:var(--green); }
.lb-count{
  position:absolute; bottom:20px; left:0; right:0; text-align:center;
  color:var(--muted); font-size:13px; letter-spacing:.12em;
}

@media (max-width:1180px){ .gallery-grid{ columns:2; } }
@media (max-width:720px){
  .gallery-grid{ columns:1; }
  .lb-btn{ width:44px; height:44px; font-size:22px; }
}

/* Texto solo para lectores de pantalla y buscadores (no altera el diseño). */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
