/* =====================================================================
   Matt J Barbers — refine layer (loads after main.css)
   Art direction pass after the Awwwards barber set (Blind Barber, Rendezvous,
   DON Barber & Groom, Frank Nitti): black-and-white photography that blooms into
   colour as it scrolls in, film grain, a turning booking seal, numbers, a review reel,
   a photo viewer and a cursor label. All values come from tokens.css.
   ===================================================================== */

:root {
  /* Photo treatment: photos start in this and turn to colour as they come into view.
     Set --photo-mono to `none` to keep them in full colour from the start. */
  --photo-mono: grayscale(1) contrast(1.06) brightness(0.98);
  --photo: none;
  --photo-in: 0.7s;
}

/* ---------- Fixes to main.css ---------- */
/* A stray selector made these two rules unreachable, so links on white hovered to pale silver */
.on-paper .link:hover { color: var(--c-accent-dk); }
.on-paper .price-board tr.featured b::after { color: var(--c-accent-dk); }

/* ---------- Film grain ---------- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 240; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .62 0 0 0 0 .62 0 0 0 0 .62 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media print { body::after { display: none; } }

/* ---------- Photography: black and white that blooms into colour as it scrolls into view ----------
   refine.js adds .photo-reveal to <html>, then .in-colour to each photo as it comes on screen, on every
   device. Without JS the photos are simply in colour. */
.photo-reveal { --photo: var(--photo-mono); }
.photo-reveal .in-colour { --photo: none; }
.hero-media img,
.statement-photo img,
.strip img,
.gallery img,
.band > img:not(.band-stamp),
.loc-photos img,
.visit-media img,
.roster img.portrait,
.shop-panel > img.bg { filter: var(--photo); }
.hero-media img, .js-motion .hero-media img, .band > img:not(.band-stamp) { transition: filter 1.4s var(--ease); }
.statement-photo img, .strip img, .gallery img, .loc-photos img, .visit-media img, .roster img.portrait { transition: filter 1.1s var(--ease), scale 1.1s var(--ease); }
.shop-panel > img.bg { transition: transform 1.2s var(--ease), filter 1.1s var(--ease); }
@media (hover: hover) {
  /* `scale`, not `transform`: GSAP owns the inline transform on these images */
  .strip figure:hover img, .gallery figure:hover img, .roster li:hover img.portrait { scale: 1.035; }
}

/* ---------- Header ---------- */
@media (min-width: 64.01rem) { .brand img { height: 3.125rem; } }

/* ---------- Hero: the booking seal ---------- */
.seal {
  position: absolute; z-index: 2; bottom: 5.25rem;
  right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));   /* lines up with the content column on wide screens */
  width: clamp(7.5rem, 5.5rem + 5vw, 10.5rem); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--c-paper);
  background: color-mix(in srgb, var(--c-ink) 72%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--c-line);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.seal > * { grid-area: 1 / 1; }
.seal-ring { width: 100%; height: 100%; animation: seal-turn 26s linear infinite; }
.seal-ring text { font-family: var(--f-display); font-weight: 700; font-size: 15.5px; letter-spacing: 0.06em; text-transform: uppercase; fill: currentColor; }
.seal-mark { width: 34%; height: auto; transition: filter var(--dur) var(--ease), transform 0.5s var(--ease); }
.seal:hover, .seal:focus-visible { background: var(--c-paper); color: var(--c-ink); border-color: var(--c-paper); }
.seal:hover .seal-mark, .seal:focus-visible .seal-mark { filter: invert(1); transform: scale(1.08); }
.seal:hover .seal-ring { animation-duration: 9s; }
@keyframes seal-turn { to { transform: rotate(360deg); } }
/* Tablets and phones: top right, on the brickwork above the shoulder */
@media (max-width: 64rem) {
  .seal { top: 5.5rem; bottom: auto; width: 6rem; }
  .seal-ring text { font-size: 16.5px; }
}
@media (max-width: 30rem) { .seal { top: 4.75rem; width: 5.25rem; } }
/* Phones on their side: smaller, tucked into the corner clear of his hair */
@media (orientation: landscape) and (max-height: 31rem) { .seal { top: 4.75rem; width: 5.25rem; } }
/* Short laptop screens: the bottom corner would sit on his jaw, so it moves up beside the header */
@media (min-width: 64.01rem) and (max-height: 47rem) { .seal { top: 5.5rem; bottom: auto; width: 6.5rem; } }
@media (prefers-reduced-motion: reduce) { .seal-ring { animation: none; } }

