/* ============================================================
   MKO motion: shared by every page (with motion.js).
   Slow and quiet on purpose. Everything here switches off when the
   visitor's device asks for reduced motion, and the page reads fine
   without JavaScript: hidden states only apply under html.mo, which a
   one-line script in each page's <head> sets.
   ============================================================ */

/* ---------- Gold lines (always shown; they draw in when motion is on) ---------- */
.section-head .label::after{content:""; display:block; width:36px; height:1px; margin-top:12px; background:var(--gold); transform-origin:left}
.section-head.center .label::after{margin-inline:auto; transform-origin:center}
.process{position:relative}
.process::before{content:""; position:absolute; left:0; right:0; top:-1px; height:1px; background:var(--gold); transform-origin:left}

/* ---------- Header: soft shadow once the page scrolls ---------- */
.site-header{transition:box-shadow .3s ease}
.site-header.scrolled{box-shadow:0 8px 28px rgba(3,20,46,.16)}

/* ---------- Form fields: gold underline slides in on focus ---------- */
.field input, .field textarea{
  background-image:linear-gradient(var(--gold), var(--gold)); background-repeat:no-repeat;
  background-position:left bottom; background-size:0 2px; transition:background-size .45s cubic-bezier(.2,.7,.2,1);
}
.field select{
  background-image:linear-gradient(var(--gold), var(--gold)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2356637A' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:left bottom, right 15px center; background-size:0 2px, auto;
  transition:background-size .45s cubic-bezier(.2,.7,.2,1);
}
.field input:focus, .field textarea:focus{background-size:100% 2px}
.field select:focus{background-size:100% 2px, auto}

@media (prefers-reduced-motion: no-preference){

  /* ---------- 1. Content rises in as it scrolls into view ---------- */
  .mo .rv{opacity:0; transform:translateY(16px); transition:opacity .9s ease, transform 1s cubic-bezier(.2,.7,.2,1); transition-delay:var(--rv-d, 0s)}
  .mo .in > .rv, .mo .rv.in{opacity:1; transform:none}

  /* ---------- 2. Page titles settle in on load (guide and service area pages) ---------- */
  .mo .area-hero .crumbs,
  .mo .area-hero .section-head > *,
  .mo .area-hero .hero-actions,
  .mo .guide-page > .wrap > .section-head:first-child > *,
  .mo .guide-page .sample-bar{animation:mko-rise .9s cubic-bezier(.2,.7,.2,1) both}
  .mo .area-hero .section-head > :nth-child(1), .mo .guide-page > .wrap > .section-head:first-child > :nth-child(1){animation-delay:.08s}
  .mo .area-hero .section-head > :nth-child(2), .mo .guide-page > .wrap > .section-head:first-child > :nth-child(2){animation-delay:.18s}
  .mo .area-hero .section-head > :nth-child(n+3), .mo .guide-page > .wrap > .section-head:first-child > :nth-child(n+3){animation-delay:.3s}
  .mo .area-hero .hero-actions, .mo .guide-page .sample-bar{animation-delay:.42s}

  /* ---------- 5. Gold lines draw in ---------- */
  .mo .section-head .label::after{transform:scaleX(0); transition:transform 1.1s cubic-bezier(.6,0,.2,1) .35s}
  .mo .section-head.in .label::after{transform:none}
  .mo .area-hero .section-head .label::after,
  .mo .guide-page > .wrap > .section-head:first-child .label::after{animation:mko-line 1.1s cubic-bezier(.6,0,.2,1) .5s both}
  .mo .process::before{transform:scaleX(0); transition:transform 1.6s cubic-bezier(.6,0,.2,1) .2s}
  .mo .process.in::before{transform:none}

  /* ---------- 6. A glint crosses the gold buttons on hover ---------- */
  .btn-gold{position:relative; overflow:hidden; isolation:isolate}
  .btn-gold::after{
    content:""; position:absolute; inset:-2px auto -2px 0; width:55%; z-index:-1; pointer-events:none;
    background:linear-gradient(105deg, transparent 15%, rgba(255,250,235,.75) 50%, transparent 85%);
    transform:translateX(-160%) skewX(-18deg);
  }
  @media (hover: hover){
    .btn-gold:hover::after{transform:translateX(260%) skewX(-18deg); transition:transform .9s cubic-bezier(.3,.6,.3,1)}
  }

  /* ---------- 7. Diamond guide charts build when a tab opens ---------- */
  .mo .panel .color-strip > div{opacity:0; transform:translateY(12px)}
  .mo .panel .ladder > div{opacity:0; transform:translateX(-14px)}
  .mo .panel #sizesSvg > *{opacity:0}
  .mo .panel #sizesSvg > circle{transform-box:fill-box; transform-origin:center; transform:scale(.15)}
  .mo .panel.built .color-strip > div,
  .mo .panel.built .ladder > div,
  .mo .panel.built #sizesSvg > *{
    opacity:1; transform:none;
    transition:opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1.15); transition-delay:var(--i-d, 0s);
  }

  /* ---------- 9. Cards respond to hover ---------- */
  @media (hover: hover){
    .price-card, .town-card{transition:transform .35s cubic-bezier(.2,.7,.2,1), border-color .25s, box-shadow .35s}
    .price-card:hover, .town-card:hover{transform:translateY(-4px); border-color:var(--gold); box-shadow:0 14px 34px rgba(3,20,46,.08)}
  }

  /* ---------- 10. Booking form: chips press in, the check pops ---------- */
  .bf-chip{transition:background .15s, color .15s, border-color .15s, transform .12s}
  .bf-chip:active{transform:scale(.95)}
  .bf-chip[aria-pressed="true"]::before{animation:mko-check .35s cubic-bezier(.3,1.6,.5,1)}

  /* ---------- 3. FAQ: the arrow turns back as soon as an answer starts closing ---------- */
  .faq details[open][data-closing] summary::after{transform:rotate(45deg); top:28px}

  /* ---------- 4. Page changes cross-fade (browsers that support it) ---------- */
  @view-transition{navigation:auto}
  .site-header{view-transition-name:site-header}
  ::view-transition-old(root), ::view-transition-new(root){animation-duration:.35s}
}

@keyframes mko-rise{from{opacity:0; transform:translateY(16px)} to{opacity:1; transform:none}}
@keyframes mko-line{from{transform:scaleX(0)} to{transform:none}}
@keyframes mko-check{
  from{transform:rotate(-45deg) translate(1px,-1px) scale(0)}
  to{transform:rotate(-45deg) translate(1px,-1px) scale(1)}
}
