/* Phone and small-tablet adjustments shared by every page. */
@media (max-width: 760px) {
  header { flex-wrap: wrap !important; row-gap: 14px !important; padding-top: 18px !important; padding-bottom: 18px !important; }
  header nav { order: 3; width: 100%; flex-wrap: nowrap !important; overflow-x: auto; gap: 22px !important; padding-bottom: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  header nav::-webkit-scrollbar { display: none; }
  header nav a, header nav .dd { white-space: nowrap; flex: 0 0 auto; }
  .dd-menu { display: none !important; }
  section[style*="980px"] { min-height: 0 !important; }
  section[style*="980px"] > div[style*="padding"], section[style*="980px"] > div > div[style*="flex: 0 1"] { min-width: 0 !important; }
  section[style*="980px"] div[style*="flex: 0 1"] { flex: 1 1 100% !important; width: auto !important; }
  section[style*="980px"] [style*="flex-direction: column"] > * { width: auto !important; max-width: 100% !important; }
  p[style*="width:"], h1[style*="width:"], h2[style*="width:"], h3[style*="width:"] { width: auto !important; max-width: 100% !important; }
  h1[style*="120px"], h1[style*="96px"] { font-size: calc((76px) * var(--fs, 1)) !important; }
  .totop { right: 16px; bottom: 16px; width: 46px; height: 46px; }
}

/* Hide the slide counter while a video plays so it does not cover the player controls */
section:has(iframe[data-yt-player]) [data-vcount]{display:none}

/* Page transitions: fade in on load, fade out when leaving */
@keyframes ely-page{from{opacity:0;transform:translateY(36px);filter:blur(8px)}to{opacity:1;transform:none;filter:none}}
body{animation:ely-page 1.3s cubic-bezier(.22,.61,.36,1) backwards}
html.ely-leaving body{opacity:0;transform:translateY(-28px);filter:blur(6px);transition:opacity .6s ease,transform .6s ease,filter .6s ease}
@media (prefers-reduced-motion: reduce){@keyframes ely-page{from{opacity:0}to{opacity:1}}html.ely-leaving body{transform:none;filter:none}}

/* Discography: all six releases on one row from tablet up */
@media (min-width: 1280px){#musica>div[style*="grid-template-columns"]{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:20px!important}}
@media (min-width: 761px) and (max-width: 1279px){#musica>div[style*="grid-template-columns"]{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:32px 24px!important}}
#musica .arch span:first-of-type{white-space:nowrap}

/* "overflow: hidden" turns a box into a scroll container, which freezes the scroll-linked fades inside it; "clip" looks the same without that side effect */
[style*="overflow: hidden"]{overflow:clip!important}

/* Desktop header: sections sit right after the logo, language switch stays at the far right */
@media (min-width: 1100px){header{position:relative}header>nav{position:absolute;left:50%;transform:translateX(-50%)}}

/* Footer on desktop: columns sit to the right of the logo, copyright on its own line */
@media (min-width: 761px){
  footer>div{justify-content:flex-start!important;align-items:flex-start!important;column-gap:72px!important}
  footer>div>div{flex:1 1 0;flex-wrap:nowrap!important;gap:56px!important;min-width:0}
  footer>div>div>div{flex:1 1 0;min-width:0}
  footer>div>span:last-child{flex-basis:100%}
}

/* Bio carousel: each new photo arrives softly (class toggled by site.js) */
@keyframes ely-slide{from{opacity:0;transform:scale(1.08);filter:blur(10px)}to{opacity:1;transform:none;filter:none}}
#bio img.ely-slide-in{animation:ely-slide 1.4s cubic-bezier(.22,.61,.36,1) both}

/* Chapter galleries: gentle grow on hover, click to enlarge */
div[style*="columns:"]>img{cursor:zoom-in;position:relative;transition:scale .45s cubic-bezier(.2,.7,.2,1),box-shadow .45s ease}
div[style*="columns:"]>img:hover{scale:1.05;z-index:2;box-shadow:0 18px 40px rgba(0,0,0,.28)}
.ely-lb{position:fixed;inset:0;z-index:120;background:rgba(18,14,12,.92);display:flex;align-items:center;justify-content:center;padding:56px 88px;box-sizing:border-box;animation:ely-lb-in .35s ease both}
.ely-lb img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px;box-shadow:0 30px 80px rgba(0,0,0,.5);animation:ely-lb-img .45s cubic-bezier(.2,.7,.2,1) both}
.ely-lb button{position:absolute;width:52px;height:52px;border-radius:999px;border:1px solid #FAF6F0;background:rgba(0,0,0,.25);color:#FAF6F0;font-size: calc((22px) * var(--fs, 1));cursor:pointer;display:flex;align-items:center;justify-content:center}
.ely-lb button:hover{background:rgba(250,246,240,.15)}
.ely-lb [data-lb="close"]{top:20px;right:20px}.ely-lb [data-lb="prev"]{left:20px;top:50%;margin-top:-26px}.ely-lb [data-lb="next"]{right:20px;top:50%;margin-top:-26px}
.ely-lb span{position:absolute;bottom:20px;left:0;right:0;text-align:center;color:#E3D8CB;font:700 12px Manrope,sans-serif;letter-spacing:.16em}
@keyframes ely-lb-in{from{opacity:0}to{opacity:1}}
@keyframes ely-lb-img{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}
@media (max-width:760px){.ely-lb{padding:64px 12px}.ely-lb [data-lb="prev"],.ely-lb [data-lb="next"]{top:auto;bottom:12px;margin:0}}
@media (max-width: 760px){.cover-actions{gap:10px!important}.cover-actions a{font-size: calc((10px) * var(--fs, 1))!important;letter-spacing:.06em!important}}
.ely-lb [data-lb-dl]{position:absolute;top:20px;left:20px;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 20px;border:1px solid #FAF6F0;border-radius:999px;color:#FAF6F0;font:700 12px Manrope,sans-serif;letter-spacing:.14em;text-transform:uppercase;background:rgba(0,0,0,.25)}
.ely-lb [data-lb-dl]:hover{background:#FAF6F0;color:#2B2522}

/* Live albums */
.ely-album{flex-direction:column;gap:14px;padding:24px 88px 20px}
.ely-album .alb-head{display:flex;flex-direction:column;align-items:center;gap:4px;color:#FAF6F0;text-align:center}
.ely-album .alb-meta{position:static!important;font:700 12px Manrope,sans-serif;letter-spacing:.16em;text-transform:uppercase;color:#F3C79A}
.ely-album .alb-title{position:static!important;font-family:'Bodoni Moda',serif;font-style:italic;font-size: calc((30px) * var(--fs, 1));letter-spacing:0;color:#FAF6F0}
.ely-album .alb-stage{flex:1 1 auto;min-height:0;width:100%;display:flex;align-items:center;justify-content:center}
.ely-album .alb-stage img,.ely-album .alb-stage video{max-width:100%;max-height:100%;border-radius:6px;box-shadow:0 30px 80px rgba(0,0,0,.5);animation:ely-lb-img .45s cubic-bezier(.2,.7,.2,1) both;background:#000}
.ely-album .alb-thumbs{display:flex;gap:8px;max-width:100%;overflow-x:auto;padding:4px;scrollbar-width:none}
.ely-album .alb-thumbs button{position:relative!important;flex:0 0 auto;width:84px;height:84px;padding:0;border-radius:6px!important;border:2px solid transparent!important;overflow:hidden;background:#000!important;opacity:.6;transition:opacity .25s,border-color .25s;top:auto!important;left:auto!important;right:auto!important;margin:0!important}
.ely-album .alb-thumbs button.on,.ely-album .alb-thumbs button:hover{opacity:1;border-color:#F3C79A!important}
.ely-album .alb-thumbs img{width:100%;height:100%;object-fit:cover;animation:none;box-shadow:none;border-radius:0}
.ely-album .alb-thumbs i{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#FAF6F0;font-style:normal;font-size: calc((20px) * var(--fs, 1));text-shadow:0 1px 6px rgba(0,0,0,.7)}
@media (max-width:760px){.ely-album{padding:64px 12px 16px}.ely-album .alb-title{font-size:22px}.ely-album .alb-thumbs button{width:60px;height:60px}}
.ely-album .alb-stage iframe.alb-ig{border:0;border-radius:12px;background:#fff;box-shadow:0 30px 80px rgba(0,0,0,.5)}

/* ---------- Mobile pass ---------- */
.ely-mm-btn,.ely-mm{display:none}
@media (max-width: 760px){
  /* Menu: hide the header link row, show a floating menu button */
  header nav, header > span:last-child, header > div:last-child{display:none!important}
  footer nav a{display:inline-block;padding:7px 0}
  .ely-mm-btn{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;position:fixed;top:14px;right:14px;z-index:1000;width:48px;height:48px;border:0;border-radius:999px;background:rgba(30,22,18,.55);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);cursor:pointer;padding:0}
  .ely-mm-btn span{display:block;width:20px;height:2px;border-radius:2px;background:#FAF6F0;transition:transform .3s ease,opacity .2s ease}
  html.ely-menu-open .ely-mm-btn span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  html.ely-menu-open .ely-mm-btn span:nth-child(2){opacity:0}
  html.ely-menu-open .ely-mm-btn span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
  .ely-mm{display:flex;flex-direction:column;justify-content:space-between;position:fixed;inset:0;z-index:999;padding:96px 28px 40px;box-sizing:border-box;background:var(--dk,#2B2522);background:#1E1612;color:#FAF6F0;overflow-y:auto;opacity:0;visibility:hidden;transform:translateY(-12px);transition:opacity .35s ease,transform .35s ease,visibility .35s}
  .ely-mm.on{opacity:1;visibility:visible;transform:none}
  html.ely-menu-open,html.ely-menu-open body{overflow:hidden}
  .ely-mm .mm-list{display:flex;flex-direction:column;gap:2px}
  .ely-mm .mm-link,.ely-mm .mm-head{display:block;padding:8px 0;font-family:'Bodoni Moda',serif;font-style:italic;font-size:24px;line-height:1.2;color:#FAF6F0;text-decoration:none}
  .ely-mm .mm-group{display:flex;flex-direction:column;gap:2px;padding:4px 0 8px}
  .ely-mm .mm-sub{display:block;padding:7px 0 7px 18px;font-family:Manrope,sans-serif;font-size:12px;color:#E8DDD2;text-decoration:none;border-left:1px solid rgba(250,246,240,.25)}
  .ely-mm .mm-sub:first-of-type{font-weight:700;font-size:10px;letter-spacing:.18em;text-transform:uppercase;color:#F3C79A}
  .ely-mm .mm-lang{display:flex;gap:10px;font-size:11px;font-weight:700;letter-spacing:.14em;color:#FAF6F0}
  .ely-mm .mm-lang a{color:#FAF6F0;text-decoration:none;padding:8px 4px}
  .ely-mm .mm-lang a[aria-current]{color:#F3C79A}
  header{padding-top:20px!important;padding-bottom:20px!important;padding-right:76px!important}
  a#top[href="#musica"]{padding-left:20px!important;padding-right:72px!important;text-align:left!important}

  /* Home bio: keep the slide controls below the buttons */
  #bio > div[style*="padding: 140px"]{padding-top:28px!important;padding-bottom:56px!important}
  #bio > div[style*="right: clamp"]{top:calc(min(68vh, 560px) - 70px)!important;bottom:auto!important;right:20px!important}
  #bio > div[style*="bottom: 36px"]{top:calc(min(68vh, 560px) - 22px)!important;bottom:auto!important}
  #bio > div[style*="right: clamp"] button{width:46px!important;height:46px!important}
  #bio button[aria-label^="Ver foto"]{position:relative}
  #bio button[aria-label^="Ver foto"]::after{content:"";position:absolute;inset:-14px -6px}

  /* Discography: bigger "Ver página / Escuchar" */
  .cover-actions{gap:14px!important}
  .cover-actions a{font-size: calc((12px) * var(--fs, 1))!important;letter-spacing:.08em!important;padding:8px 0!important}

  /* Live albums: horizontal swipe instead of a long column */
  #shows div:has(> a.live-card){display:flex!important;grid-template-columns:none!important;gap:16px!important;overflow-x:auto;scroll-snap-type:x mandatory;margin:0 calc(-1 * clamp(24px, 5vw, 80px));padding:0 clamp(24px, 5vw, 80px) 8px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  #shows div:has(> a.live-card)::-webkit-scrollbar{display:none}
  #shows a.live-card{flex:0 0 78%;scroll-snap-align:start}
  #shows a.live-card span[style*="Bodoni"]{font-size:20px!important}

  /* EP pages: video slides follow the screen width */
  div[style*="scroll-snap-align: start"][style*="min-height: 420px"]{min-height:0!important}
  [data-vnav]{width:44px!important;height:44px!important}
  a.play{width:76px!important;height:76px!important}
  section div[style*="flex: 2 1"][style*="height:"]{height:auto!important}

  /* Small labels readable */
  [style*="font-size: 10px"]{font-size:11px!important}
}

/* ---------- Mobile pass 2 ---------- */
@media (max-width: 760px){
  :root{--fs:.8}
  /* Hero slides: full photo on top, text below */
  section[style*="980px"]{flex-direction:column!important;min-height:0!important}
  section[style*="980px"] > div[style*="position: absolute; inset: 0"]{position:relative!important;inset:auto!important;order:-1;flex:none!important;width:100%;height:min(68vh, 560px)}
  section[style*="980px"] > div[style*="position: absolute; inset: 0"]{-webkit-mask-image:linear-gradient(to bottom,#000 72%,transparent);mask-image:linear-gradient(to bottom,#000 72%,transparent)}
  section[style*="980px"] > div[style*="position: absolute; inset: 0"]::after{display:none!important}
  section[style*="980px"] > div[style*="position: absolute; inset: 0"] > div[aria-hidden]{background:linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 26%)!important}
  section.light-hero > div[style*="position: absolute; inset: 0"] > div[aria-hidden]{background:linear-gradient(to bottom, rgba(250,246,240,.5) 0%, rgba(250,246,240,0) 26%)!important}
  section[style*="980px"] > div[style*="padding: 140px"]{padding-top:28px!important;padding-bottom:56px!important}
  section[style*="980px"] img{object-position:center 22%}
}
@media (max-width: 760px){
  #bio > div[style*="position: absolute; inset: 0"] img{left:0!important;right:0!important;width:100%!important;transform:none!important;-webkit-mask-image:none!important;mask-image:none!important}
}

/* ---------- Mobile pass 3 ---------- */
@media (max-width: 760px){
  /* 1. Streaming buttons 20% smaller */
  #musica a.btn-ghost[href*="spotify"],#musica a.btn-ghost[href*="music.apple"],#musica a.btn-ghost[href*="music.youtube"],#musica a.btn-ghost[href*="music.amazon"],#musica a.btn-ghost[href*="bandcamp"]{min-height:42px!important;padding:0 22px!important;font-size:calc(15px * var(--fs,1) * .8)!important}
  /* 2. Release bar on one line */
  a#top[href="#musica"]{font-size: calc((9.6px) * var(--fs, 1))!important;letter-spacing:.03em!important;padding-right:64px!important;padding-left:14px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-top:12px!important;padding-bottom:12px!important}
  /* 3. Proyecto: tighter gap between "Experiencia expandida" and "En video" */
  section:has(> div > div > p) + section#reels{padding-top:8px!important}
  section:has(+ section#reels) > div{padding-bottom:40px!important;gap:20px!important}
  /* 4. angel hero centered */
  section[style*="980px"] img[src*="4773c5edeef2a94d140ea1760e2315c8"]{object-position:76% center!important}
  /* 5. about you hero 20% zoom */
  section[style*="980px"] img[src*="dc90377001f6595059ca143b2b7ccb6c"]{transform:scale(1.2);transform-origin:center 35%}
  /* 6. imposible hero fills the slide, shifted */
  section[style*="980px"] img[src*="b8d7d9426bd18740b3f59384855e99e3"]{object-fit:cover!important;object-position:70% top!important}
  section[style*="980px"]:has(img[src*="b8d7d9426bd18740b3f59384855e99e3"]) > div > div[aria-hidden]{background:linear-gradient(to bottom, rgba(245,243,244,.6) 0%, rgba(245,243,244,0) 20%)!important}
  /* 7. Bio arrows 20% smaller */
  #bio > div[style*="right: clamp"] button{width:37px!important;height:37px!important}
  #bio > div[style*="right: clamp"] button svg{width:16px;height:16px}
}
@media (max-width: 760px){
  #shows div:has(> a.live-card){scroll-padding-left:clamp(24px, 5vw, 80px);scroll-padding-right:clamp(24px, 5vw, 80px)}
  a#top[href="#musica"]{text-align:center!important;padding-left:58px!important;padding-right:58px!important;justify-content:center!important;font-size: calc((8.8px) * var(--fs, 1))!important;letter-spacing:.02em!important}
  #bio > div[style*="padding: 140px"]{padding-top:0!important;margin-top:-20px!important}
  #bio > div[style*="right: clamp"]{top:calc(min(68vh, 560px) - 120px)!important}
  #bio > div[style*="bottom: 36px"]{top:calc(min(68vh, 560px) - 70px)!important}
}
@media (max-width: 760px){
  /* Text starts over the bottom of the photo, photo keeps full height (except Proyecto) */
  section[style*="980px"] > div[style*="position: absolute; inset: 0"]{-webkit-mask-image:linear-gradient(to bottom,#000 58%,transparent 96%)!important;mask-image:linear-gradient(to bottom,#000 58%,transparent 96%)!important}
  section[style*="980px"] > div[style*="padding: 140px"]{margin-top:calc(-1 * min(13.6vh, 112px))!important}
  section[style*="980px"]:has(img[src*="5ff0f65d66f0fc860ed848ff0a775d14"]) > div[style*="padding: 140px"]{margin-top:calc(-20px - min(13.6vh, 112px))!important}
  #bio > div[style*="padding: 140px"]{margin-top:calc(-20px - min(13.6vh, 112px))!important}
  #bio > div[style*="right: clamp"]{top:calc(min(54vh, 448px) - 120px)!important}
  #bio > div[style*="bottom: 36px"]{top:calc(min(54vh, 448px) - 70px)!important}
}
@media (max-width: 760px){
  /* Subtle bio controls: small chevrons at the photo edges, no counter */
  #bio > div[style*="right: clamp"]{top:calc(min(68vh, 560px) * .42)!important;left:8px!important;right:8px!important;justify-content:space-between!important;pointer-events:none}
  #bio > div[style*="right: clamp"] > span{display:none!important}
  #bio > div[style*="right: clamp"] button{pointer-events:auto;width:34px!important;height:34px!important;border:0!important;background:rgba(0,0,0,.18)!important;opacity:.7;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
  #bio > div[style*="right: clamp"] button svg{width:14px;height:14px}
  #bio > div[style*="bottom: 36px"]{top:calc(min(68vh, 560px) - 172px)!important;gap:6px!important;opacity:.75}
  #bio > div[style*="bottom: 36px"] button{transform:scale(.63)}
}
#bio{touch-action:pan-y}html,body{overscroll-behavior-x:none}
@media (max-width: 760px){
  /* imposible: vertical original photo on phones */
  section[style*="980px"] > div[style*="position: absolute; inset: 0"]:has(img[src*="b8d7d9426bd18740b3f59384855e99e3"]){background:#F5F3F4 url(/img/imposible-movil.webp) 52% 10% / 130% auto no-repeat}
  section[style*="980px"] img[src*="b8d7d9426bd18740b3f59384855e99e3"]{opacity:0}
}
.pj-ctrl,.pj-dots{display:none}
@media (max-width: 760px){
  section:has(.pj-slides){touch-action:pan-y}
  .pj-ctrl{display:flex;justify-content:space-between;position:absolute;left:8px;right:8px;top:calc(min(68vh, 560px) * .42);z-index:3;pointer-events:none}
  .pj-ctrl button{pointer-events:auto;width:34px;height:34px;border:0;border-radius:999px;background:rgba(0,0,0,.18);color:#FAF6F0;opacity:.7;display:flex;align-items:center;justify-content:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:pointer}
  .pj-dots{display:flex;justify-content:center;gap:6px;position:absolute;left:0;right:0;top:calc((min(68vh, 560px) - 172px) * 1.16);z-index:3;opacity:.75}
  .pj-dots button{width:10px;height:10px;cursor:pointer;padding:0;border:0;border-radius:999px;background:rgba(250,246,240,.45);transform:scale(.63);transition:width .3s ease}
  .pj-dots button.on{width:28px;background:#FAF6F0}
}
.cap-nav{display:none}
@media (max-width: 760px){
  /* Proyecto · Recorrer la historia: horizontal swipe + arrows */
  #capitulos{gap:28px!important;padding-top:80px!important;padding-bottom:80px!important}
  #capitulos > div[style*="grid-template-columns"]{display:flex!important;gap:16px!important;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding:0 clamp(24px, 5vw, 80px);width:auto!important;align-self:stretch;margin:0 calc(-1 * clamp(24px, 5vw, 80px));padding:0 clamp(24px, 5vw, 80px) 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  #capitulos > div[style*="grid-template-columns"]::-webkit-scrollbar{display:none}
  #capitulos > div[style*="grid-template-columns"] > a{flex:0 0 72%;scroll-snap-align:start}
  .cap-nav{display:none!important}
  .cap-nav button{width:44px;height:44px;border:1px solid #2B2522;border-radius:999px;background:transparent;color:#2B2522;display:flex;align-items:center;justify-content:center;cursor:pointer}
}
@media (max-width: 760px){
  /* Home · El proyecto: chapters swipe sideways */
  #historia div[style*="grid-template-columns"]:has(> a.arch){display:flex!important;gap:16px!important;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding:0 clamp(24px, 5vw, 80px);width:auto!important;max-width:none!important;align-self:stretch;margin:0 calc(-1 * clamp(24px, 5vw, 80px));padding:0 clamp(24px, 5vw, 80px) 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  #historia div[style*="grid-template-columns"]:has(> a.arch)::-webkit-scrollbar{display:none}
  #historia div[style*="grid-template-columns"] > a.arch{flex:0 0 72%;scroll-snap-align:start}
}
