/*
Theme Name:   291 Studio
Theme URI:    https://291studio.com
Description:  Tema personalizado para 291 Studio — Agencia creativa audiovisual, Madrid
Author:       291 Studio
Author URI:   https://291studio.com
Version:      1.0.0
Text Domain:  studio291
*/

/* ── Reset + tokens de marca ────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
:root {
  --blue:  #1F3C9A;
  --navy:  #1D214B;
  --bg:    #101326;
  --cream: #F3E9D3;
  --sky:   #9DC3ED;
}
body {
  background: var(--bg);
  color: #fff;
  overflow-x: hidden;
  font-family: 'Gabarito', system-ui, sans-serif;
}
::selection { background: var(--sky); color: var(--bg); }
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes rise  { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: translateY(0); } }
@keyframes marq  { from { transform: translateX(0); }               to { transform: translateX(-50%); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .9; }   50% { transform: scale(1.08); opacity: 1; } }

/* ── Scroll reveal ───────────────────────────────────────── */
.rise { opacity: 0; animation: rise 1.05s cubic-bezier(.16,1,.3,1) forwards; }
.reveal {
  opacity: 0; transform: translateY(38px); filter: blur(10px);
  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1), filter .9s cubic-bezier(.16,1,.3,1);
}
.reveal.in { opacity: 1; transform: none; filter: none; }
.reveal-img {
  opacity: 0; transform: scale(1.09); filter: blur(16px);
  transition: opacity 1.1s cubic-bezier(.16,1,.3,1), transform 1.25s cubic-bezier(.16,1,.3,1), filter 1.1s cubic-bezier(.16,1,.3,1);
}
.reveal-img.in { opacity: 1; transform: none; filter: none; }
.stagger > * {
  opacity: 0; transform: translateY(40px); filter: blur(8px);
  transition: opacity .85s cubic-bezier(.16,1,.3,1), transform .85s cubic-bezier(.16,1,.3,1), filter .85s cubic-bezier(.16,1,.3,1);
}
.stagger.in > *                  { opacity: 1; transform: none; filter: none; }
.stagger.in > *:nth-child(2)     { transition-delay: .10s; }
.stagger.in > *:nth-child(3)     { transition-delay: .20s; }
.stagger.in > *:nth-child(4)     { transition-delay: .30s; }
.stagger.in > *:nth-child(5)     { transition-delay: .40s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-img, .stagger > *, .rise {
    opacity: 1 !important; transform: none !important;
    animation: none !important; transition: none !important; filter: none !important;
  }
}

/* ── Layout ──────────────────────────────────────────────── */
.wrap { max-width: 1400px; margin: 0 auto; }

/* ── NAV ─────────────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 50px;
  transition: background .4s, backdrop-filter .4s, padding .4s;
}
.site-nav.scrolled {
  background: rgba(16,19,38,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 50px;
}
/* Admin bar offset */
.admin-bar .site-nav { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .site-nav { top: 46px; } }

/* ── LOGO STACKED (dos/nueve/uno) ───────────────────────── */
.logo-mark, .footer-logo { text-decoration: none; }
.logo-stack {
  display: flex; flex-direction: column;
  font-family: 'Funnel Display', sans-serif;
  font-weight: 700; font-size: 13px;
  line-height: 1.18; letter-spacing: .3px;
  text-transform: lowercase;
  transition: opacity .25s;
}
.logo-mark:hover .logo-stack,
.footer-logo:hover .logo-stack { opacity: .75; }
.logo-stack span     { color: var(--cream); }
.logo-stack span.hi  { color: var(--sky); }

