/* ============================================================
   UX layer — shared across all pages.
   Interaction and touch improvements only; the visual design
   lives in each page's own <style> block.
   ============================================================ */

html { -webkit-tap-highlight-color: transparent; }
a, button, select, label, .work-card, .filter-btn, .hero-scroll { touch-action: manipulation; }

/* `overflow-x: hidden` on html+body turns body into a scroll container, which
   silently breaks position: sticky (the Work filter bar). `clip` hides sideways
   overflow the same way without that side effect; older browsers keep `hidden`. */
html, body { overflow-x: hidden; overflow-x: clip; }
html.ux-lock, html.ux-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Home hero: show a still until the showreel is actually playing ---------- */
@media (min-width: 769px) {
  .hero-slideshow { display: block; transition: opacity 1.2s ease; pointer-events: none; }
  .hero-slideshow::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(11,13,11,.15) 0%, rgba(11,13,11,.08) 35%, rgba(11,13,11,.65) 72%, rgba(11,13,11,.96) 100%);
  }
  .hero.video-playing .hero-slideshow { opacity: 0; }
}

/* ---------- Small confirmation toast (e.g. "Email copied") ---------- */
.ux-toast {
  position: fixed; left: 50%; bottom: 2rem; z-index: 300;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  background: var(--forest); color: var(--cream);
  border: 1px solid rgba(243,234,218,.12);
  padding: .8rem 1.4rem;
  font-family: var(--body); font-size: .66rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  transition: opacity .25s ease, transform .25s ease;
}
.ux-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ux-toast::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-right: .7rem; vertical-align: middle; }

/* Lightbox: click the left/right side of a photo to browse on desktop */
@media (hover: hover) {
  .ux-lb-img.ux-lb-multi { cursor: pointer; }
}

/* Visible keyboard focus, in brand orange */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 1.5px solid var(--orange); outline-offset: 3px;
}

/* ---------- Touch devices: no sticky hover, real press feedback ---------- */
@media (hover: none) {
  .work-card:hover .card-img-inner,
  .work-card:hover .work-img-inner { transform: none; }
  .framework-item:hover { background: var(--cream); }
  .social-list a:hover .social-arrow { transform: none; }

  .work-card .card-img-inner,
  .work-card .work-img-inner { transition: transform .18s ease; }
  .work-card:active .card-img-inner,
  .work-card:active .work-img-inner { transform: scale(.975); }
  .work-card:active .play-btn { border-color: var(--orange); background: rgba(11,13,11,.7); }

  .btn-solid:active, .btn-submit:active { background: #c44920; }
  .btn-line:active, .all-link:active, .about-cta:active,
  .social-list a:active, .contact-email:active, .hero-email:active,
  .filter-btn:active, .nav-logo:active, .footer-logo:active { color: var(--orange); }
  .mobile-menu a:active { color: var(--orange); }
}

/* Photos that open in the viewer */
.ux-zoomable { cursor: zoom-in; }

/* ---------- Mobile menu ---------- */
/* Sit above the nav so the close button is always tappable */
.mobile-menu { z-index: 150; overscroll-behavior: contain; }
.mobile-menu.open { animation: uxFade .25s ease; }
.mobile-menu a { padding: .35rem 1.5rem; }
.mobile-menu-close {
  min-width: 48px; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  top: .9rem; right: calc(6% - .75rem);
}
@keyframes uxFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 768px) {
  /* Comfortable tap target without changing the icon's look */
  .hamburger { padding: 14px 12px; margin: -14px -12px -14px 0; }
  .mobile-menu a { font-size: clamp(2.25rem, 10vw, 3.5rem); }

  /* Filter tabs: bigger targets, same styling */
  .filter-inner { padding: .6rem 0; }
  .filter-btn { padding: .95rem 1.1rem .95rem 0; }

  /* Prevent iOS from zooming into form fields on focus */
  .field input, .field select, .field textarea { font-size: 16px; }

  /* Buttons and text links get room to tap */
  .btn-solid, .btn-submit { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-line, .all-link, .about-cta { padding-top: .7rem; padding-bottom: .35rem; }
  .strip-ctas { flex-wrap: wrap; gap: 1.25rem 1.75rem; }
  .footer-logo { padding: .5rem 0; }

  .hero-scroll { cursor: pointer; padding: .5rem .5rem .5rem 0; }
}

/* Sticky filter bar slides down to clear the nav when it reappears */
.filter-bar { transition: top .35s ease; }

/* ---------- Video modal ---------- */
.vimeo-modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--black);
  align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}
