/*
  The VIP Ibiza — motion layer: VIP-01 "Signature" (logo reveal on first visit)
  and VIP-04 "Open House" (the villas plates). To remove either one, see the
  matching comment in index.html; deleting the <link>/<script> tags for
  vip-motion.css / vip-motion.js removes both and the page falls back to plain content.
*/

/* ── VIP-01  Signature ─────────────────────────────────────────────
   Shown once per browser session, about 2.6 s, then it removes itself.
   It is pure CSS, so it always ends even if scripts fail. */
.sig-intro{
  position:fixed; inset:0; z-index:1000; background:#f5f3ef; display:grid; place-items:center;
  animation:sig-out .8s 2.3s ease forwards; cursor:pointer;
}
@keyframes sig-out{ to{ opacity:0; visibility:hidden; } }
.sig-logo{ position:relative; width:min(56vw, 360px); aspect-ratio:1000 / 673; }
.sig-logo span{ position:absolute; inset:0; }
.sig-logo i{
  position:absolute; inset:0; background:#0c0c0c;
  -webkit-mask:url(logo-signature.png) center / 100% 100% no-repeat; mask:url(logo-signature.png) center / 100% 100% no-repeat;
}
/* the script, written left to right */
.sig-a{
  clip-path:inset(0 0 15% 0);
  -webkit-mask-image:linear-gradient(90deg,#000 0,#000 44%,transparent 56%); mask-image:linear-gradient(90deg,#000 0,#000 44%,transparent 56%);
  -webkit-mask-size:230% 100%; mask-size:230% 100%; -webkit-mask-position:100% 0; mask-position:100% 0;
  animation:sig-write 1.5s .25s cubic-bezier(.45,0,.3,1) forwards;
}
@keyframes sig-write{ to{ -webkit-mask-position:0 0; mask-position:0 0; } }
/* IBIZA settles beneath it */
.sig-b{ clip-path:inset(85% 0 0 0); opacity:0; animation:sig-in .7s 1.45s ease forwards; }
@keyframes sig-in{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
.sig-logo::after{
  content:''; position:absolute; left:50%; bottom:-22px; width:44px; height:1px; margin-left:-22px; background:#0c0c0c;
  transform:scaleX(0); animation:sig-rule .7s 1.7s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes sig-rule{ to{ transform:scaleX(1); } }

/* ── VIP-04  Open House ────────────────────────────────────────────── */
.oh-head{ display:grid; grid-template-columns:1fr 1fr; gap:clamp(2.5rem,6vw,6.5rem); align-items:end; padding-top:8rem; }
.oh-head h2{ margin-bottom:0; }
.oh-plates{ display:grid; grid-template-columns:repeat(3,1fr); gap:clamp(.9rem,1.8vw,1.6rem); padding-top:4.5rem; padding-bottom:8rem; }
.oh-plate{
  display:block; width:100%; padding:0; border:0; background:none; text-align:left; cursor:pointer; color:inherit; font:inherit; text-decoration:none;
}
.oh-plate .oh-img{ display:block; overflow:hidden; border-radius:16px; aspect-ratio:4 / 5; background:#e9e7e2; }
.oh-plate img{ width:100%; height:100%; object-fit:cover; display:block; transition:transform 1.4s cubic-bezier(.22,1,.36,1); }
.oh-plate .oh-no{ display:flex; justify-content:space-between; margin-top:1rem; font-size:.66rem; letter-spacing:.34em; text-transform:uppercase; font-weight:500; }
.oh-plate .oh-no em{ font-style:normal; color:var(--grey); letter-spacing:.24em; opacity:0; transform:translateX(-6px); transition:opacity .4s ease, transform .4s ease; }
.oh-plate:focus-visible{ outline:2px solid var(--ink); outline-offset:6px; border-radius:16px; }
@media (hover:hover){
  .oh-plate:hover img{ transform:scale(1.05); }
  .oh-plate:hover .oh-no em, .oh-plate:focus-visible .oh-no em{ opacity:1; transform:none; }
}
@media (max-width:860px){
  .oh-head{ grid-template-columns:1fr; padding-top:5rem; gap:1.2rem; }
  .oh-plates{ grid-template-columns:1fr; padding-top:3rem; padding-bottom:5rem; gap:1.8rem; }
  .oh-plate .oh-img{ aspect-ratio:3 / 2; }
  .oh-plate .oh-no em{ opacity:1; transform:none; }
}

/* the opened plate */
.oh-view{
  position:fixed; inset:0; z-index:900; color:#fff; background:#0c0c0c; visibility:hidden;
  clip-path:inset(var(--t,50%) var(--r,50%) var(--b,50%) var(--l,50%) round 16px);
}
.oh-view.is-open{ visibility:visible; clip-path:inset(0 0 0 0 round 0); transition:clip-path .9s cubic-bezier(.65,0,.2,1); }
.oh-view.is-closing{ visibility:visible; transition:clip-path .6s cubic-bezier(.65,0,.2,1); }
.oh-view img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transform:scale(1.08); transition:transform 1.6s cubic-bezier(.22,1,.36,1); }
.oh-view.is-open img{ transform:none; }
.oh-view::after{ content:''; position:absolute; inset:0; background:linear-gradient(180deg, rgba(10,10,12,.35) 0%, rgba(10,10,12,.05) 40%, rgba(10,10,12,.72) 100%); }
.oh-copy{ position:absolute; z-index:2; left:5vw; right:5vw; bottom:11vh; }
.oh-copy > *{ opacity:0; transform:translateY(22px); transition:opacity .8s ease, transform .9s cubic-bezier(.22,1,.36,1); }
.oh-view.is-open .oh-copy > *{ opacity:1; transform:none; }
.oh-view.is-open .oh-copy > :nth-child(1){ transition-delay:.55s; }
.oh-view.is-open .oh-copy > :nth-child(2){ transition-delay:.68s; }
.oh-view.is-open .oh-copy > :nth-child(3){ transition-delay:.84s; }
.oh-copy .label{ color:rgba(255,255,255,.85); }
.oh-copy h3{ font-weight:200; font-size:clamp(2.4rem,5.4vw,4.6rem); line-height:1.06; letter-spacing:-.015em; margin:1.4rem 0 2.4rem; }
.oh-close{
  position:absolute; z-index:3; top:22px; right:4vw; width:46px; height:46px; border-radius:50%; cursor:pointer;
  border:1px solid rgba(255,255,255,.55); background:rgba(10,10,12,.2); color:#fff; font:300 1.3rem/1 Inter,sans-serif;
  transition:background .3s, color .3s;
}
.oh-close:hover{ background:#fff; color:#0c0c0c; }
.oh-close:focus-visible, .oh-copy a:focus-visible{ outline:2px solid #fff; outline-offset:4px; }
@media (max-width:860px){ .oh-copy{ left:26px; right:26px; bottom:9vh; } }

@media (prefers-reduced-motion:reduce){
  .oh-view, .oh-view.is-open, .oh-view.is-closing, .oh-view img, .oh-copy > *, .oh-plate img{ transition:none !important; }
  .oh-view img{ transform:none; }
}
