/* ==========================================================================
   Okayam Auto Repair Shop: shut lines

   Loaded AFTER styles.css, and it owns no colour, no type and no spacing
   decision of its own. Every value comes from the tokens in styles.css.

   THE IDEA, and why this file was rewritten.

   The first pass gave the hero a photograph that drifted and scaled on scroll
   with a band of light travelling across it, drew every section rule out from
   its left end, tipped the step panels up off a perspective, and ran a skewed
   white gradient across the primary button on hover. All five of those are
   the EDGE Performance build's own signatures, line for line in places: its
   `heroDrift`, `sweep`, `drawRule` and `rowDepth`. Reusing another client's
   look is not design, and the shop would have been paying for a second copy
   of someone else's site.

   So the language here comes from this trade instead.

   A body shop is judged on its gaps. When a panel has been replaced, the test
   of the work is whether the shut line between it and the next panel is even
   from one end to the other, and whether the panel sits flush. That is what a
   customer runs a thumb along before they believe the repair.

   This site is already built from shut lines and nobody had noticed: every
   list on it is a 1px hairline grid, a row of panels with an even gap between
   them. So the rule for every piece of motion here:

     things SEAT INTO ALIGNMENT, and gaps get MEASURED.

   Nothing rises. Nothing fades up. Nothing tips, tilts, drifts or catches the
   light. A panel that bounces into place is a badly fitted panel, so no
   easing in this file overshoots.

   Three constraints it is written against:

   1. IntersectionObserver does not fire in this project's target environment.
      Every viewport test is a throttled scroll listener plus
      getBoundingClientRect, which is what site.js already does.
   2. Transform and opacity only, so none of this costs a layout pass.
   3. Reduced motion removes it, in the one block at the bottom. Nothing here
      may be the only way content becomes visible.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SCROLL RAIL

   Two pixels of primary under the fixed header: how much of a 6,000px page is
   left. JS writes --scroll-progress as a 0 to 1 number and CSS does the rest,
   so the scroll handler never touches layout.
   -------------------------------------------------------------------------- */

.scroll-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}
.scroll-rail__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--primary);
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: 0 50%;
  /* No transition. The value is written once per frame already, and easing a
     per-frame value makes it lag the scroll instead of tracking it. */
}

/* --------------------------------------------------------------------------
   2. THE HERO PHOTOGRAPH DOES NOTHING

   Deliberate, and worth stating so it does not get "fixed" later.

   It had a scroll-driven drift and scale with a pass of light across it. Both
   were EDGE's. Beyond that they were working against this page: the shop
   front is the LCP image and the one photograph of the real premises, the
   wrapper carries a legibility scrim whose 4.5:1 ramp was measured against an
   unscaled image, and a building that sways when you scroll is not the
   impression a repair shop wants to leave.

   The hero's entrance is still authored, but it moved: see `hero-rise` in
   styles.css, which now seats the column sideways against the left margin
   instead of floating it up the page.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   3. SECTION HEADS: A DIMENSION MARK

   Not a rule that draws itself out from one end. That is EDGE's `drawRule`,
   and it says nothing about this business. This is the mark an engineering
   drawing uses for a measured gap: a span with a tick at each end, with the
   ticks starting together at the centre and travelling out to the ends. A
   measurement being taken, not a line being drawn.

   It is built ON the 26px dash the eyebrow already had, not beside it. The
   first attempt hung a second 48px span under the eyebrow and put the two
   ticks on `.section-head::before/::after`, which are positioned against the
   whole heading block: they landed eleven pixels under the LEDE, two blue
   marks floating in the margin measuring nothing, while the eyebrow carried
   two competing rules above them. One mark, one anchor.

   Both ticks live in a single pseudo-element as two background slices, since
   the dash has already taken ::before and an eyebrow has only the two. They
   spread by background-position, which paints a 26 by 8 pixel box and costs
   nothing at that size.
   -------------------------------------------------------------------------- */

