:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --line: #24242a;
  --text: #ecebe8;
  --muted: #8d8c88;
  --accent: #c9a46a;
  --rec: #e5484d;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --pad: clamp(16px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font: 300 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--accent); }
h1, h2, .big { font-family: var(--serif); font-weight: 400; line-height: 1.02; }
h3 { font-weight: 500; font-size: 1rem; }
.mono { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }

/* GRANO DE PELÍCULA */
.grain { position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite; }
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)} 60%{transform:translate(-2%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* NAV */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px var(--pad); transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(10,10,11,.82); backdrop-filter: blur(12px); border-color: var(--line); }
.nav nav { display: flex; gap: 28px; font-size: .9rem; color: var(--muted); }
.nav nav a:hover { color: var(--text); }
.logo { font-family: var(--serif); font-size: 1.6rem; letter-spacing: .01em; }
.logo span { color: var(--accent); }

/* BUTTONS */
.btn { display: inline-block; padding: 14px 26px; border: 1px solid var(--text); border-radius: 999px; font-size: .9rem; font-weight: 400; background: var(--text); color: var(--bg); cursor: pointer; transition: .2s; font-family: var(--sans); }
.btn:hover { background: transparent; color: var(--text); }
.btn-small { padding: 9px 18px; font-size: .82rem; }
.link { border-bottom: 1px solid var(--muted); padding-bottom: 2px; }
.link:hover { border-color: var(--accent); color: var(--accent); }

/* HERO + TRÁILER */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-media { position: absolute; inset: 0; background: #000 center/cover no-repeat; }
.hero-media video, .hero-media iframe { position: absolute; top: 50%; left: 50%; width: 100vw; height: 56.25vw; min-height: 100%; min-width: 177.78vh; transform: translate(-50%, -50%); border: 0; object-fit: cover; pointer-events: none; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,11,.55) 0%, rgba(10,10,11,.15) 40%, rgba(10,10,11,.9) 100%); }
/* letterbox */
.hero::before, .hero::after { content: ''; position: absolute; left: 0; right: 0; height: 5vh; background: #000; z-index: 2; }
.hero::before { top: 0; } .hero::after { bottom: 0; }
.hero-content { position: relative; z-index: 3; padding: 0 var(--pad) calc(5vh + 64px); max-width: 1100px; }
.eyebrow { color: var(--muted); margin-bottom: 24px; }
.hero h1 { font-size: clamp(3.2rem, 10vw, 8.5rem); }
.lede { max-width: 520px; margin-top: 28px; color: #b9b8b3; font-size: 1.1rem; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 48px; }
/* Acceso a contacto en la barra: solo en celular */
.nav-cta { display: none; }

/* Placeholder del tráiler: simula un montaje con cortes */
.trailer-ph { position: absolute; inset: 0; }
.trailer-ph .shot { position: absolute; inset: 0; opacity: 0; display: grid; place-items: center; }
.trailer-ph .shot.on { opacity: 1; }
.trailer-ph .shot span { font-family: var(--serif); font-size: clamp(4rem, 18vw, 16rem); color: rgba(255,255,255,.05); white-space: nowrap; }
.trailer-ph .slot-note { position: absolute; top: calc(5vh + 130px); left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); border: 1px dashed rgba(201,164,106,.5); padding: 6px 12px; white-space: nowrap; }

/* Visor de cámara */
.viewfinder { position: absolute; inset: calc(5vh + 72px) var(--pad) calc(5vh + 20px); z-index: 3; pointer-events: none; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: rgba(255,255,255,.75); }
.vf-corner { position: absolute; width: 22px; height: 22px; border-color: rgba(255,255,255,.5); border-style: solid; border-width: 0; }
.vf-corner.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.vf-corner.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.vf-corner.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.vf-corner.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.vf-rec { position: absolute; top: 12px; left: 34px; display: flex; align-items: center; gap: 8px; }
.vf-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.vf-tc { position: absolute; top: 12px; right: 34px; }
.vf-meta { position: absolute; bottom: 12px; right: 34px; color: rgba(255,255,255,.45); }
.vf-scene { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.45); }