/* ---------- Numbers under the statement ---------- */
.stats { margin-top: var(--s-6); }
.stats div { display: flex; flex-direction: column; padding-top: var(--s-2); }
.stats dt { order: 0; }
.stats dd { order: 1; margin-top: auto; padding-top: var(--s-2); font-size: clamp(3.25rem, 1.25rem + 5.2vw, 7rem); line-height: 0.9; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stats div:first-child dd { color: var(--c-paper); }
.stats div:last-child dd { color: var(--c-accent); }
@media (max-width: 64rem) {
  .stats { margin-top: var(--s-5); }
  .stats div:nth-child(n+3) { padding-top: var(--s-2); }
  .stats div:nth-child(even) { padding-left: var(--s-2); }
}

/* ---------- Review reel ---------- */
.reviews .wrap { padding-block: var(--s-6) var(--s-4); }
.reviews-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); font-size: var(--t-sm); font-weight: 600; }
.reviews-stage { display: grid; }
.reviews-stage .quote { grid-area: 1 / 1; align-self: end; padding-block: 0; opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease), visibility 0s linear 0.6s; }
.reviews-stage .quote.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0.12s, 0.12s, 0s; }
.reviews-nav { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); }
.reviews-count { font-variant-numeric: tabular-nums; font-size: var(--t-sm); color: var(--c-muted); min-width: 4.5ch; }
.reviews-count b { color: var(--c-paper); font-weight: 600; }
.reviews-line { position: relative; flex: 1; max-width: 14rem; height: 1px; background: var(--c-line); overflow: hidden; }
.reviews-line i { position: absolute; inset: 0; background: var(--c-paper); transform: scaleX(0); transform-origin: left; }
.reviews-line i.run { animation: rev-fill 6.5s linear forwards; }
.reviews.is-paused .reviews-line i.run { animation-play-state: paused; }
@keyframes rev-fill { to { transform: scaleX(1); } }
.rev-btn { width: 3rem; height: 3rem; display: grid; place-items: center; border: 1px solid var(--c-line); border-radius: 50%; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.rev-btn:hover, .rev-btn:focus-visible { background: var(--c-paper); color: var(--c-ink); border-color: var(--c-paper); }
.rev-btn svg { width: 1.1rem; height: 1.1rem; }
.reviews-nav .rev-btn:first-of-type { margin-left: auto; }
@media (min-width: 64.01rem) { .reviews-nav .rev-btn:first-of-type { margin-left: var(--s-2); } }

/* ---------- Work strip + gallery: numbered captions, staggered columns ---------- */
.strip, .gallery { counter-reset: shot; }
.strip figure, .gallery figure { counter-increment: shot; cursor: zoom-in; }
.strip .frame, .gallery .frame { overflow: hidden; }
.strip figcaption, .gallery figcaption { display: flex; gap: var(--s-2); align-items: baseline; color: var(--c-paper); }
.strip figcaption::before, .gallery figcaption::before { content: counter(shot, decimal-leading-zero); color: var(--c-muted); font-variant-numeric: tabular-nums; }
@media (min-width: 64.01rem) {
  .gallery { row-gap: var(--s-4); padding-bottom: var(--s-5); }
  .gallery figure:nth-child(3n + 2) { transform: translateY(var(--s-5)); }
}

/* ---------- Price boards: a ruler follows the row you're reading ---------- */
.price-board tbody tr { transition: color var(--dur) var(--ease); }
@media (hover: hover) {
  .price-board tbody tr:hover td, .price-board tbody tr:hover th[scope="row"] { border-bottom-color: currentColor; }
  .price-board tbody tr:hover .svc::after { opacity: 0.8; }
}

/* ---------- Inner page heads: the monogram as a watermark ---------- */
.page-head { position: relative; isolation: isolate; }
@media (min-width: 64.01rem) {
  .page-head::after {
    content: ""; position: absolute; z-index: -1; right: var(--gutter); top: 6rem;
    width: clamp(11rem, 5rem + 11vw, 16rem); aspect-ratio: 963 / 1016;
    background: url("/assets/img/monogram.svg") center / contain no-repeat; opacity: 0.07;
  }
}

/* ---------- Photo viewer ---------- */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: var(--s-2) var(--gutter) var(--s-3);
  border: 0; color: var(--c-paper); background: color-mix(in srgb, var(--c-ink) 97%, transparent);
  overscroll-behavior: contain; touch-action: none;
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--s-2); animation: lb-in 0.35s var(--ease); }
.lightbox::backdrop { background: var(--c-ink); }
@keyframes lb-in { from { opacity: 0; } }
.lb-top, .lb-base { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); font-size: var(--t-sm); }
.lb-count { font-variant-numeric: tabular-nums; color: var(--c-muted); }
.lb-count b { color: var(--c-paper); font-weight: 600; }
.lb-close { min-height: 2.75rem; padding: 0 var(--s-2); border: 1px solid var(--c-line); font-weight: 600; font-size: var(--t-sm); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.lb-close:hover, .lb-close:focus-visible { background: var(--c-paper); color: var(--c-ink); }
.lb-fig { position: relative; min-height: 0; }
.lb-fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; cursor: zoom-out; }
.lb-fig img.is-swap { animation: lb-swap 0.45s var(--ease); }
@keyframes lb-swap { from { opacity: 0; transform: scale(0.985); } }
.lb-cap { font-weight: 600; }
.lb-arrows { display: flex; gap: var(--s-1); }