/* ── NAV LINKS ──────────────────────────────────────────── */
.nav-links {
  display: flex; align-items: center; gap: 34px;
  font-size: 15px; font-weight: 500; color: rgba(255,255,255,.85);
}
.nav-links a { text-decoration: none; transition: color .25s; }
.nav-links a:not(.nav-cta) { position: relative; padding-bottom: 3px; }
.nav-links a:not(.nav-cta)::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1.5px; background: var(--sky);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.nav-links a:not(.nav-cta):hover { color: #fff; }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta {
  color: var(--bg) !important; background: var(--sky);
  text-decoration: none; padding: 10px 22px; border-radius: 100px;
  font-weight: 600; transition: background .25s, transform .25s;
}
.nav-cta:hover { background: #fff; transform: translateY(-1px); }

/* Scroll anchor offset */
[id] { scroll-margin-top: 90px; }

/* ── HERO (tarjetas flotantes) ───────────────────────────── */
.hero {
  position: relative; background: var(--navy);
  min-height: 100vh; display: flex; align-items: flex-end;
  overflow: hidden; padding-bottom: 80px;
}
.hero-content {
  position: relative; z-index: 3;
  padding: 0 50px; max-width: 52%;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 11px;
  font-size: 13px; font-weight: 600; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--sky); margin-bottom: 24px;
}
.hero-eyebrow .bar { width: 28px; height: 1.5px; background: var(--sky); display: inline-block; }
.hero h1 {
  font-family: 'Funnel Display', sans-serif; font-weight: 600;
  font-size: clamp(44px, 6.5vw, 96px); line-height: 1.05;
  letter-spacing: -2px; max-width: 14ch;
}
.hero-brand {
  font-family: 'Funnel Display', sans-serif;
  font-size: clamp(28px, 4vw, 56px); font-weight: 600;
  color: var(--sky); margin-top: 12px; letter-spacing: -1px;
}
.hero-sub {
  font-size: 17px; line-height: 1.55; color: rgba(255,255,255,.72);
  max-width: 38ch; margin-top: 14px; margin-bottom: 36px;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--bg); background: #fff;
  padding: 16px 28px; border-radius: 100px;
  font-weight: 600; font-size: 16px;
  transition: transform .25s, background .25s;
}
.btn-primary:hover { transform: translateY(-2px); background: var(--cream); }

/* Tarjetas flotantes del hero */
#hero-visuals {
  position: absolute; right: 0; top: 0;
  width: 50%; height: 100%; z-index: 2; pointer-events: none;
}
.hv-card {
  position: absolute; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  opacity: 0;
  transition: opacity .95s cubic-bezier(.16,1,.3,1), transform .95s cubic-bezier(.16,1,.3,1);
}
.hv-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hv-c1 { width: 48%; top: 7%; bottom: 18%; left: 2%;  transform: rotate(-4deg) translateY(80px); }
.hv-c2 { width: 55%; height: 41%; top: 4%; right: 2%; transform: rotate(3deg)  translateY(80px); }
.hv-c3 { width: 52%; height: 36%; bottom: 6%; right: 3%; transform: rotate(-2.5deg) translateY(80px); }
.hv-c1.loaded { transform: rotate(-4deg)  translateY(0); opacity: 1; }
.hv-c2.loaded { transform: rotate(3deg)   translateY(0); opacity: 1; }
.hv-c3.loaded { transform: rotate(-2.5deg) translateY(0); opacity: 1; }
@media (max-width: 1024px) { #hero-visuals { display: none; } }

/* ── MARQUEE ─────────────────────────────────────────────── */
.marquee {
  position: relative; z-index: 2;
  padding: 20px 0; overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.marquee-track   { display: flex; width: max-content; animation: marq 32s linear infinite; }
.marquee-group   { display: flex; align-items: center; }
.marquee-group .m {
  font-family: 'Funnel Display', sans-serif; font-weight: 400;
  font-size: 24px; padding: 0 32px; color: rgba(255,255,255,.55); white-space: nowrap;
}
.marquee-group .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--sky); flex-shrink: 0;
}

/* ── SECCIONES ───────────────────────────────────────────── */
.section { position: relative; z-index: 2; padding: 106px 50px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 18px; margin-bottom: 48px;
}
.section-head h2 {
  font-family: 'Funnel Display', sans-serif; font-weight: 600;
  font-size: clamp(34px, 5.4vw, 72px); line-height: 1; letter-spacing: -1.4px;
}
.section-head p { font-size: 16px; color: rgba(255,255,255,.6); max-width: 34ch; text-align: right; }
.label { font-size: 13px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--sky); }

