/* =========================================================================
   PREMIUM UI LAYER (premium-frontend-ui skill). Every front-end page:
   inc/premium.php loads this after burton.css. Homepage-only pieces (entry
   doors, services band) only exist in homepage markup.
   Motion is transform / opacity / clip-path. Reduced motion and no-JS get
   the finished page. FAQ answers never depend on an animation to show.
   ========================================================================= */

:root {
  --section-y: clamp(56px, 6.4vw, 92px); /* tighter rhythm: was up to 120px a side */
  --pu-ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Typography polish ---------- */
h1, h2, h3 { text-wrap: balance; }
p, li, figcaption { text-wrap: pretty; }
.display { letter-spacing: -0.012em; }
.section-head p, .slider__intro { font-size: clamp(1.0625rem, 1.2vw, 1.25rem); line-height: 1.55; }
.services { padding-block: var(--section-y); }

/* Underlines that draw instead of sitting still */
.slider__cta, .intro__links a, .text-link {
  text-decoration: none; padding-bottom: 3px;
  background: linear-gradient(var(--u, currentColor), var(--u, currentColor)) 0 100% / 100% 2px no-repeat;
  transition: background-size 450ms var(--pu-ease), color 200ms;
}
.intro__links a { --u: var(--red); }
.slider__cta:hover, .intro__links a:hover, .text-link:hover { background-size: 0 2px; background-position: 100% 100%; }

/* ---------- Glass header once it goes solid ---------- */
.site-header.is-solid {
  background: rgba(17, 17, 17, .62); /* see-through, still 4.5:1 for the menu text over light pages */
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border-bottom-color: rgba(243, 242, 238, .1);
}

/* ---------- Buttons: a fill sweeps up from below ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::before {
  content: ""; position: absolute; inset: -2px; z-index: -1;
  transform: translate3d(0, 102%, 0); transition: transform 480ms var(--pu-ease);
}
.btn--red::before { background: var(--black); }
.btn--black::before { background: var(--red); }
.btn--ghost-light::before { background: var(--offwhite); }
.btn--ghost-dark::before { background: var(--black); }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn--red:hover { background: var(--red); }
.btn--black:hover { background: var(--black); }
.btn--ghost-light:hover { background: transparent; color: var(--black); }
.btn--ghost-dark:hover { background: transparent; color: #fff; }

/* ---------- Entry sequence: split doors (first visit per session) ---------- */
.pu-loader { display: none; }
.pu-loading .pu-loader { display: block; position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.pu-loader__door { position: absolute; left: 0; right: 0; height: 50.2%; background: var(--black); transition: transform 1050ms var(--pu-ease); }
.pu-loader__door--top { top: 0; }
.pu-loader__door--bottom { bottom: 0; }
.pu-loader__mark { position: absolute; left: 50%; top: 50%; width: min(38vw, 210px); transform: translate(-50%, -50%); transition: opacity 350ms ease, transform 800ms var(--pu-ease); }
.pu-loader__mark img { width: 100%; height: auto; animation: pu-mark 900ms var(--pu-ease) both; }
.pu-loader__bar { display: block; height: 3px; margin-top: 24px; background: rgba(243, 242, 238, .14); overflow: hidden; }
.pu-loader__bar span { display: block; height: 100%; background: var(--red); transform-origin: left; animation: pu-bar 1300ms var(--pu-ease) both; }
.pu-open .pu-loader__door--top { transform: translate3d(0, -101%, 0); }
.pu-open .pu-loader__door--bottom { transform: translate3d(0, 101%, 0); }
.pu-open .pu-loader__mark { opacity: 0; transform: translate(-50%, -50%) scale(1.12); }
@keyframes pu-mark { from { opacity: 0; transform: scale(.9) translate3d(0, 14px, 0); } }
@keyframes pu-bar { from { transform: scaleX(0); } }
/* The hero's own load moment waits behind the doors, then plays as they open */
.pu-loading:not(.pu-open) .hero, .pu-loading:not(.pu-open) .hero * { animation-play-state: paused !important; }

/* ---------- Words rise out of a mask (hero on load, section headings on arrival) ---------- */
.pu-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em .04em .12em; margin: -.08em -.04em -.12em; }
.pu-wi { display: inline-block; }
.js .hero__slogan .line.pu-split { animation: none; }
.hero__slogan .pu-wi { animation: pu-rise 1150ms var(--pu-ease) both; animation-delay: calc(140ms + var(--wi) * 90ms); }
@keyframes pu-rise { from { transform: translate3d(0, 115%, 0) rotate(4deg); } }
/* Page titles: words split server-side, so they rise from first paint without JS */
@media (prefers-reduced-motion: no-preference) {
  .phero__title .pu-wi { animation: pu-rise 1100ms var(--pu-ease) both; animation-delay: calc(80ms + var(--wi) * 80ms); }
}
.pu-armed .pu-wi { transform: translate3d(0, 115%, 0) rotate(3deg); }
.pu-armed.is-in .pu-wi { transform: none; transition: transform 1000ms var(--pu-ease); transition-delay: calc(var(--wi) * 55ms); }

/* ---------- Photo slots in the columns that were empty ---------- */
.pu-photo { margin: 0; }
.pu-photo__frame { position: relative; overflow: hidden; background: #CFCDC7; }
.pu-photo__frame img { width: 100%; height: 100%; object-fit: cover; }
.pu-photo figcaption { margin-top: 10px; font-size: .875rem; color: var(--ink-3); }
.pu-armed[data-pu-reveal] .pu-photo__frame { clip-path: inset(100% 0 0 0); }
.pu-armed[data-pu-reveal] .pu-photo__frame img { transform: scale(1.18); }
.pu-armed[data-pu-reveal].is-in .pu-photo__frame { clip-path: inset(0); transition: clip-path 1200ms var(--pu-ease); }
.pu-armed[data-pu-reveal].is-in .pu-photo__frame img { transform: none; transition: transform 1600ms var(--pu-ease); }

/* Intro: the heading column carries a photo and travels with the text */
.intro__head { position: sticky; top: calc(var(--header-h) + 24px); }
.pu-photo--intro { margin-top: 36px; }
.pu-photo--intro .pu-photo__frame { aspect-ratio: 4 / 3; }
.pu-photo--intro.pu-photo--wide .pu-photo__frame { aspect-ratio: 16 / 9; }
.pu-photo--intro .pu-photo__frame img { object-position: 50% 35%; } /* tall people shots: keep heads in frame */

/* About: real photo, with a second one overlapping its corner */
.pu-about-media { grid-column: span 5; position: relative; }
.pu-about-media .about__media { grid-column: auto; }
.pu-photo--inset { position: absolute; right: -16%; bottom: 14%; width: 46%; z-index: 2; }
.pu-photo--inset .pu-photo__frame { aspect-ratio: 1; border: 8px solid var(--white); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55); }
.pu-photo--inset figcaption { display: none; }

/* FAQ: the side column holds still with a photo and a way to call */
.faq__head { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; gap: 20px; }
.pu-photo--faq { margin-top: 8px; }
.pu-photo--faq .pu-photo__frame { aspect-ratio: 16 / 11; }
.pu-faq-call { margin: 0; font-size: 1.0625rem; color: var(--ink-2); }
.pu-faq-call a { font: 700 1.5rem var(--font-display); color: var(--black); text-decoration: none; margin-left: 6px; }
.pu-faq-call a:hover { color: var(--red); }

/* Quote: a photo under the phone number fills the aside */
.pu-photo--quote { margin-top: 8px; }
.pu-photo--quote .pu-photo__frame { aspect-ratio: 4 / 3; border: 2px solid var(--black); box-shadow: 10px 10px 0 var(--red); }

/* ---------- Services type band: moves with the scroll ---------- */
.pu-ticker { background: var(--black); color: var(--offwhite); overflow: hidden; padding: clamp(12px, 1.5vw, 20px) 0; border-block: 1px solid #2A2A28; }
/* Drifts on its own: three identical sets, so sliding one third loops seamlessly (the end padding
   matches the gap so each third is exactly one set). Rests on hover and off screen. */
.pu-ticker__row {
  --g: clamp(16px, 2vw, 32px);
  display: flex; align-items: center; gap: var(--g); padding-right: var(--g); width: max-content;
  font: 700 clamp(1.75rem, 3.4vw, 3.4rem)/1 var(--font-display); text-transform: uppercase; letter-spacing: -0.005em; white-space: nowrap;
  will-change: transform; animation: pu-ticker 55s linear infinite;
}
@keyframes pu-ticker { to { transform: translate3d(-33.3333%, 0, 0); } }
.pu-ticker:hover .pu-ticker__row, .pu-ticker.is-off .pu-ticker__row { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .pu-ticker__row { animation: none; } }
.pu-ticker__row span:nth-of-type(odd) { color: transparent; -webkit-text-stroke: 1.25px rgba(243, 242, 238, .75); }
.pu-ticker__row i { flex-shrink: 0; width: .2em; height: .2em; background: var(--red); transform: rotate(45deg); }

/* ---------- Recent work: a strip of photos that moves on its own ---------- */
.pu-work { padding: var(--section-y) 0; gap: 36px; }
.pu-work__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 32px; padding-inline: var(--gutter); }
.pu-work__actions { display: flex; align-items: center; gap: 24px; }
.pu-work__toggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px;
  border: 2px solid var(--black); background: transparent; color: var(--black); cursor: pointer;
  font: 600 .9375rem var(--font-display); letter-spacing: .06em; text-transform: uppercase;
  transition: background-color 200ms, color 200ms;
}
.pu-work__toggle::before { content: ""; box-sizing: content-box; width: 4px; height: 12px; border-inline: 3px solid currentColor; }
.pu-work__toggle[aria-pressed="true"]::before { width: 0; height: 0; border-inline: 10px solid currentColor; border-inline-end: 0; border-block: 6px solid transparent; }
.pu-work__toggle:hover { background: var(--black); color: #fff; }
html:not(.js) .pu-work__toggle { display: none; }

.pu-marquee { --gap: clamp(14px, 1.6vw, 24px); --h: clamp(240px, 27vw, 420px); display: flex; overflow: hidden; }
.pu-marquee__track { display: flex; flex-shrink: 0; gap: var(--gap); margin: 0; padding: 0 var(--gap) 0 0; list-style: none; animation: pu-marquee var(--dur, 60s) linear infinite; }
.pu-marquee:hover .pu-marquee__track, .pu-marquee:focus-within .pu-marquee__track,
.pu-marquee.is-paused .pu-marquee__track, .pu-marquee.is-off .pu-marquee__track { animation-play-state: paused; }
@keyframes pu-marquee { to { transform: translate3d(-100%, 0, 0); } }
.pu-card { flex-shrink: 0; height: var(--h); aspect-ratio: 4 / 3; }
.pu-card--tall { aspect-ratio: 4 / 5; }
.pu-card__btn { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #CFCDC7; overflow: hidden; cursor: zoom-in; }
.pu-card__btn img { width: 100%; height: 100%; object-fit: cover; user-select: none; transition: transform 1200ms var(--pu-ease), filter 500ms; }
.pu-card__btn:hover img, .pu-card__btn:focus-visible img { transform: scale(1.06); }
.pu-card__btn:focus-visible { outline-offset: -4px; }

/* ---------- The pointer is a pointing trowel (desktop mouse only) ----------
   The triangular steel blade is the arrowhead (aimed up-left like a normal arrow) and the
   Burton-red handle is its tail; over anything clickable the blade turns red. Text fields keep
   the normal text cursor. The blade tip (2,2) is the click point. */
@media (hover: hover) and (pointer: fine) {
  html, body { cursor: url("../img/cursor/trowel.svg") 10 10, auto; }
  a, button, [role="button"], label, summary, select, .chip, .svc, .pu-card__btn, .slider__card, .lib__card { cursor: url("../img/cursor/trowel-link.svg") 10 10, pointer; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]), textarea { cursor: text; }

  /* Viewfinder lens around the blade tip (premium.js puts it exactly on the pointer, no easing).
     Nearly clear inside; it brightens and sharpens what's under it. Grows a little over links. */
  .pu-lens {
    position: fixed; left: 0; top: 0; z-index: 2147483000; width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .2s ease, scale .2s ease; will-change: translate;
    background: rgba(255,255,255,.05);
    -webkit-backdrop-filter: brightness(1.2) contrast(1.12) saturate(1.2); backdrop-filter: brightness(1.2) contrast(1.12) saturate(1.2);
    box-shadow: 0 0 0 1.5px #E32636, 0 1px 5px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.6), inset 0 0 8px rgba(255,255,255,.25);
  }
  .pu-lens::before {
    content: ""; position: absolute; inset: -7px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg stroke='%23E32636' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M24 1v9M24 38v9M1 24h9M38 24h9'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
  }
  .pu-lens.is-on { opacity: 1; }
  .pu-lens.is-hot { scale: 1.2; box-shadow: 0 0 0 1.5px #161616, 0 1px 5px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.6), inset 0 0 8px rgba(255,255,255,.25); }
  .pu-lens.is-text { opacity: 0; }
}

/* ---------- Pointer layer: desktop mouse only, motion allowed ---------- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* Hovered photo stays in colour, the rest of the strip steps back */
  .pu-marquee:hover .pu-card__btn img { filter: grayscale(.7) brightness(.78); }
  .pu-marquee:hover .pu-card__btn:hover img { filter: none; }

  /* Service cards tip toward the pointer with a moving highlight */
  .svc { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 600ms var(--pu-ease); }
  .svc.is-tilting { transition: transform 120ms linear; }
  .svc__img::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 300ms;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .3), transparent 55%);
  }
  .svc:hover .svc__img::before { opacity: 1; }
}

