/* =====================================================================
   Gable & Blade · UPGRADE LAYER
   Sharper rhythm between sections: a running tile ticker, a manifesto
   that fills in as it is read, an oversized menu with mirror previews,
   a wall of testimonial plaques, and a closing line. Same four glazes,
   same tile grid, same enamel. Loads after every other stylesheet.
   ===================================================================== */

/* ---------- Ticker: a course of lettered cobalt tiles that runs ---------- */
.ticker {
  position: relative; z-index: 3; overflow: hidden;
  height: max(64px, calc(var(--tile) * .82));
  /* one continuous glazed strip: no grout joints behind the running words */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, .14) 100%),
    var(--cobalt-deep);
  box-shadow: inset 0 3px 0 #e6e4de, inset 0 -3px 0 #e6e4de, inset 0 6px 10px -6px rgba(18, 19, 22, .45);
}
.ticker-track {
  display: flex; align-items: center; height: 100%; width: max-content;
  animation: ticker-run 46s linear infinite;
}
.ticker span {
  flex: none; padding: 0 .5em;
  font-weight: 900; font-stretch: 82%; text-transform: uppercase; white-space: nowrap;
  font-size: clamp(1.5rem, 3.1vw, 3.1rem); line-height: 1; letter-spacing: .005em;
  color: #f3f3ef; text-shadow: 0 2px 0 rgba(4, 12, 46, .35);
}
/* the small square insert tile, set on point, between words */
.ticker i {
  flex: none; width: .42em; height: .42em; font-size: clamp(1.5rem, 3.1vw, 3.1rem);
  transform: rotate(45deg); border-radius: 2px;
  background: linear-gradient(135deg, #ffffff, #d7d6d1);
  box-shadow: inset 0 0 0 1px rgba(18, 19, 22, .18), 0 2px 3px rgba(4, 12, 46, .4);
}
@keyframes ticker-run { to { transform: translateX(-50%); } }
.ticker:hover .ticker-track, .ticker.is-off .ticker-track { animation-play-state: paused; }

/* ---------- Story: the manifesto and the house standard ---------- */
.story .manifesto { max-width: var(--content); margin: 0 auto clamp(40px, 5vw, 72px); padding: clamp(28px, 3.6vw, 56px); }
.story .manifesto-line {
  margin: 0; color: var(--cobalt-deep);
  font-size: clamp(2.3rem, 5.6vw, 6.1rem); font-weight: 900; font-stretch: 100%;
  line-height: .99; letter-spacing: -.035em; text-wrap: balance;
}
.manifesto-line .w { transition: color .35s var(--ease-out); }
.manifesto-line.is-reading .w { color: #8f8b85; }
.manifesto-line.is-reading .w.is-lit { color: var(--cobalt-deep); }
.story-inner { align-items: start; }
.story .story-copy { grid-column: 1 / span 5; }
.story .standards {
  grid-column: 6 / span 7; margin: 0; list-style: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 2.4vw, 36px) clamp(24px, 3vw, 44px);
}
.standards li { display: grid; grid-template-columns: 56px 1fr; column-gap: 18px; align-items: start; }
.std-tile {
  grid-row: span 2; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 3px;
  background: image-set(url("../plates/cobalt-glaze.webp") type("image/webp"), url("../plates/cobalt-glaze.png") type("image/png")) -470px -480px / 2700px 2700px var(--cobalt);
  box-shadow: inset 0 0 0 1px #0a1c5c, inset 0 2px 0 rgba(255, 255, 255, .2), inset 0 -3px 0 rgba(0, 0, 0, .25);
  transition: transform .35s var(--ease-out);
}
.std-tile svg { width: 30px; height: 30px; fill: none; stroke: #f3f3ef; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.standards li:hover .std-tile { transform: rotate(-4deg) scale(1.04); }
.standards h3 { font-size: clamp(1.15rem, 1.5vw, 1.4rem); font-weight: 800; font-stretch: 108%; margin: 4px 0 6px; }
.standards p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }

/* ---------- Services: an oversized menu, each cut shown in a mirror ---------- */
.menu-board { position: relative; }
.menu-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas: "name time price book" "desc desc desc desc";
  column-gap: 18px; row-gap: 10px; align-items: end;
  padding: clamp(22px, 2.6vw, 40px) 16px;
}
.menu-row h3 {
  grid-area: name; margin: 0;
  font-size: clamp(2.2rem, 5.3vw, 5.5rem); font-weight: 900; font-stretch: 82%;
  text-transform: uppercase; line-height: .86; letter-spacing: -.005em;
}
.menu-row p { grid-area: desc; max-width: 58ch; }
.menu-row .menu-time { grid-area: time; min-width: 96px; height: 64px; font-size: 16px; }
.menu-row .menu-price { grid-area: price; min-width: 104px; height: 72px; font-size: clamp(1.5rem, 2.2vw, 2.2rem); }
.menu-row .menu-book { grid-area: book; align-self: center; }
.services .menu-preview {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  width: clamp(200px, 17vw, 270px); aspect-ratio: 3 / 4; margin: 0;
  opacity: 0;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--rot, -3deg)) scale(.9);
  transition: opacity .25s ease-out, transform .5s var(--ease-out);
}
.services .menu-preview img { width: 100%; height: 100%; object-fit: cover; clip-path: inset(100% 0 0 0); transition: clip-path .55s var(--ease-out); }
.services .menu-preview.is-on { opacity: 1; transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--rot, -3deg)) scale(1); }
.services .menu-preview.is-on img { clip-path: inset(0 0 0 0); }