/* ---------- Cursor label (mouse only) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 260; pointer-events: none; will-change: transform; }
.cursor span {
  position: absolute; left: -2.75rem; top: -2.75rem; width: 5.5rem; height: 5.5rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--c-paper); color: var(--c-ink);
  font-size: var(--t-sm); font-weight: 600; letter-spacing: 0.02em;
  transform: scale(0); transition: transform 0.35s var(--ease);
}
.cursor.is-on span { transform: scale(1); }
/* over text the disc sits beside the pointer instead of on top of the words */
.cursor.is-tip span { left: 1rem; top: 1rem; width: 4.25rem; height: 4.25rem; }

/* ---------- The team as portrait cards ---------- */
.roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5) var(--s-3); border-top: 2px solid currentColor; padding-top: var(--s-4); }
.roster li, .roster li:last-child { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 0; }
.roster .portrait, .roster .portrait-empty { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; align-self: stretch; grid-row: auto; }
.roster li > .portrait { overflow: hidden; }
.roster .portrait-empty span { font-size: clamp(3.5rem, 2rem + 4vw, 6rem); -webkit-text-stroke-width: 1.5px; }
.roster .who { margin-top: var(--s-2); gap: 0.2rem; }
.roster .name { font-size: clamp(1.75rem, 1.2rem + 1.4vw, 2.5rem); line-height: 0.95; }
.roster .roster-actions { align-self: flex-start; justify-self: auto; text-align: left; grid-column: auto; padding-block: 0.6rem 0; }
@media (max-width: 64rem) { .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 48rem) {
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-2); }
  .roster li { display: flex; }
  .roster .portrait { width: 100%; grid-row: auto; }
  .roster .name { font-size: 1.75rem; }
  .roster .roster-actions { grid-column: auto; padding-block: 0.6rem; }
}

/* Barber names on the home page: their photo follows the pointer (desktop) */
.cursor img { position: absolute; left: -5rem; top: -14.75rem; width: 10rem; max-width: none; height: auto; display: block; aspect-ratio: 4 / 5; object-fit: cover; transform: scale(0.6); opacity: 0; transition: transform 0.4s var(--ease), opacity 0.25s var(--ease); }
.cursor.is-photo span { transform: scale(0); }
.cursor.is-photo.is-on img { transform: none; opacity: 1; }

/* =====================================================================
   Final layout pass
   ===================================================================== */
/* Divider lines: on the shop pages the rule ran through the page gutters; it now ends with the content */
.wrap.visit { border-top: 0; position: relative; }
.wrap.visit::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 2px solid currentColor; }
/* "Next" link: its top rule runs edge to edge at every width, like the footer's */
.next-page { border-top: 1px solid transparent; border-image: linear-gradient(var(--c-line), var(--c-line)) 1 / 1px 0 0 0 / 0 100vw; }

/* Tablets: four numbers in one row, and the shop photo no longer fills the whole screen */
@media (min-width: 40rem) and (max-width: 64rem) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats div:nth-child(n) { margin-top: 0; border-top: 0; padding-top: var(--s-2); }
  .stats div:nth-child(n + 2) { padding-left: var(--s-2); border-left: 1px solid var(--c-line); }
  .statement-photo { max-width: 34rem; }
}
/* Narrow phones: slimmer price columns so service names wrap less */
@media (max-width: 23.5rem) { .price-board .col-price { width: 3.9rem; } }

/* Booking chooser on phones: each shop reads as one clean block instead of two squeezed columns */
@media (max-width: 30rem) {
  .chooser .ticket { padding: var(--s-3); }
  .chooser .opt { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; padding-block: var(--s-2); }
  .chooser .opt strong { font-size: 1.85rem; }
  .chooser .opt > span:last-child { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; padding-top: 0.25rem; }
  .chooser .opt > span:last-child::after { content: " \2192"; }
}

/* Price boards with four barbers (Warwick): tighter columns on phones so service names don't stack word by word */
@media (max-width: 30rem) {
  .price-board:has(thead th:nth-child(5)) .col-price { width: 3.4rem; padding-left: 0.25rem; font-size: var(--t-sm); }
  .price-board:has(thead th:nth-child(5)) th[scope="row"] .svc b { font-size: var(--t-sm); }
}

/* Small phones turned sideways: photo beside the headline instead of behind it */
@media (max-width: 48rem) and (orientation: landscape) and (max-height: 31rem) {
  .hero-media { left: auto; bottom: 0; width: 46%; }
  .hero-media img { object-position: 50% 28%; }
  .hero-media::after {
    background:
      linear-gradient(90deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 35%, transparent) 24%, transparent 48%),
      linear-gradient(0deg, var(--c-ink) 0%, transparent 30%);
  }
  .hero-inner { padding-top: 5.25rem; }
  .hero h1 { font-size: clamp(3rem, 1rem + 9vw, 6rem); }
  .hero .btn-lg { width: auto; }
  .seal { display: none; }   /* no clear patch of wall left for it at this size */
}

@media (prefers-reduced-motion: reduce) {
  .reviews-stage .quote { transform: none; }
}
