/* ==========================================================================
   TRATOINMO v4 · Marea — fotografía con aperturas, arco, cortinas,
   distorsión WebGL, grano y ajustes de la colección.
   El recorrido no se modifica.
   ========================================================================== */

/* ---------- Grano de película (PNG en mosaico) ---------- */
.grain { position: fixed; inset: -50%; z-index: 58; pointer-events: none; background: url(../assets/fotos/grano.png) repeat; background-size: 160px; opacity: .55; mix-blend-mode: overlay; transition: opacity .6s; animation: grain .9s steps(5) infinite; }
.grain.is-off { opacity: 0; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ---------- Cortinas: esquinas superiores que se aplanan ---------- */
main section.curtain { --cr: 0px; border-radius: var(--cr) var(--cr) 0 0; margin-top: -64px; }
@media (max-width: 760px) { main section.curtain { margin-top: -28px; } }

/* ---------- Aperturas fotográficas ---------- */
.aperture { position: relative; height: 210vh; background: var(--marino); }
.aperture--short { height: 170vh; }
.aperture__pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.aperture__win { position: absolute; inset: 0; overflow: hidden; clip-path: inset(20% 28% 20% 28% round 260px); will-change: clip-path; }
.aperture__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; will-change: transform; }
.aperture__win::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,28,38,.5) 0, rgba(10,28,38,0) 18%, rgba(10,28,38,0) 45%, rgba(10,28,38,.62)); }
.aperture__cap { position: absolute; z-index: 1; left: var(--g); right: var(--g); bottom: clamp(36px, 9vh, 96px); margin: 0; display: grid; gap: 10px; color: var(--bruma); }
.aperture__cap span { font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--espuma); }
.aperture__cap em { font-family: var(--f-edit); font-style: italic; font-weight: 300; font-size: clamp(2.2rem, 6.4vw, 6.4rem); line-height: .98; letter-spacing: -.02em; text-shadow: 0 6px 40px rgba(0,0,0,.35); max-width: 16ch; text-wrap: balance; }

/* ---------- Promesa: arco fotográfico ---------- */
.promise { background: linear-gradient(180deg, #CFE3EC 0%, #E4ECEA 45%, var(--arena) 100%) !important; }
.arch { position: absolute; z-index: 0; margin: 0; right: max(var(--g), calc((100% - var(--maxw)) / 2)); top: clamp(70px, 11vh, 130px); width: clamp(200px, 22vw, 340px); aspect-ratio: 0.74; }
main section > .arch { max-width: none; margin: 0; }
.arch__win { position: absolute; inset: 0; overflow: hidden; border-radius: 999px 999px 28px 28px; box-shadow: 0 50px 90px -50px rgba(16,56,71,.65); }
.arch__img { position: absolute; inset: -8% 0; width: 100%; height: 116%; max-width: none; object-fit: cover; will-change: transform; }
.arch__ring { position: absolute; inset: -16px -16px auto -16px; height: calc(100% + 32px); border: 1.5px solid var(--laton); border-radius: 999px 999px 36px 36px; pointer-events: none; opacity: .8; }
.arch__cap { position: absolute; left: 0; bottom: -34px; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: #4e6670; }
.promise .promise__lines { z-index: 1; }
.promise .pl--1 { text-shadow: 0 2px 30px rgba(233,238,233,.5); }
@media (max-width: 760px) {
  main section > .arch { position: relative; top: auto; right: auto; width: 54vw; margin: 0 0 8px auto; }
  .arch__cap { display: none; }
  .promise .promise__lines { padding-top: 0; }
}

/* ---------- Buscador: foto lateral con paralaje ---------- */
.search { overflow: hidden; }
.search__photo { position: absolute; z-index: 0; margin: 0; right: max(var(--g), calc((100% - var(--maxw)) / 2)); top: clamp(60px, 10vh, 120px); width: clamp(220px, 26vw, 400px); aspect-ratio: .78; border-radius: 28px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(16,56,71,.55); }
main section > .search__photo { max-width: none; margin: 0; }
.search__photo img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.search > :not(.search__photo) { position: relative; z-index: 1; }
@media (min-width: 1000px) {
  .search .h2, .search .lead, .search .qbar, .search .qtry, .search .qchips { margin-left: max(0px, calc((100% - var(--maxw)) / 2)) !important; margin-right: calc(clamp(220px, 26vw, 400px) + 48px + max(0px, calc((100% - var(--maxw)) / 2))) !important; max-width: none; }
  .search .qbar { box-shadow: 0 24px 60px -30px rgba(16,56,71,.45); }
}
@media (max-width: 999px) { .search__photo { position: relative; right: auto; top: auto; width: min(100%, 520px); aspect-ratio: 16 / 10; margin: 0 0 28px !important; } }

/* ---------- Colección: guardados y orden ---------- */
.collection__ctrl { flex-wrap: wrap; }
.seg button b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 99px; font-size: .68rem; background: var(--laton); color: var(--tinta); }
.sortsel select { appearance: none; -webkit-appearance: none; font: inherit; font-size: .85rem; color: var(--bruma); background: rgba(246,242,234,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23F6F2EA' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; border: 0; border-radius: 99px; padding: 9px 36px 9px 16px; cursor: pointer; }
.sortsel select:focus-visible { outline: 2px solid var(--turquesa); outline-offset: 2px; }
.sortsel option { color: var(--tinta); }
.col-empty { flex: 0 0 min(560px, 86vw); align-self: center; color: #a3bfc3; font-size: 1.1rem; padding: 40px 0; }
.col-empty em { font-family: var(--f-edit); font-size: 1.6rem; color: var(--laton-2); display: block; margin-bottom: 6px; }

/* ---------- Agua: lienzo WebGL sobre la foto de la tarjeta ---------- */
.liquid { max-width: none; position: absolute; z-index: 0; pointer-events: none; will-change: transform; }
.home__front > .home__shade, .home__front > .home__glare { z-index: 1; }
.home__front > .home__top, .home__front > .home__info { z-index: 2; }

/* ---------- Vender: fotografía de fondo ---------- */
.sell { overflow: hidden; isolation: isolate; }
.sell__bg { position: absolute !important; inset: 0; z-index: -1; max-width: none !important; margin: 0 !important; overflow: hidden; }
.sell__bg img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: .7; will-change: transform; }
.sell__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10,28,38,.94) 22%, rgba(10,28,38,.55) 58%, rgba(10,28,38,.7)); }
.sell .chat { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(10,28,38,.55); }

/* ---------- Cierre: letras con la foto adentro ---------- */
.velo__q { background: url(../assets/fotos/vista-sm.jpg) repeat-x center / auto 160%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.closing .velo { filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); }

/* la foto de la tarjeta debe poder ser más ancha que su caja (el reinicio global la limitaba al 100 %) */
.home__img { max-width: none !important; }
