/* motion.css: shared GSAP motion layer for harryfrostick.com
   Everything here only applies under html.gsap-ready, which is removed if GSAP fails to load,
   so the pages fall back to their original CSS animations and nothing is ever left hidden. */

/* Hold animated elements until GSAP reveals them */
.gsap-ready [data-m],
.gsap-ready [data-m-headline] { visibility: hidden; }

/* GSAP owns these now: switch off the old CSS entrance animations */
.gsap-ready [data-m],
.gsap-ready [data-m-group],
.gsap-ready [data-m-headline] { animation: none !important; opacity: 1; }
.gsap-ready [data-m]:not(video),
.gsap-ready [data-m-group],
.gsap-ready [data-m-headline] { transform: none; }   /* videos keep their own (mobile centring) */
.gsap-ready .wave-char { animation: none; }
.gsap-ready [data-m-marquee] { animation: none !important; opacity: 1 !important; }

/* Headline letters rise from behind their own baseline.
   clip-path clips only above and below; the sides are left wide open
   because Bebas Neue glyphs overhang their own box (overflow: hidden cut them). */
.m-mask {
  display: inline-block;
  clip-path: inset(-0.15em -0.5em -0.1em -0.5em);   /* top room for the wave */
}

/* Visually hidden, still read by screen readers and search engines */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Mobile menu: grows from the burger, returns to it on close (same path both ways).
   CSS transitions start from the current value, so a quick re-tap reverses it mid-flight. ── */
.mobile-menu {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  scale: 0.96;
  transform-origin: calc(100% - 3.4rem) 3.6rem;   /* the burger */
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.7, 0, 0.84, 0),
              scale 0.22s cubic-bezier(0.7, 0, 0.84, 0),
              visibility 0s linear 0.22s;
}
.mobile-menu.open {
  visibility: visible;
  opacity: 1;
  scale: 1;
  pointer-events: auto;
  transition: opacity 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              scale 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s;
}
@media (max-width: 768px) {
  .mobile-menu { transform-origin: calc(100% - 2.4rem) 3.2rem; }
}

/* ── Nav as a material: content blurs softly as it passes under the bar,
   fading out at the edge instead of a hard band (pink pages only). ── */
nav::before {
  background: linear-gradient(to bottom, rgba(250, 230, 235, 0.72) 0%, rgba(250, 230, 235, 0) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
}

/* ── Accessibility preferences ── */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu, .mobile-menu.open { scale: 1; }
}
@media (prefers-reduced-transparency: reduce) {
  nav::before {
    background: linear-gradient(to bottom, #fae6eb 0%, #fae6eb 50%, transparent 100%);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    -webkit-mask-image: none; mask-image: none;
  }
}
@media (prefers-contrast: more) {
  nav::before { background: #fae6eb; -webkit-mask-image: none; mask-image: none; }
}

/* ── Ident: its own layer above the frosted nav, untouched by press feedback ── */
.nav-logo { position: relative; z-index: 2; isolation: isolate; }

/* ── Buttons: one solid primary style for every call to action ── */
.cta-btn, .submit-btn {
  background: #0f0f0f;
  color: #fdf1f4;
  border: none;
  padding: 1.15rem 1.9rem 1.15rem 2rem;
  gap: 1rem;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.cta-btn:hover, .submit-btn:hover { gap: 1rem; }        /* no layout shifting on hover */
@media (hover: hover) and (pointer: fine) {
  .cta-btn:hover, .submit-btn:hover { background: #c7345e; color: #fff; border: none; }
}
.cta-btn:focus-visible, .submit-btn:focus-visible { outline: 2px solid #c7345e; outline-offset: 4px; }
.submit-btn:disabled { background: #3a2a2f; color: #fdf1f4; opacity: 1; }

/* Arrow loops through on hover: out to the right, the next one in from the left */
.btn-arrow { position: relative; display: inline-flex; width: 14px; height: 14px; overflow: hidden; flex-shrink: 0; }
.btn-arrow svg { position: absolute; inset: 0; transition: translate 0.42s cubic-bezier(0.16, 1, 0.3, 1); }
.btn-arrow .btn-arrow-next { translate: -150% 0; }
:is(.cta-btn, .submit-btn):hover .btn-arrow svg:not(.btn-arrow-next) { transform: none; }
@media (hover: hover) and (pointer: fine) {
  :is(.cta-btn, .submit-btn):hover .btn-arrow svg { translate: 150% 0; }
  :is(.cta-btn, .submit-btn):hover .btn-arrow .btn-arrow-next { translate: 0 0; }
}

/* ── Tags: frosted pills, lit along the top edge ── */
.looking-tags { gap: 0.55rem; }
.tag {
  border: none;
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #0f0f0f;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: background-color 0.18s ease, color 0.18s ease;
}
@media (hover: hover) and (pointer: fine) {
  .tag:hover { background: rgba(255, 255, 255, 0.85); color: #c7345e; border: none; }
}
.modal-tag {                 /* same pill as the About tags, on the window's light panel */
  border: none;
  border-radius: 999px;
  background: #f7e4e8;
  color: #0f0f0f;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 0.5rem 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

@media (prefers-reduced-transparency: reduce) {
  .tag { background: #fff6f8; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .tag { background: #fff; box-shadow: inset 0 0 0 1px #0f0f0f; }
  .modal-tag { background: #fff; box-shadow: inset 0 0 0 1px #0f0f0f; }
}