.vimeo-modal.open { display: flex; animation: uxFade .25s ease; }
.modal-inner { position: relative; width: 90vw; max-width: 900px; }
.modal-inner iframe { width: 100%; aspect-ratio: 16/9; border: none; display: block; background: var(--black); }
.modal-close {
  position: absolute; top: -3rem; right: 0;
  min-height: 44px; padding: 0 0 0 1rem;
  font-family: var(--display); font-size: 1.2rem; letter-spacing: .04em;
  color: rgba(243,234,218,.6); cursor: pointer;
  background: none; border: none; transition: color .2s;
}
.modal-close:hover, .modal-close:active { color: var(--orange); }
@media (max-width: 600px) {
  .modal-inner { width: 100vw; }
  .modal-close { right: 5%; }
}

/* ---------- Photo viewer ---------- */
.ux-lightbox {
  position: fixed; inset: 0; z-index: 210;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
  touch-action: none; overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none;
}
.ux-lightbox.open { opacity: 1; visibility: visible; }
.ux-lb-stage { position: absolute; inset: 4.5rem 0 4.5rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ux-lb-img {
  max-width: calc(100vw - 9rem); max-height: 100%;
  object-fit: contain; display: block;
  transition: transform .3s ease, opacity .3s ease;
  will-change: transform;
}
.ux-lb-img.dragging { transition: none; }
.ux-lb-top, .ux-lb-bottom {
  position: absolute; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6%; height: 4.5rem;
}
.ux-lb-top { top: 0; }
.ux-lb-bottom { bottom: 0; justify-content: center; }
.ux-lb-count { font-size: .66rem; font-weight: 500; letter-spacing: .2em; color: rgba(243,234,218,.4); }
.ux-lb-count b { color: var(--orange); font-weight: 500; }
.ux-lb-cap { font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(243,234,218,.3); text-align: center; }
.ux-lb-close {
  min-height: 48px; padding: 0 0 0 1rem; margin-right: -.25rem;
  font-family: var(--display); font-size: 1.2rem; letter-spacing: .04em;
  color: rgba(243,234,218,.6); background: none; border: none; cursor: pointer; transition: color .2s;
}
.ux-lb-close:hover, .ux-lb-close:active { color: var(--orange); }
.ux-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 3.25rem; height: 3.25rem; border-radius: 50%;
  border: 1.5px solid rgba(243,234,218,.3); background: rgba(11,13,11,.4);
  color: rgba(243,234,218,.8); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s;
}
.ux-lb-nav:hover, .ux-lb-nav:active { border-color: var(--orange); color: var(--orange); }
.ux-lb-prev { left: 2%; }
.ux-lb-next { right: 2%; }
.ux-lb-nav[hidden] { display: none !important; }
@media (max-width: 768px) {
  .ux-lb-stage { inset: 4rem 0 5rem; }
  .ux-lb-img { max-width: 100vw; }
  .ux-lb-top { height: 4rem; padding: 0 5%; }
  .ux-lb-bottom { height: 5rem; flex-direction: column; gap: .35rem; }
  /* Swipe is the main gesture on phones; arrows stay small and out of the way */
  .ux-lb-nav { top: auto; bottom: 1rem; transform: none; width: 2.75rem; height: 2.75rem; }
  .ux-lb-prev { left: 5%; }
  .ux-lb-next { right: 5%; }
}
@media (prefers-reduced-motion: reduce) {
  .ux-lb-img, .ux-lightbox, .mobile-menu.open, .vimeo-modal.open { transition: none; animation: none; }
}

/* ---------- Footer on phones: name + mark on one row, copyright beneath ---------- */
@media (max-width: 768px) {
  footer {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo mark" "copy copy";
    align-items: center;
    row-gap: .6rem; column-gap: 1.5rem;
    padding: 1.6rem 5% 1.75rem;
  }
  footer .footer-logo { grid-area: logo; white-space: nowrap; font-size: .78rem; padding: .35rem 0; }
  footer .mark { grid-area: mark; justify-self: end; }
  footer .mark svg { width: 44px; height: auto; }
  footer .footer-copy { grid-area: copy; font-size: .58rem; letter-spacing: .08em; }
}
