/* =====================================================================
   Gable & Blade · MOTION — light and the laying of tile.
   Focal moment: the hero sign is set tile by tile, course by course,
   then one stroke of daylight crosses the glaze. Afterwards the light
   follows the visitor (pointer on desktop, scroll on touch). Everything
   else is quiet feedback that explains state. Content is visible by
   default; all of this is added by site.js and skipped under
   prefers-reduced-motion and ?capture.
   ===================================================================== */
@property --sx { syntax: "<length-percentage>"; inherits: false; initial-value: 28%; }
@property --sy { syntax: "<length-percentage>"; inherits: false; initial-value: 22%; }
@property --sweep { syntax: "<percentage>"; inherits: false; initial-value: 170%; }

/* ---------- Daylight on the glaze (masked to the cobalt lettering) ---------- */
.wm-sheen {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  -webkit-mask: url("../plates/wordmark-glaze-mask.webp") left top / cover no-repeat;
          mask: url("../plates/wordmark-glaze-mask.webp") left top / cover no-repeat;
  background:
    radial-gradient(ellipse 30% 22% at var(--sx) var(--sy), rgba(255, 255, 255, .42), rgba(255, 255, 255, .12) 45%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(104deg, transparent 44%, rgba(255, 255, 255, .5) 49.5%, rgba(255, 255, 255, .16) 51.5%, transparent 56%) var(--sweep) 0 / 320% 100% no-repeat;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .6s var(--ease-out), --sx .45s var(--ease-out), --sy .45s var(--ease-out);
}
.wm-sheen.is-lit { opacity: 1; }
.wm-sheen.is-sweeping { animation: glaze-sweep 1.15s cubic-bezier(.3, .1, .2, 1) both; }
@keyframes glaze-sweep { from { --sweep: 170%; } to { --sweep: -70%; } }

/* ---------- Setting the sign ---------- */
.wordmark-art { overflow: hidden; }
.wordmark-art.is-laying {
  background-image: none !important;
  /* the adhesive bed, combed, before the first tile goes on */
  background-color: #c7c2ba;
  box-shadow: inset 0 0 0 1px rgba(18, 19, 22, .06), inset 0 18px 30px -24px rgba(18, 19, 22, .3);
}
.wm-tiles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.wm-tile {
  position: absolute;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

/* ---------- Booking board: each step's tiles are set as it opens ---------- */
@keyframes tile-set {
  from { opacity: 0; transform: translateY(10px) scale(.985); box-shadow: 0 10px 16px -10px rgba(18, 20, 28, .35); }
  to { opacity: 1; transform: none; }
}
.is-arriving > .pick { animation: tile-set .34s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 32ms); }
.pick:active:not(:disabled) { transform: scale(.975); transition-duration: 80ms; }

/* The summary acknowledges each choice once. Colour only, so it survives reduced motion. */
@keyframes sum-flash { from { background-color: #cfd7f0; color: var(--cobalt-lit); } to { background-color: rgba(207, 215, 240, 0); } }
.board-summary dd { border-radius: 3px; padding: 2px 6px; margin-right: -6px; }
.board-summary dd.is-new { animation: sum-flash .8s ease-out; }

/* The ticket is stamped: its cobalt bar is drawn across, then the lines are printed. */
.ticket { border-top: 0; position: relative; padding-top: 30px; }
.ticket::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 3px;
  background: var(--cobalt-deep); transform-origin: left center;
}
.board-done:not([hidden]) .ticket::before { animation: bar-draw .55s var(--ease-out) both; }
.board-done:not([hidden]) .ticket-rows > div { animation: line-print .4s var(--ease-out) both; }
.board-done:not([hidden]) .ticket-rows > div:nth-child(1) { animation-delay: .18s; }
.board-done:not([hidden]) .ticket-rows > div:nth-child(2) { animation-delay: .24s; }
.board-done:not([hidden]) .ticket-rows > div:nth-child(3) { animation-delay: .30s; }
.board-done:not([hidden]) .ticket-rows > div:nth-child(4) { animation-delay: .36s; }
@keyframes bar-draw { from { transform: scaleX(0); } to { transform: none; } }
@keyframes line-print { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* The rail's step tile inverts when it becomes the current step. */
.board-rail span { transition: background-color .25s, color .25s, border-color .25s; }

/* ---------- FAQ: the answer unfolds under its question ---------- */
.faq-list details[open] > p { animation: faq-open .32s var(--ease-out); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Reduced motion and QA captures ---------- */
@media (prefers-reduced-motion: reduce) {
  .wm-sheen, .wm-tiles { display: none; }
  .is-arriving > .pick, .ticket::before, .ticket-rows > div, .faq-list details[open] > p { animation: none !important; }
  .pick:active:not(:disabled) { transform: none; }
  /* colour-only acknowledgement stays */
  .board-summary dd.is-new { animation-duration: .8s !important; }
}
.is-capture .wm-sheen, .is-capture .wm-tiles { display: none; }
.is-capture .wordmark-art.is-laying { background-image: inherit !important; }

@media (max-width: 899px) {
  .wm-sheen { -webkit-mask-size: 100% auto; mask-size: 100% auto; -webkit-mask-position: center top; mask-position: center top; }
}
