/* ==========================================================================
   Frank Carrión — Filmmaker / Productor Audiovisual
   ========================================================================== */

:root {
    --bg: #0B0B0B;
    --bg-alt: #121212;
    --bg-media: #141414;
    --text: #F5F5F5;
    --text-2: #C9C4BD;
    --text-p: #DCD7D0;
    --text-3: #A39E97;
    --line: rgba(245, 245, 245, .16);
    --field: rgba(245, 245, 245, .32);
    --btn-hover: #D6D1CA;
    --pad-x: clamp(24px, 5vw, 72px);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --font-display: Syne, sans-serif;
    --font-body: Manrope, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text-p); }
::selection { background: var(--text); color: var(--bg); }
input, textarea, button { font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
img { display: block; }

@keyframes cue {
    0%   { transform: scaleY(0); transform-origin: top; }
    45%  { transform: scaleY(1); transform-origin: top; }
    55%  { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

.page { background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }

/* Etiqueta de sección ------------------------------------------------------ */
.eyebrow {
    display: flex; align-items: center; gap: 18px;
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(15px, 1.3vw, 18px); letter-spacing: .24em; text-transform: uppercase;
    color: var(--text);
}
.eyebrow > span:first-child { display: block; width: 40px; height: 1px; background: var(--text); }

.label { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--text-2); }

/* Header ------------------------------------------------------------------- */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 30px var(--pad-x);
    background: rgba(11, 11, 11, 0);
    border-bottom: 1px solid rgba(245, 245, 245, 0);
    transition: background .5s ease, padding .5s ease, border-color .5s ease;
}
.header.is-scrolled {
    padding: 16px var(--pad-x);
    background: rgba(11, 11, 11, .82);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(245, 245, 245, .08);
}
.header.is-menu { background: rgba(11, 11, 11, .82); }
.header__logo { display: flex; align-items: center; }
.header__logo img { height: 40px; width: auto; transition: height .5s ease; }
.header.is-scrolled .header__logo img { height: 30px; }
.header__nav { display: flex; gap: 44px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.header__nav a { opacity: .85; transition: opacity .3s ease; }
.header__nav a:hover { opacity: 1; color: var(--text); }

.burger {
    display: none; background: none; border: 0; padding: 12px 0 12px 12px; cursor: pointer;
    flex-direction: column; gap: 6px; align-items: flex-end; justify-content: center;
    min-width: 44px; min-height: 44px;
}
.burger span { display: block; height: 1px; background: var(--text); transition: transform .4s ease, width .4s ease; }
.burger span:first-child { width: 26px; }
.burger span:last-child { width: 18px; }
.burger.is-open span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger.is-open span:last-child { transform: translateY(-3.5px) rotate(-45deg) scaleX(1.45); }

.mobile-menu {
    position: fixed; inset: 0; z-index: 40; background: var(--bg);
    display: flex; flex-direction: column; justify-content: center; padding: 0 28px; gap: 8px;
    opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu > a { font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 1.25; letter-spacing: -.01em; }
.mobile-menu__social { margin-top: 48px; display: flex; gap: 20px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.mobile-menu__social a { color: var(--text-2); }

/* Hero --------------------------------------------------------------------- */
.hero { position: relative; height: 100vh; min-height: 560px; width: 100%; overflow: hidden; display: flex; align-items: flex-end; }
.hero__bg { position: absolute; inset: 0; background: var(--bg); }
.hero__thumb { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s ease; }
.hero__thumb[data-ready] { opacity: 1; }
.hero__video {
    position: absolute; top: 50%; left: 50%;
    width: max(100vw, 177.78vh); height: max(100vh, 56.25vw);
    transform: translate(-50%, -50%);
    border: 0; pointer-events: none; background: var(--bg); color-scheme: dark;
    /* Oculto de verdad mientras carga: con opacity:0 el navegador sigue
       componiendo el iframe y puede asomar el fondo claro del reproductor. */
    opacity: 0; visibility: hidden;
    transition: opacity 1s var(--ease), visibility 0s linear 1s;
}
.hero__video.is-ready {
    opacity: 1; visibility: visible;
    transition: opacity 1s var(--ease), visibility 0s;
}
.hero__overlay { position: absolute; inset: 0; background: #000; opacity: .25; }
.hero__gradient {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(11,11,11,.55) 0%, rgba(11,11,11,0) 22%, rgba(11,11,11,.15) 45%, rgba(11,11,11,.9) 100%);
}
.hero__content {
    position: relative; width: 100%;
    padding: 0 var(--pad-x) clamp(40px, 8vh, 88px);
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px;
}
.hero__text { max-width: 1100px; }
.hero__kicker { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--text); text-shadow: 0 1px 12px rgba(0,0,0,.7); margin-bottom: 28px; }
.hero__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 8.4vw, 132px); line-height: .94; letter-spacing: -.035em; text-wrap: balance; }
.hero__cta { display: flex; align-items: center; gap: 18px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; padding: 12px 0; }
.hero__cue { position: relative; display: block; width: 1px; height: 56px; background: rgba(245,245,245,.18); overflow: hidden; }
.hero__cue span { position: absolute; inset: 0; background: var(--text); animation: cue 2.4s cubic-bezier(.6,0,.2,1) infinite; }
.hero__cta-label { white-space: nowrap; text-shadow: 0 1px 12px rgba(0,0,0,.7); }

/* Servicios ---------------------------------------------------------------- */
.works { padding: clamp(96px, 16vh, 180px) var(--pad-x) clamp(80px, 12vh, 140px); }
.works__eyebrow { margin-bottom: clamp(72px, 12vh, 140px); }
.works__groups { display: flex; flex-direction: column; gap: clamp(110px, 18vh, 220px); }

.group__head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; margin-bottom: clamp(48px, 8vh, 96px); }
.group__num { font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; color: var(--text-3); }
.group__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5.4vw, 84px); line-height: 1; letter-spacing: -.03em; text-wrap: balance; max-width: 14ch; }
.group__rule { display: block; width: 48px; height: 1px; background: rgba(245,245,245,.35); margin-top: 6px; }
.group__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px); row-gap: 44px; align-items: start; }