/* ── TRABAJO / Proyectos ─────────────────────────────────── */
.work-list { display: flex; flex-direction: column; gap: 26px; }
.work-item {
  text-decoration: none; color: inherit;
  display: grid; gap: 26px; align-items: stretch;
}
.work-item.left  { grid-template-columns: 1.5fr 1fr; }
.work-item.right { grid-template-columns: 1fr 1.5fr; }
.work-item.right .work-media { order: 2; }
.work-item.right .work-text  { order: 1; }
.work-media {
  aspect-ratio: 16/9; border-radius: 18px; overflow: hidden;
  position: relative; border: 1px solid rgba(255,255,255,.12);
  transition: border-color .3s;
}
.work-item:hover .work-media { border-color: var(--sky); }
.work-media img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-media-placeholder {
  width: 100%; height: 100%; background: var(--navy);
  display: grid; place-items: center;
  color: rgba(255,255,255,.2); font-size: 14px;
}
.work-text { display: flex; flex-direction: column; justify-content: center; padding: 8px 6px; }
.work-text .tag {
  font-size: 13px; font-weight: 600; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--sky); margin-bottom: 12px;
}
.work-text h3 {
  font-family: 'Funnel Display', sans-serif; font-weight: 600;
  font-size: clamp(28px, 3.4vw, 46px); line-height: 1; letter-spacing: -.8px; margin-bottom: 14px;
}
.work-text p { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.66); max-width: 38ch; }

/* ── SERVICIOS ───────────────────────────────────────────── */
.servicios { background: var(--navy); padding: 108px 50px; }
.servicios .label { display: inline-block; }
.servicios h2 {
  font-family: 'Funnel Display', sans-serif; font-weight: 600;
  font-size: clamp(34px, 5.4vw, 72px); line-height: 1; letter-spacing: -1.4px;
  margin-top: 14px; margin-bottom: 52px;
}
/* Clip-path wipe reveal — overrides default .reveal fade-up */
.servicios h2.reveal {
  opacity: 1 !important; transform: none !important; filter: none !important;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .9s cubic-bezier(.16,1,.3,1) !important;
}
.servicios h2.reveal.in { clip-path: inset(0 0% 0 0); }
.serv-rows { border-top: 1px solid rgba(255,255,255,.16); }

/* Slide-in animation: override stagger for serv-rows */
.serv-rows > .serv-row {
  opacity: 0; transform: translateX(-28px); filter: none;
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}
.serv-rows.in > .serv-row                  { opacity: 1; transform: none; }
.serv-rows.in > .serv-row:nth-child(1)     { transition-delay: 0s; }
.serv-rows.in > .serv-row:nth-child(2)     { transition-delay: .09s; }
.serv-rows.in > .serv-row:nth-child(3)     { transition-delay: .18s; }
.serv-rows.in > .serv-row:nth-child(4)     { transition-delay: .27s; }

.serv-row {
  display: grid; grid-template-columns: 80px 1fr 2fr;
  gap: 30px; align-items: center;
  padding: 30px 8px; border-bottom: 1px solid rgba(255,255,255,.16);
  position: relative; overflow: hidden;
  transition: background .3s;
}
/* Sliding left-border on hover */
.serv-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--sky);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.serv-row:hover::before { transform: scaleY(1); }
.serv-row:hover { background: rgba(255,255,255,.04); }
.serv-row .no {
  font-family: 'Funnel Display', sans-serif; font-weight: 700;
  font-size: 16px; color: var(--sky);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.serv-row:hover .no { transform: translateX(4px); }
.serv-row h3    { font-family: 'Funnel Display', sans-serif; font-weight: 500; font-size: clamp(24px,2.8vw,38px); letter-spacing: -.6px; }
.serv-row p     { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.66); }