/* ---------- Services menu: the hovered service's photo beside the list (desktop) ---------- */
@media (hover: hover) and (pointer: fine) {
  .nav__menu.has-preview { width: 640px; display: grid; grid-template-columns: 300px minmax(0, 1fr); align-content: start; }
  .nav__menu.has-preview > li:not(.nav__preview) { grid-column: 1; }
  .nav__preview { grid-column: 2; position: relative; min-height: 300px; margin: 0 10px 0 0; overflow: hidden; background: #232321; }
  .nav__preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; scale: 1.06; transition: opacity 320ms ease, scale 1100ms var(--pu-ease); }
  .nav__preview img.is-on { opacity: 1; scale: 1; }
}

/* ---------- Page to page: the next page fades up instead of a hard cut (supporting browsers) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: pu-page-out 240ms cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: pu-page-in 520ms var(--pu-ease) both; }
}
@keyframes pu-page-out { to { opacity: 0; } }
@keyframes pu-page-in { from { opacity: 0; transform: translate3d(0, 16px, 0); } }

/* ---------- Photo depth: pictures drift a little inside their frames as the page scrolls ----------
   Scroll-driven CSS (no script). Uses `translate`/`scale`, so it stacks with the reveal transforms. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .mrow__img img, .pu-photo:not(.pu-photo--inset) .pu-photo__frame img {
      scale: 1.1; animation: pu-depth linear both; animation-timeline: view(); animation-range: cover;
    }
  }
}
@keyframes pu-depth { from { translate: 0 -4%; } to { translate: 0 4%; } }

/* ---------- Footer signature: the home town, oversized and outlined ---------- */
.footer__mark {
  overflow: hidden; padding: clamp(10px, 2vw, 28px) var(--gutter) 0; user-select: none; pointer-events: none;
  font: 700 12.4vw/.8 var(--font-display); text-transform: uppercase; letter-spacing: -.005em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px #3A3A37; transition: -webkit-text-stroke-color 900ms ease;
}
.site-footer:hover .footer__mark { -webkit-text-stroke-color: rgba(227, 38, 54, .6); }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .intro__head, .faq__head { position: static; }
  .pu-about-media { grid-column: 1 / -1; }
  .pu-photo--inset { display: none; }
  .pu-photo--quote .pu-photo__frame { box-shadow: 6px 6px 0 var(--red); }
  .pu-work__actions { width: 100%; justify-content: space-between; }
}

/* ---------- Reduced motion: finished states, strip becomes a normal side-scroll ---------- */
@media (prefers-reduced-motion: reduce) {
  .pu-marquee { overflow-x: auto; scroll-snap-type: x proximity; padding-inline: var(--gutter); }
  .pu-marquee__track { animation: none; }
  .pu-marquee__track[aria-hidden] { display: none; }
  .pu-card { scroll-snap-align: start; }
  .pu-work__toggle { display: none; }
  .btn::before { transition: none; }
}