.section-head .eyebrow::after {
  content: '';
  position: absolute;
  /* Same origin as the dash in styles.css, lifted half the tick height so the
     ticks are centred on it rather than hanging off it. */
  left: 0;
  top: 0.55em;
  margin-top: -3px;
  width: 26px;
  height: 8px;
  background-image:
    linear-gradient(var(--primary), var(--primary)),
    linear-gradient(var(--primary), var(--primary));
  background-size: 2px 100%, 2px 100%;
  background-repeat: no-repeat;
  /* At rest both ticks sit together at the centre of the span. */
  background-position: 12px 0, 12px 0;
  transition: background-position 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.section-head.is-in .eyebrow::after {
  background-position: 0 0, 24px 0;
}
/* No JS, no .is-in, so the measurement is simply already taken. */
html:not(.reveal-on) .section-head .eyebrow::after {
  background-position: 0 0, 24px 0;
}

/* --------------------------------------------------------------------------
   4. SERVICE ROWS

   The rows are already a hairline grid, which is already a run of panels with
   an even gap. The row's left shut line is the thing that changes: it was
   widening from 0 to 3px, a bar getting fatter. Now it is full width from the
   start and wipes down, which reads as the row being picked out. The chip
   inverting is the same decision: the icon stops being a label and becomes
   the selected state.
   -------------------------------------------------------------------------- */

.svc::after {
  width: 3px;
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.svc:hover::after,
.svc:focus-visible::after { width: 3px; transform: scaleY(1); }

.svc__icon {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.svc:hover .svc__icon,
.svc:focus-visible .svc__icon {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-dark);
}
/* The row's text seats 3px toward its own shut line. Sideways, like
   everything else in this file, and it stops dead. */
.svc__body { transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.svc:hover .svc__body,
.svc:focus-visible .svc__body { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   5. THE STEP BAND: PANELS BEING HUNG

   Four panels on a hairline grid, the component styles.css already defines
   for /book and nothing had ever used.

   Each panel arrives 16px short of its place and seats sideways into it, one
   after another, left to right. The grid's 1px gap is the sheet showing
   through behind the panels, so while a panel is still short of home the gap
   beside it is visibly too wide, and it closes to a hairline as the panel
   seats. The metaphor runs itself: the whole band is four gaps going even.

   The easing stops dead. No overshoot, no bounce. A panel that springs into
   place is a panel that is not fitted.
   -------------------------------------------------------------------------- */

html.reveal-on .section--how .step {
  opacity: 0;
  transform: translate3d(-16px, 0, 0);
  transition: opacity 0.34s ease, transform 0.52s cubic-bezier(0.2, 0.86, 0.3, 1);
}
html.reveal-on .section--how .step.is-in {
  opacity: 1;
  transform: none;
}

/* Two of the four headings wrap to a second line and two do not, so the body
   copy under them started at four different heights: measured at 1100, 1280
   and 1440, the paragraphs in one row began 25px apart. Side by side in a
   row that reads as a misprint rather than as a rhythm.

   So the heading reserves two lines wherever the band is more than two
   columns wide. `lh` is the exact line box; the em value is the fallback for
   browsers that do not have it, and both are above the real two-line height
   so the shorter headings rise to meet the taller ones rather than the other
   way round. Below this width the band is one or two columns, every heading
   fits on one line, and reserving a second would only add dead space. */
@media (min-width: 820px) {
  .section--how .step h3 {
    min-height: 2.6em;
    min-height: 2lh;
  }
}

/* The ghost numeral is --surface-strong #ebecee at rest, 1.1:1 on white:
   deliberately almost the page. It warms to blue as its panel seats.

   The landed colour is a literal, not --primary-soft. --primary-soft #e8f0fc
   measures 1.08:1, so animating to it is a change from one invisible colour
   to another: motion nobody can see. #afcaf0 is --primary at 35% on white,
   about 1.8:1, visibly blue and still plainly behind the heading. The numeral
   is aria-hidden and the list is an <ol>, so the order survives without it. */
.section--how .step__num { transition: color 0.6s 0.1s ease; }
.section--how .step.is-in .step__num { color: #afcaf0; }

/* --------------------------------------------------------------------------
   6. THE COMPARISON FRAME

   The card already shipped a Before tag and an After tag, so the captions
   added here first were a third and fourth label for two states. These are
   the originals: site.js writes --tag-fade from the seam position and each
   tag fades over the last stretch before the seam reaches it, because a label
   standing in a sliver of its own photograph cannot be read.

   The entrance transition on those tags carries a 0.5s delay, which is right
   when a card arrives and far too slow under a thumb, so inside a comparison
   frame it is overridden.
   -------------------------------------------------------------------------- */

/* `.job__shot` is in this chain to outweigh the entrance rule in styles.css,
   which matches `.job__shot:nth-of-type(2) .job__tag` and so carries one more
   compound than a selector that stops at the pair. Without it the AFTER tag
   kept its 0.7s entrance delay: dragging the seam to the far right left the
   label sitting over an empty sliver for most of a second. Measured, not
   reasoned about: it read opacity 1 at seam 95 and seam 100. */
html.reveal-on .job[data-reveal].is-in .job__pair--compare .job__shot .job__tag {
  transition: opacity 0.16s ease;
  transition-delay: 0s;
}

/* The card lift lives in styles.css and always has. Nothing to add here. */

/* --------------------------------------------------------------------------
   7. THE PHONE BAR

   Under 720px the hero's two buttons leave and do not come back for the rest
   of the page. This is a booking decision rather than a motion one: the band
   exists because the page is long. It seats up from the edge rather than
   appearing, so it does not read as an advert.

   The primary button is not touched anywhere in this file. It already lifts,
   glows and presses back down in styles.css, and a second gesture on top of a
   complete one is noise.
   -------------------------------------------------------------------------- */

.book-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: none;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(26, 33, 41, 0.96);
  border-top: 1px solid var(--line-dark);
  transform: translate3d(0, 110%, 0);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.book-bar.is-up { transform: none; }
.book-bar .btn {
  flex: 1;
  justify-content: center;
  /* Measured at 390px: "Book an appointment" wrapped to two lines and took
     the bar to 99px, a third of a phone screen for two buttons. The label is
     shorter in the markup now, and nowrap keeps the next narrow screen from
     finding its own way to wrap. */
  white-space: nowrap;
  padding: 13px 10px;
  min-height: 48px;
  font-size: 0.93rem;
}

@media (max-width: 720px) {
  .book-bar { display: flex; }
  /* The footer has to clear it, or the bar covers the last lines on the page
     for as long as the reader is at the bottom. */
  .site-footer__bottom { padding-bottom: 76px; }
}

/* --------------------------------------------------------------------------
   8. REDUCED MOTION

   One block, and it is authoritative. Everything above settles into its
   finished state or stops existing. Nothing is left invisible, and nothing
   here is the only route to content.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .scroll-rail { display: none; }

  .section-head .eyebrow::after {
    background-position: 0 0, 24px 0 !important;
    transition: none;
  }

  html.reveal-on .section--how .step,
  html.reveal-on .section--how .step.is-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
  .section--how .step__num { transition: none; }

  .svc::after { transform: scaleY(1) !important; width: 0; transition: none; }
  .svc:hover::after, .svc:focus-visible::after { width: 3px; }
  .svc:hover .svc__body, .svc:focus-visible .svc__body { transform: none; }

  .book-bar { transition: none; }
}

/* --------------------------------------------------------------------------
   9. LIGHT IN THE ROOM

   The rule at the top of this file says nothing catches the light, and that
   rule stands for OBJECTS: no gradient travels across a button or a
   photograph, because that is a trick played on a thing. Light in the room
   is a different claim. A spray booth is a box lined with lamps, and a
   finished panel is judged under them. So the bands get lit, and the things
   standing in them do not.

   Everything here is one of two moves, both of them slow enough to read as
   atmosphere rather than as animation:

     a bloom that breathes, on a 16 to 22 second cycle
     a flake texture that does not move at all

   The flake is the point of the second one. Automotive paint has metal in it.
   Flat #1a2129 across a 900px band reads as a CSS colour; the same navy with
   a fine sparkle in it reads as something that was sprayed. It is static,
   because a moving dot field reads as television static, not as paint.
   -------------------------------------------------------------------------- */

@keyframes booth-breathe {
  from { opacity: 0.58; transform: scale(1); }
  to   { opacity: 1;    transform: scale(1.07); }
}

/* ---- The hero ----
   The blue bloom that was already on `.hero::before` has never once been
   seen: it sits behind `.hero__photo`, which is an opaque full-bleed
   photograph, so it was painting underneath a wall. Lifted above the photo
   and given something to do.

   It starts at 54% of the hero and runs off the right edge, and that is a
   contrast decision, not a composition one. The headline and the lede end at
   54%, and the scrim behind them carries a ramp that was measured to 4.5:1
   against an unlit photograph. Light that cannot reach the text cannot
   change what was measured. What it does reach is the hours card, which is
   opaque white, so the card ends up standing in a pool of light. */
.hero::before {
  top: -24%;
  left: 54%;
  right: -12%;
  width: auto;
  height: 148%;
  z-index: 1;
  background: radial-gradient(ellipse at 44% 50%,
    rgba(110, 168, 245, 0.26), rgba(110, 168, 245, 0.08) 42%, transparent 66%);
  animation: booth-breathe 18s ease-in-out infinite alternate;
  will-change: opacity, transform;
}

/* ---- The dark bands ----
   The flake, as an extra background layer on the band itself rather than a
   pseudo-element, so it costs no node and no stacking context. 0.5px dots on
   a 7px grid at 4% white: invisible as dots, present as material. */
.section--dark {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.045) 0.5px, transparent 0.6px);
  background-size: 7px 7px;
  background-color: var(--dark);
}

/* And the lamp. Bottom left, opposite the map, on a slower cycle than the
   hero so the two never pulse together. */
.section--dark::before {
  content: '';
  position: absolute;
  left: -14%;
  bottom: -30%;
  width: 70%;
  height: 120%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 36% 64%,
    rgba(110, 168, 245, 0.17), rgba(110, 168, 245, 0.05) 44%, transparent 68%);
  animation: booth-breathe 22s ease-in-out infinite alternate;
  will-change: opacity, transform;
}
/* The band's own content sits above its lamp.

   Named wrappers, never `.section--dark > *`. A blanket child rule forces
   `position: relative` onto absolutely positioned layers and drops them into
   flow, and this band has exactly such a layer in `.locate__bg`, the
   photograph of the shop front behind the address. Naming the two wrappers
   leaves it where it is.

   `.locate__panel` already painted above the lamp by document order, since
   the lamp is a ::before. This stops that being load bearing. */
.section--dark > .wrap,
.section--dark > .locate__panel { position: relative; z-index: 1; }

/* The eyebrow's dash turns a lighter blue on a dark band so it holds against
   the navy. The ticks that cap it were still full --primary, which is the
   colour for white paper: two different blues in one 26px mark. */
.section--dark .section-head .eyebrow::after {
  background-image:
    linear-gradient(#6ea8f5, #6ea8f5),
    linear-gradient(#6ea8f5, #6ea8f5);
}

/* ---- The light bands ----
   The artboard runs for 5,000px behind three sections and carries two faint
   decorations that have always been frozen. The same breath, much weaker,
   because this is daylight through a roller door rather than a lamp. */
.artboard::before {
  animation: booth-breathe 26s ease-in-out infinite alternate;
  will-change: opacity, transform;
}

/* ---- Things standing in the light ----
   A card lifting under a neutral grey shadow looks like paper. The same lift
   under a shadow that carries the brand reads as a lit object, which is what
   a photograph of a repaired panel should be. Blue, low, and wide. */
.job:hover {
  box-shadow:
    0 18px 38px -12px rgba(28, 105, 212, 0.34),
    0 6px 16px -8px rgba(26, 33, 41, 0.18);
}
/* The service row picks up the same, scaled down: it is a row, not a card. */
.svc:hover,
.svc:focus-visible {
  box-shadow: 0 8px 22px -10px rgba(28, 105, 212, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  /* The blooms stay, because they are light rather than movement. They simply
     stop breathing, and they settle at the bright end rather than the dim one
     so nothing looks half-lit. */
  .hero::before,
  .section--dark::before,
  .artboard::before {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   10. THE SWIPE HINT

   Two photographs in a frame look like a picture, not a control, so on a
   phone the first thing people do is tap and wait. This is the smallest thing
   that says otherwise: one word between two chevrons, sitting on the seam's
   own line, gone the moment the seam is moved.

   It is deliberately still. An arrow that slides back and forth would read as
   the page glitching, which is exactly the note this gallery already got once.
   -------------------------------------------------------------------------- */

.job__hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 9px 5px 7px;
  border-radius: 999px;
  background: rgba(26, 33, 41, 0.84);
  color: var(--on-dark);
  white-space: nowrap;
  transition: opacity 0.25s ease;
}
.job__hint b {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 2px;
}
.job__hint svg { width: 13px; height: 13px; display: block; }

/* One move of the seam and it has said what it had to say. */
.job__pair[data-touched='yes'] .job__hint { opacity: 0; }

/* The frame is now swiped directly rather than tapped first, so the cursor
   should promise that on a desktop too. */
.job__pair--compare { cursor: ew-resize; }

@media (prefers-reduced-motion: reduce) {
  .job__hint { transition: none; }
}