/* ── ESTUDIO ─────────────────────────────────────────────── */
.estudio { padding: 114px 50px; max-width: 1120px; margin: 0 auto; text-align: center; }
.estudio .big {
  font-family: 'Funnel Display', sans-serif; font-weight: 500;
  font-size: clamp(28px, 4.4vw, 58px); line-height: 1.12; letter-spacing: -.8px;
  margin: 26px auto 0; max-width: 24ch;
}
.estudio .big em { font-style: normal; color: var(--sky); }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 64px; margin-top: 70px; }
.stats .num {
  font-family: 'Funnel Display', sans-serif; font-weight: 600;
  font-size: clamp(44px, 6vw, 80px); line-height: 1; color: var(--sky);
}
.stats .lbl { font-size: 15px; color: rgba(255,255,255,.6); margin-top: 8px; }

/* ── CTA ──────────────────────────────────────────────────── */
.cta-section { padding: 30px 50px 110px; max-width: 1400px; margin: 0 auto; }
.cta-card {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  border-radius: 28px; padding: clamp(48px,7vw,104px);
  text-align: center; border: 1px solid rgba(255,255,255,.1);
}
.cta-card h2 {
  font-family: 'Funnel Display', sans-serif; font-weight: 600;
  font-size: clamp(40px, 6.8vw, 98px); line-height: .98;
  letter-spacing: -2px; max-width: 16ch; margin: 0 auto 34px;
}
.cta-card .cta-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }
.cta-card a {
  display: inline-flex; align-items: center; gap: 13px;
  background: #fff; color: var(--bg); text-decoration: none;
  padding: 18px 36px; border-radius: 100px;
  font-weight: 600; font-size: 17px; transition: transform .25s;
}
.cta-card a:hover { transform: translateY(-2px); }
.cta-card a.btn-ghost {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}
.cta-card a.btn-ghost:hover { border-color: #fff; }

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer {
  position: relative; z-index: 2;
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 44px 50px;
  display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; justify-content: space-between;
  max-width: 1400px; margin: 0 auto;
}
.footer-logo .logo-stack { font-size: 12px; }
.footer-social { display: flex; gap: 28px; font-size: 14.5px; font-weight: 500; color: rgba(255,255,255,.8); }
.footer-social a { text-decoration: none; transition: color .2s; }
.footer-social a:hover { color: #fff; }
.footer-copy { font-size: 13.5px; color: rgba(255,255,255,.5); }

/* ── SINGLE PROYECTO ─────────────────────────────────────── */
.proyecto-single {
  padding: 140px 50px 100px; max-width: 1000px; margin: 0 auto;
}
.proyecto-single .proyecto-tag { display: block; margin-bottom: 20px; }
.proyecto-single h1 {
  font-family: 'Funnel Display', sans-serif; font-weight: 600;
  font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -2px; margin-bottom: 40px;
}
.proyecto-single .proyecto-thumb {
  border-radius: 18px; overflow: hidden; margin-bottom: 48px;
}
.proyecto-single .proyecto-thumb img { width: 100%; height: auto; display: block; }
.proyecto-single .proyecto-body { font-size: 18px; line-height: 1.7; color: rgba(255,255,255,.82); }
.proyecto-single .proyecto-back { margin-top: 60px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .serv-row { grid-template-columns: 64px 1fr; }
  .serv-row p { display: none; }
}
@media (max-width: 768px) {
  .site-nav   { padding: 20px 24px; }
  .nav-links  { display: none; }
  .hero-content { max-width: 100%; padding: 0 24px; }
  .hero       { padding-bottom: 60px; }
  .section    { padding: 72px 24px; }
  .servicios  { padding: 80px 24px; }
  .cta-section{ padding: 24px 24px 80px; }
  .estudio    { padding: 72px 24px; }
  .site-footer{ padding: 36px 24px; }
  .work-item.left, .work-item.right { grid-template-columns: 1fr; }
  .work-item.right .work-media, .work-item.right .work-text { order: unset; }
  .stats { gap: 40px; }
  .proyecto-single { padding: 120px 24px 80px; }
}