/* ---------- Reviews: a wall of enamel plaques ---------- */
.reviews { display: block; }
.reviews-head { max-width: 760px; margin: 0 auto clamp(72px, 8vw, 128px); text-align: center; padding: clamp(24px, 3vw, 40px); }
.reviews-head p { margin-top: 12px; color: var(--ink-soft); font-size: 15.5px; }
.plaques {
  max-width: var(--content); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 40px); align-items: start;
}
.plaque {
  position: relative; z-index: 2; margin: 0;
  padding: clamp(28px, 3vw, 46px) clamp(24px, 2.6vw, 40px);
  background: #f6f6f2 linear-gradient(180deg, #ffffff, #f0f0ec);
  border-radius: 6px; color: var(--cobalt-deep);
  box-shadow: inset 0 0 0 3px #ffffff, inset 0 0 0 5px rgba(11, 32, 103, .85), 0 4px 8px -2px rgba(0, 0, 0, .45);
  transform: translate3d(0, calc(var(--drift, 0) * var(--dy, 0px)), 0);
}
.plaque-lift { margin-top: clamp(40px, 6vw, 96px); }
.plaque blockquote { margin: 0; }
.plaque blockquote p { font-weight: 700; font-stretch: 105%; font-size: clamp(1.25rem, 1.85vw, 1.8rem); line-height: 1.18; letter-spacing: -.015em; text-wrap: pretty; }
.plaque figcaption { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.plaque figcaption strong { font-weight: 700; font-size: 16px; }
.plaque figcaption span { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- Gallery: the caption tile inverts on hover ---------- */
.gallery-track figure:hover figcaption { background: var(--cobalt-deep); color: #fff; box-shadow: inset 0 0 0 1px #0a1c5c; }
.gallery-track figure:hover figcaption span { color: var(--cobalt-mist, #cfd7f0); }
.gallery-track figcaption { transition: background-color .25s, color .25s; }

/* ---------- Footer: the closing line ---------- */
.foot-close {
  display: flex; flex-direction: column; align-items: center; gap: clamp(26px, 3vw, 44px);
  max-width: var(--content); margin: 0 auto; padding: clamp(36px, 5vw, 72px) clamp(20px, 3vw, 48px);
}
.foot-big {
  margin: 0; text-align: center; color: var(--cobalt-deep);
  font-weight: 900; font-stretch: 82%; text-transform: uppercase;
  font-size: clamp(3rem, 9.6vw, 10.4rem); line-height: .86; letter-spacing: -.012em;
}
.foot-big span { display: inline-block; }
.js .foot-big:not(.is-in) span { clip-path: inset(0 0 100% 0); transform: translateY(18%); }
.foot-big span { transition: clip-path .8s var(--ease-out), transform .8s var(--ease-out); }
.foot-big span + span { transition-delay: .12s; }
.foot-book { min-height: 64px; padding: 0 38px; font-size: 18px; }
.foot-course { margin-top: clamp(28px, 3.4vw, 48px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .story .story-copy, .story .standards { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  .ticker span, .ticker i { font-size: 1.5rem; }
}
@media (max-width: 760px) {
  .story .standards { grid-template-columns: 1fr; }
  .menu-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "name name name" "desc desc desc" "time price book";
    row-gap: 12px; align-items: center;
  }
  .menu-row h3 { font-size: clamp(2.1rem, 11vw, 3.2rem); }
  .menu-row .menu-time { min-width: 76px; height: 52px; font-size: 14px; }
  .menu-row .menu-price { min-width: 80px; height: 56px; font-size: 1.35rem; }
  .menu-row .menu-book { justify-self: end; }
  .plaques { grid-template-columns: 1fr; }
  .plaque-lift { margin-top: 0; }
  .plaque { transform: none; }
  .services .menu-preview { display: none; }
}

/* ---------- Reduced motion and QA captures ---------- */
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .plaque { transform: none; }
  .js .foot-big:not(.is-in) span { clip-path: none; transform: none; }
  .manifesto-line.is-reading .w { color: var(--cobalt-deep); }
}
.is-capture .ticker-track { animation: none; }
.is-capture .plaque { transform: none; }
.is-capture .foot-big span { clip-path: none !important; transform: none !important; }

/* =====================================================================
   FIXES — mobile-first audit (320 / 360 / 390 / 768 / 1024 / 1440)
   ===================================================================== */

/* Course fields sit under every section's content: a field snapped out
   to the next grout line can no longer paint over a neighbour's sign,
   button or text. Sections own the stacking; fields are the bottom layer. */
main > section:not(.hero), .site-foot { isolation: isolate; }
.course { z-index: auto; isolation: auto; background: transparent !important; }

/* Phones get the 1024px plates; large screens keep the 2048px ones. */
@media (max-width: 1099px) {
  .wordmark-art { background-image: image-set(url("../plates/wordmark-wall-1024.webp") 1x, url("../plates/wordmark-wall.webp") 2x) !important; }
}
.enamel, .hero-book { border-image-slice: 15 fill; }

/* Touch targets: 44px minimum everywhere a visitor taps. */
.text-link, .menu-book, .foot-nav a, .bar-mark, .bar-links a, .nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
.menu-book { white-space: nowrap; padding: 0 2px; }
.foot-nav a { padding: 0 8px; }
.bar .menu-btn, .hero-head .menu-btn { flex: none; width: 48px; height: 48px; }
.occasions-cta { white-space: nowrap; }

/* Tablet and down: the hero mirror stays in proportion. */
@media (max-width: 899px) {
  .hero-mirror { aspect-ratio: 4 / 5; max-width: 560px; margin-left: auto !important; margin-right: auto !important; }
  .hero-tagline { font-size: 18px !important; }
  .demo-strip { font-size: 12px !important; }
}

/* Team: one chair per row until there is room for three side by side. */
@media (max-width: 1023px) {
  .team-grid { grid-template-columns: 1fr; max-width: 820px; }
  .barber { display: grid !important; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); column-gap: clamp(20px, 3vw, 32px); align-items: center; }
  .barber .mirror-frame { aspect-ratio: 3 / 4 !important; }
  .barber-plate { margin: 0 !important; }
  .journal-grid { grid-template-columns: 1fr; max-width: 760px; }
  .post-alt { margin-top: 0; }
}
@media (max-width: 600px) {
  .barber { display: flex !important; flex-direction: column; align-items: stretch; }
  .barber .mirror-frame { aspect-ratio: 4 / 4.4 !important; }
  .barber-plate { margin-top: 20px !important; }
}

/* Testimonials: three plaques only when they have the width for it. */
@media (max-width: 900px) {
  .plaques { grid-template-columns: 1fr; max-width: 620px; }
  .plaque-lift { margin-top: 0; }
  .plaque { transform: none; }
}

/* Small phones (320–480). */
@media (max-width: 480px) {
  .story .manifesto { padding: 20px 18px; }
  .story .manifesto-line { font-size: 8.4vw; letter-spacing: -.03em; overflow-wrap: anywhere; }
  .board-body { padding: 20px 14px; }
  .board-rail li { padding: 12px 6px; gap: 6px; font-size: 13px; justify-content: center; }
  .board-rail span { width: 26px; height: 26px; font-size: 13px; }
  .pick { flex-wrap: wrap; row-gap: 10px; }
  [data-picks="service"] .pick strong { flex: 1 1 100%; }
  .pick-cells { margin-left: auto; }
  .board-summary { padding: 20px 16px; }
  .foot-big { font-size: 15.5vw; }
}
/* Desktop: short nav words still get a 44px-wide target; the notice never drops under 12px. */
.nav-links a, .bar-links a { min-width: 44px; justify-content: center; }
.demo-strip { font-size: max(calc(27 * var(--u)), 12px); }
/* FAQ side panel: sticky beside the questions on desktop, in normal flow below 1101px.
   (The generic .course rule had made it relative, so its 110px sticky offset pushed it onto the list.) */
@media (min-width: 1101px) { .faq-side.course { position: sticky; top: 110px; } }
@media (max-width: 1100px) { .faq-side.course { top: auto; } }
/* Very small phones: the menu's time, price and link fit on one line; the notice stays on one line. */
@media (max-width: 400px) {
  .menu-row { column-gap: 10px; padding-left: 10px; padding-right: 10px; }
  .menu-row .menu-time { min-width: 64px; font-size: 13.5px; }
  .menu-row .menu-price { min-width: 68px; }
  .demo-strip { letter-spacing: .05em !important; }
}
@media (max-width: 899px) { .hero-tagline { margin-top: 14px !important; } }
/* The ticker is already the cobalt course between hero and story: no second liner (with its joints) under it. */
.ticker + .story::before { display: none; }