.card { cursor: pointer; width: 100%; outline: none; }
.card--offset { margin-top: clamp(40px, 8vw, 120px); }
.card__frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-alt); }
.card__media { position: absolute; inset: 0; background: var(--bg-media); transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__media iframe {
    position: absolute; top: 0; left: 50%; width: 150%; height: 100%; transform: translateX(-50%);
    border: 0; pointer-events: none; background: #000; color-scheme: dark;
    opacity: 0; transition: opacity .8s ease .3s;
}
.card__media iframe.is-loaded { opacity: 1; }
.card__shade { position: absolute; inset: 0; background: rgba(0,0,0,.25); opacity: 1; transition: opacity .6s ease; }
.card__play {
    position: absolute; left: 22px; bottom: 20px; display: flex; align-items: center; gap: 12px;
    font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
    opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease;
}
.card__play-icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(245,245,245,.7); display: flex; align-items: center; justify-content: center; font-size: 10px; }

.card.is-hover .card__media { transform: scale(1.045); }
.card.is-hover .card__shade { opacity: 0; }
.card.is-hover .card__play,
.card:focus-visible .card__play { opacity: 1; transform: none; }

/* Perfil ------------------------------------------------------------------- */
.about { padding: clamp(80px, 14vh, 160px) var(--pad-x); border-top: 1px solid var(--line); }
.about__eyebrow { margin-bottom: clamp(40px, 7vh, 80px); }
.about__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(48px, 7vw, 120px); align-items: start; }
.about__bio { max-width: 560px; display: flex; flex-direction: column; gap: 24px; font-size: 18px; line-height: 1.75; color: var(--text-p); }
.about__bio p { margin: 0; }
.about__photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-media); }
.about__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Colaboraciones ----------------------------------------------------------- */
.clients { margin-top: clamp(96px, 16vh, 180px); }
.clients__eyebrow { margin-bottom: 40px; }
.clients__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.clients__cell {
    height: 140px; display: flex; align-items: center; justify-content: center; padding: 0 28px;
    border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
    opacity: .78; transition: opacity .5s ease;
}
.clients__cell:hover { opacity: 1; }
.clients__cell img { max-width: 100%; width: auto; height: auto; object-fit: contain; }

/* Contacto ----------------------------------------------------------------- */
.contact { padding: clamp(96px, 16vh, 180px) var(--pad-x) 40px; background: var(--bg-alt); }
.contact__eyebrow { margin-bottom: 32px; }
.contact__title { margin: 0 0 clamp(56px, 9vh, 96px); font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 8vw, 128px); line-height: .95; letter-spacing: -.035em; text-transform: uppercase; }
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: clamp(56px, 7vw, 120px); }
.contact__info { display: flex; flex-direction: column; gap: 44px; }
.contact__email { background: none; border: 0; padding: 0; color: var(--text); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.contact__email-label { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--text-2); transition: color .4s ease; }
.contact__email.is-copied .contact__email-label { color: var(--text); }
.contact__email-value {
    font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.6vw, 36px); letter-spacing: -.02em;
    border-bottom: 1px solid rgba(245,245,245,.25); padding-bottom: 8px; word-break: break-all; transition: border-color .3s ease;
}
.contact__email:hover .contact__email-value { border-bottom-color: var(--text); }
.contact__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.contact__meta > div { display: flex; flex-direction: column; gap: 10px; font-size: 17px; }
.contact__social { display: flex; flex-wrap: wrap; gap: 28px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }

.contact__form { display: flex; flex-direction: column; gap: 36px; }
.contact__form input,
.contact__form textarea {
    background: transparent; border: 0; border-bottom: 1px solid var(--field); border-radius: 0;
    color: var(--text); font-size: 17px; padding: 14px 0; outline: none; transition: border-color .3s ease;
}
.contact__form textarea { resize: none; }
.contact__form input:focus,
.contact__form textarea:focus { border-bottom-color: var(--text); }
.contact__form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
    align-self: flex-start; background: var(--text); color: var(--bg); border: 0; border-radius: 999px;
    padding: 18px 34px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; cursor: pointer;
    transition: background .4s ease;
}
.btn:hover { background: var(--btn-hover); }
.btn:disabled { cursor: progress; opacity: .7; }

.footer {
    margin-top: clamp(96px, 14vh, 160px); padding-top: 28px; border-top: 1px solid var(--line);
    display: flex; justify-content: center; text-align: center; font-size: 12px; color: var(--text-3); letter-spacing: .08em;
}

/* Notificación (toast) ----------------------------------------------------- */
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.toast {
    position: fixed; z-index: 90; right: var(--pad-x); bottom: clamp(20px, 4vh, 40px);
    width: min(420px, calc(100vw - 2 * var(--pad-x)));
    display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 16px;
    padding: 20px 20px 22px; overflow: hidden;
    background: var(--text); color: var(--bg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    opacity: 0; transform: translateY(24px);
    transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.toast[hidden] { display: none; }
.toast.is-visible { opacity: 1; transform: none; }
.toast__icon {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid currentColor;
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
}
.toast__body { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.toast__title { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; line-height: 1.2; }
.toast__text { font-size: 14px; line-height: 1.55; opacity: .78; }
.toast__close {
    background: none; border: 0; color: inherit; cursor: pointer; font-size: 13px;
    width: 32px; height: 32px; margin: -6px -6px 0 0; opacity: .55; transition: opacity .3s ease;
}
.toast__close:hover { opacity: 1; }
.toast__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; opacity: .35; transform-origin: left; }
.toast.is-visible.toast--success .toast__bar { animation: toast-bar 6s linear forwards; }
.toast.is-visible.toast--error .toast__bar { animation: toast-bar 8s linear forwards; }

.toast--error { background: #1A1A1A; color: var(--text); border: 1px solid rgba(232, 165, 152, .45); }
.toast--error .toast__icon { color: #E8A598; }

@media (prefers-reduced-motion: reduce) {
    .toast { transition: opacity .2s linear; transform: none; }
    .toast__bar { display: none; }
}

/* Lightbox ----------------------------------------------------------------- */
.lightbox {
    position: fixed; inset: 0; z-index: 100; background: rgba(6,6,6,.96);
    display: flex; align-items: center; justify-content: center; padding: clamp(16px, 5vw, 80px);
}
.lightbox[hidden] { display: none; }
.lightbox__close {
    position: absolute; top: 20px; right: clamp(16px, 4vw, 48px); background: none; border: 0; color: var(--text);
    font-size: 12px; letter-spacing: .22em; text-transform: uppercase; cursor: pointer; min-height: 44px; padding: 0 4px;
}
.lightbox__inner { width: 100%; max-width: 1280px; }
.lightbox__player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.lightbox__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; color-scheme: dark; }
.lightbox__caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 22px; }
.lightbox__title { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
.lightbox__category { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }

/* Móvil -------------------------------------------------------------------- */
@media (max-width: 819.98px) {
    .header__nav { display: none; }
    .burger { display: flex; }
    .header__logo img { height: 30px; }
    .group__grid { grid-template-columns: minmax(0, 1fr); }
    .card--offset { margin-top: 0; }
    .card__play { opacity: 1; transform: none; }

    /* Zonas táctiles más cómodas (≈44px) sin cambiar el aspecto */
    .header__logo { min-height: 44px; }
    .contact__social, .mobile-menu__social { gap: 8px 24px; }
    .contact__social a, .mobile-menu__social a { display: inline-flex; align-items: center; min-height: 44px; }
    .contact__meta a { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; }
    .contact__meta { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .contact__email { padding: 6px 0; }
    .hero__cta { min-height: 44px; }
    .lightbox__close { top: 12px; min-width: 44px; }
    .toast { right: 16px; left: 16px; width: auto; bottom: 16px; }
}
@media (min-width: 820px) {
    .mobile-menu { display: none; }
}
