/* Brymar luxe layer (11/7): page transitions, intro curtain, hero entrance, slower reveals, refined hovers.
   Motion uses transform, opacity and clip-path only. Everything sits behind prefers-reduced-motion. */
:root {
  --ease-lux: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.77, 0, .18, 1);
  --shadow-lux: 0 1px 1px rgba(6,45,98,.04), 0 6px 14px -6px rgba(6,45,98,.12), 0 28px 56px -24px rgba(6,45,98,.30);
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* glass header */
.header { transition: background-color .4s var(--ease-lux), box-shadow .4s var(--ease-lux), border-color .4s var(--ease-lux); }
.header.scrolled { background: rgba(255,255,255,.82); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); }

/* nav underline draws in */
.nav a { position: relative; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--blue); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-lux); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"]::after { display: none; }

/* buttons: soft sheen */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .45s var(--ease-lux), background-color .3s var(--ease-lux), box-shadow .45s var(--ease-lux); }
.btn::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%); transform: translateX(-110%); transition: transform .9s var(--ease-lux); }
.btn-white::after, .btn-outline::after { background: linear-gradient(105deg, transparent 30%, rgba(0,125,206,.12) 50%, transparent 70%); }
.btn:hover::after { transform: translateX(110%); }
.btn:hover { box-shadow: var(--shadow-lux); }

/* cards: deeper, slower */
.pcard, .scard { transition: transform .6s var(--ease-lux), box-shadow .6s var(--ease-lux); }
.pcard:hover, .scard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lux); }
.pcard .ph img, .scard .ph img, .panel .ph img, .com .big img, .about .ph img { transition: transform 1.4s var(--ease-lux); }
.pcard:hover .ph img, .scard:hover .ph img, .panel:hover .ph img, .com .big:hover img { transform: scale(1.06); }
.bar .arr, .link .arr { transition: transform .5s var(--ease-lux); }

/* intro curtain (first visit per session) */
.curtain { position: fixed; inset: 0; z-index: 200; background: var(--navy); display: none; place-items: center; pointer-events: none; }
.curtain img { width: clamp(84px, 9vw, 128px); }
html.intro .curtain { display: grid; animation: curtain-up 1s var(--ease-io) .75s both; }
html.intro .curtain img { animation: mark-in .9s var(--ease-lux) both, mark-out .5s var(--ease-io) .6s forwards; }
@keyframes curtain-up { to { transform: translateY(-100%); } }
@keyframes mark-in { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes mark-out { to { opacity: 0; transform: translateY(-18px); } }

@media (prefers-reduced-motion: no-preference) {
  /* hero entrance: lines rise out of a mask, photo settles */
  .hero h1 .ln { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
  .hero h1 .ln > span { display: block; animation: line-up 1.1s var(--ease-lux) both; }
  .hero h1 .ln:nth-child(2) > span { animation-delay: .09s; }
  .hero h1 .ln:nth-child(3) > span { animation-delay: .18s; }
  .hero .kicker, .hero .lead, .hero .actions, .hero .talk { animation: fade-up 1s var(--ease-lux) both; }
  .hero .kicker { animation-delay: 0s; }
  .hero .lead { animation-delay: .22s; }
  .hero .actions { animation-delay: .32s; }
  .hero .talk { animation-delay: .42s; }
  .hero .photo { will-change: transform; }
  .hero .hero-img { animation: settle 2.2s var(--ease-lux) both; }
  html.intro .hero h1 .ln > span, html.intro .hero .kicker, html.intro .hero .lead, html.intro .hero .actions, html.intro .hero .talk, html.intro .hero .hero-img { animation-delay: 1.15s; }
  @keyframes line-up { from { transform: translateY(105%); } }
  @keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }
  @keyframes settle { from { transform: scale(1.1); opacity: 0; } 30% { opacity: 1; } }

  /* scroll reveals: slower, staggered; photos settle inside their frame */
  .rv { transform: translateY(40px); transition: opacity 1.1s var(--ease-lux) var(--d, 0s), transform 1.3s var(--ease-lux) var(--d, 0s); }
  .rv .ph img, .rv.big img, .ph.rv img { transform: scale(1.12); transition: transform 1.8s var(--ease-lux) var(--d, 0s); }
  .rv.in .ph img, .rv.in.big img, .ph.rv.in img { transform: none; }
  .pcard.rv.in:hover .ph img, .scard.rv.in:hover .ph img, .panel.rv.in:hover .ph img, .big.rv.in:hover img { transform: scale(1.06); transition-delay: 0s; }
  .sky-band > img { will-change: transform; transform: scale(1.12); }

  /* page transitions between pages (Chrome, Edge, Safari 18+) */
  @view-transition { navigation: auto; }
  .header { view-transition-name: site-header; }
  ::view-transition-group(site-header) { z-index: 10; }
  ::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }
  ::view-transition-old(root) { animation: vt-out .7s var(--ease-io) both; }
  ::view-transition-new(root) { animation: vt-in .9s var(--ease-io) both; }
  @keyframes vt-out { to { opacity: .35; transform: translateY(-4%) scale(.97); } }
  @keyframes vt-in { from { clip-path: inset(100% 0 0 0); transform: translateY(8%); } to { clip-path: inset(0); transform: none; } }
  /* clicked photo grows into the next page's hero */
  ::view-transition-group(hero-photo) { animation-duration: .95s; animation-timing-function: var(--ease-io); z-index: 5; }
  ::view-transition-old(hero-photo), ::view-transition-new(hero-photo) { height: 100%; object-fit: cover; overflow: hidden; }
  ::view-transition-new(hero-photo) { animation: none; }
  /* while a transition runs, hold the hero entrance so it plays after the wipe */
  html.vt-in .hero h1 .ln > span, html.vt-in .hero .kicker, html.vt-in .hero .lead, html.vt-in .hero .actions, html.vt-in .hero .talk { animation-delay: .45s; }
  html.vt-in .hero h1 .ln:nth-child(2) > span { animation-delay: .54s; }
  html.vt-in.vt-photo .hero .hero-img { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .curtain { display: none !important; }
}