/* ===== WEAVE: título del hero tejido ===== */
.woven { position: relative; display: inline-block; }
.woven em { display: inline-block; animation: wovenText 1.4s .9s both cubic-bezier(.2,.7,.2,1); }
.woven-threads { position: absolute; inset: 8% -2% 4% 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.woven-threads i { display: block; height: 1px; background: var(--accent); transform: scaleX(0); opacity: .9; animation: threadIn 1.6s both cubic-bezier(.6,0,.2,1); }
.woven-threads i:nth-child(odd)  { transform-origin: left; }
.woven-threads i:nth-child(even) { transform-origin: right; }
.woven-threads i:nth-child(1) { animation-delay: .10s; } .woven-threads i:nth-child(2) { animation-delay: .18s; }
.woven-threads i:nth-child(3) { animation-delay: .26s; } .woven-threads i:nth-child(4) { animation-delay: .34s; }
.woven-threads i:nth-child(5) { animation-delay: .42s; } .woven-threads i:nth-child(6) { animation-delay: .50s; }
.woven-threads i:nth-child(7) { animation-delay: .58s; }
@keyframes threadIn { 0% { transform: scaleX(0); opacity: .9; } 55% { transform: scaleX(1); opacity: .9; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes wovenText { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }

/* ===== WEAVE: hilo que recorre la página ===== */
.woven-body { position: relative;
  /* trama de tela muy sutil */
  background-image:
    repeating-linear-gradient(0deg,  rgba(255,255,255,.012) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px); }
.thread { position: absolute; top: 0; left: 0; width: 64px; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.thread .warp { stroke: var(--line); stroke-width: 1; fill: none; }
.thread .weft { stroke: var(--accent); stroke-width: 1.2; fill: none; opacity: .85; }
.thread .knot { fill: var(--accent); }

/* SLOTS de video (grilla de trabajos) */
.slot { position: relative; width: 100%; background: var(--bg-2) center/cover no-repeat; border: 1px dashed var(--line); overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.slot-landscape { aspect-ratio: 16 / 9; }
.slot-vertical { aspect-ratio: 9 / 16; }
.slot.filled { border-style: solid; }
.slot-label { text-align: center; color: var(--muted); font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; }
.slot-label b { display: block; font-family: var(--serif); font-size: 1.6rem; letter-spacing: 0; text-transform: none; color: var(--text); font-weight: 400; margin-bottom: 4px; }
.slot .tc { position: absolute; left: 10px; bottom: 10px; font-family: var(--mono); font-size: .65rem; letter-spacing: .1em; color: rgba(255,255,255,.6); background: rgba(0,0,0,.5); padding: 3px 6px; z-index: 2; }
.play { width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); display: grid; place-items: center; background: rgba(0,0,0,.35); transition: .2s; }
.play::after { content: ''; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.slot video.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.slot .play { position: relative; z-index: 2; transition: opacity .3s, background .2s; }
.card.previewing .play { opacity: 0; }
.card:hover .slot { transform: scale(1.015); }
.card:hover .play { background: rgba(0,0,0,.6); }
/* WEAVE: hilo dorado que bordea el video al pasar el mouse */
.slot::after { content: ''; position: absolute; inset: 6px; border: 1px solid var(--accent); clip-path: inset(0 100% 100% 0); transition: clip-path .7s cubic-bezier(.6,0,.2,1); pointer-events: none; z-index: 1; }
.card:hover .slot::after { clip-path: inset(0 0 0 0); }

/* SECTIONS — separadores como costuras */
.section { position: relative; padding: 112px var(--pad); }
.section + .section::before { content: ''; position: absolute; top: 0; left: var(--pad); right: var(--pad); height: 1px;
  background: repeating-linear-gradient(90deg, rgba(201,164,106,.35) 0 10px, transparent 10px 18px); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 56px; }
.scene { color: var(--accent); margin-bottom: 14px; }
.section h2 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
.big { font-size: clamp(2.4rem, 6vw, 5rem) !important; max-width: 1050px; }

/* Revelado al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* FILTERS + GRID */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { background: none; border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; border-radius: 999px; font: 400 .82rem var(--sans); cursor: pointer; transition: .2s; }
.filters button:hover { color: var(--text); }
.filters button.active { border-color: var(--text); color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; gap: 32px 20px; align-items: start; }
.card.landscape { grid-column: span 2; align-self: center; }
.card figcaption { margin-top: 14px; font-size: .88rem; }
.card .cat { color: var(--accent); font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; display: block; }
.card[hidden] { display: none; }

/* PROCESS — una sola línea con puntadas entre pasos */
.process-section .big { margin-bottom: 64px; }
.process-line { list-style: none; display: flex; align-items: center; justify-content: center; gap: 28px; font-size: 1.1rem; max-width: 980px; margin: 0 auto; }
.process-line li:not(.stitch) { white-space: nowrap; }
.process-line .mono { color: var(--accent); margin-right: 12px; font-size: .7rem; }
/* hilo ondulado entre pasos */
.process-line .stitch { flex: 0 1 120px; min-width: 60px; height: 12px; display: flex; }
.process-line .stitch svg { width: 100%; height: 100%; overflow: visible; }
.process-line .stitch path { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .8; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; stroke-linecap: round; }

/* ABOUT */
.about .big { margin-bottom: 56px; }
.about-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 48px; max-width: 1100px; color: var(--muted); font-size: 1.02rem; }
.about-cols p:first-child { color: var(--text); }
.principles { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 80px; }
.principles li { padding-top: 24px; position: relative; }
.principles li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: repeating-linear-gradient(90deg, rgba(201,164,106,.5) 0 8px, transparent 8px 14px); }
.principles .mono { color: var(--accent); display: block; margin-bottom: 16px; }
.principles h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; }

/* CONTACT */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.contact h2 { margin-bottom: 20px; }
.contact-intro p:not(.scene) { color: var(--muted); margin-bottom: 24px; max-width: 380px; }
.form { display: grid; gap: 18px; align-self: end; }
.form label { display: grid; gap: 6px; font-family: var(--mono); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.form input, .form select, .form textarea { background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: 300 1rem var(--sans); padding: 10px 0; outline: none; text-transform: none; letter-spacing: 0; }
.form select option { background: var(--bg); }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.form .btn { justify-self: start; margin-top: 8px; }
.form-note { color: var(--accent); font-size: .85rem; }
.form-note.error { color: #e88a7a; }
.form .btn:disabled { opacity: .6; cursor: progress; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* FOOTER */
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 40px var(--pad); color: var(--muted); border-top: 1px solid var(--line); }
.footer .fade { color: #4a4a4f; }

/* PLAYER MODAL */
.player { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.94); display: grid; place-items: center; padding: 24px; }
.player[hidden] { display: none; }
.player-frame { width: min(1200px, 100%); aspect-ratio: 16 / 9; background: #000; }
.player-frame.vertical { width: auto; height: min(85vh, 900px); aspect-ratio: 9 / 16; }
.player-frame iframe, .player-frame video { width: 100%; height: 100%; border: 0; display: block; }
.player-close { position: absolute; top: 16px; right: 24px; background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer; line-height: 1; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .nav nav { display: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .contact, .about-cols, .principles { grid-template-columns: 1fr; }
  .process-line { flex-direction: column; align-items: center; gap: 14px; }
  .process-line .stitch { flex: none; width: 12px; min-width: 0; height: 44px; }
  .process-line .stitch svg { width: 44px; height: 12px; transform: rotate(90deg); transform-origin: center; flex: none; margin-left: -16px; margin-top: 16px; }
  .nav-cta { display: inline-block; }
  .vf-meta, .vf-scene { display: none; }
  .thread { width: 28px; }
}
@media (max-width: 560px) {
  .grid { gap: 24px 12px; }
  .card figcaption { font-size: .8rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .vf-rec { left: 28px; } .vf-tc { right: 28px; }
  .thread { display: none; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .grain, .vf-rec i { animation: none; }
  .woven em { animation: none; }
  .woven-threads { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
