﻿/* ==========================================================================
   Grace Villa — the entrance film

   The intro is the client's own clip of the doors opening
   (assets/video/intro.mp4), held over the page until it finishes.
   intro.js drives it and adds one class:

     .is-film   the film is running; the hairline follows its clock
     .s-done    overlay dissolves, page takes over

   This file used to hold a CSS 3D door scene — a portico, two walnut leaves,
   a keyhole, a wordmark — which stood in for that shot before the footage
   existed. It has been removed along with its markup.
   ========================================================================== */

.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  overflow: hidden;
  transition: opacity 1.05s var(--ease), visibility 1.05s;
}
.intro.s-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------------------------------------------------------------- the film

   It fills the screen and is cropped rather than letterboxed — the frame is
   composed on the doors, which sit in the middle, so a crop at any shape
   keeps them.                                                              */

.intro__film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  /* a still frame would pop when the film starts; fade it in instead */
  animation: introFilmIn 1s var(--ease) both;
}
@keyframes introFilmIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- controls */

.intro__ctrl {
  position: absolute;
  right: clamp(18px, 4vw, 44px);
  bottom: clamp(18px, 4vw, 40px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeUp .9s var(--ease) 1.5s forwards;
}

.ictl {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 19px;
  border: 1px solid rgba(198, 161, 91, .38);
  border-radius: 999px;
  background: rgba(6, 6, 10, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--mist);
  font-family: var(--sans);
  font-size: .64rem;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .4s var(--ease), border-color .4s var(--ease), background .4s var(--ease);
}
.ictl:hover { color: var(--gold-hi); border-color: var(--gold); background: rgba(198, 161, 91, .12); }
.ictl svg { width: 13px; height: 13px; flex: none; }

/* progress hairline along the bottom */
.intro__bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold-dk), var(--gold-hi));
  z-index: 10;
}
/* Driven by the film's own clock (intro.js writes the scale on timeupdate),
   so the hairline cannot drift away from what is on screen. */
.intro.is-film .intro__bar { transition: transform .25s linear; }

/* ---------------------------------------------------------------- mobile */

/* The film runs on phones too; only its controls need moving. Centred, they
   sit clear of the home indicator and of either thumb. */
@media (max-width: 680px) {
  .intro__ctrl { left: 0; right: 0; justify-content: center; }
  .ictl { padding: 10px 15px; font-size: .58rem; letter-spacing: .18em; }
}

/* very small handsets: the icons carry the meaning on their own */
@media (max-width: 380px) {
  .ictl span { display: none; }
  .ictl { padding: 11px 13px; }
}

/* ---------------------------------------------------------------- reduced */

@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
}
