/* Polish and motion. Everything here is gentle and optional: with "reduce motion" switched on in the phone or
   computer settings, nothing moves at all (see the last block). Colours come from /theme.css. */
:root {
  --ease: cubic-bezier(.22, .8, .3, 1);
  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent), 0 6px 16px color-mix(in srgb, var(--text) 6%, transparent);
  --shadow-md: 0 2px 4px color-mix(in srgb, var(--text) 8%, transparent), 0 14px 30px color-mix(in srgb, var(--text) 12%, transparent);
}

/* ---- moving between pages: the page fades in and the header stays put ---- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: .16s ease both vt-out; }
::view-transition-new(root) { animation: .32s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes soft-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes step-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* ---- the home page opens with a gentle stagger ---- */
.hero .wrap > * { animation: fade-up .65s var(--ease) both; }
.hero .wrap > :nth-child(1) { animation-delay: .04s; }
.hero .wrap > :nth-child(2) { animation-delay: .12s; }
.hero .wrap > :nth-child(3) { animation-delay: .20s; }
.hero .wrap > :nth-child(4) { animation-delay: .28s; }
main > .wrap:first-child > h1, main > .wrap:first-child > .lead { animation: fade-up .5s var(--ease) both; }
main > .wrap:first-child > .lead { animation-delay: .08s; }

/* ---- sections slide up as they scroll into view (the class is added by site.js, so no script = no hiding) ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---- cleaner cards, buttons and links ---- */
.cards .card, .plan { box-shadow: var(--shadow-sm); transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s; }
.cards .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.btn { transition: transform .16s var(--ease), box-shadow .22s, filter .2s, background-color .2s, border-color .2s, opacity .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); filter: none; }
.btn:not(.btn-ghost):hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.site-header { transition: box-shadow .3s, background-color .3s; }
.site-header.scrolled { box-shadow: 0 4px 18px color-mix(in srgb, var(--text) 9%, transparent); }
.site-header nav a { background: linear-gradient(var(--highlight, var(--accent)), var(--highlight, var(--accent))) left calc(100% - 4px) / 0 3px no-repeat; transition: background-size .3s var(--ease), color .2s; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { background-size: 100% 3px; }
.brand-logo img { transition: transform .3s var(--ease); }
.brand-logo:hover img { transform: scale(1.03); }
.pill { transition: transform .2s var(--ease), box-shadow .2s, filter .2s; }
.pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
input[type="text"], input[type="tel"], input[type="email"], input[type="date"], input[type="time"], textarea, select { transition: border-color .2s, box-shadow .2s, background-color .2s; }
input[type="text"]:focus, input[type="tel"]:focus, input[type="email"]:focus, input[type="date"]:focus, input[type="time"]:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
details.group > summary { transition: color .2s; }
details.group[open] > :not(summary) { animation: soft-in .3s var(--ease) both; }
.sticky-cta { animation: fade-up .5s var(--ease) .4s both; }

/* ---- the booking form ---- */
[data-step]:not([hidden]) { animation: step-in .38s var(--ease) both; }
#booking-form[data-dir="back"] [data-step]:not([hidden]) { animation-name: step-in-back; }
.steps li { transition: border-color .4s var(--ease), color .3s; }
.choice { transition: border-color .2s, background-color .25s, transform .15s var(--ease), box-shadow .25s; }
.choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice:active { transform: scale(.992); }
.choice:has(input:checked) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.slot span { transition: background-color .2s, border-color .2s, transform .15s var(--ease), color .2s; }
.slot span:hover { transform: translateY(-1px); }
.slot input:checked + span { transform: scale(1.03); }
#quote-summary > *, #review > *, #when-pick .slots > * { animation: soft-in .3s var(--ease) both; }
.errors, #admin-msg { animation: fade-up .3s var(--ease) both; }
.suggestions { animation: fade-up .16s var(--ease) both; transform-origin: top; }
.rego-result { animation: soft-in .3s var(--ease) both; }
.rego-choices > * { animation: fade-up .3s var(--ease) both; }
.rego-choices > :nth-child(2) { animation-delay: .06s; }
.rego-choices > :nth-child(3) { animation-delay: .12s; }
.done:not([hidden]) { animation: pop-in .55s var(--ease) both; }
.must-confirm { transition: border-color .3s, background-color .3s, box-shadow .3s; }
.must-confirm.is-done { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---- the owner page ---- */
body.admin .booking { transition: transform .25s var(--ease), box-shadow .25s var(--ease); box-shadow: var(--shadow-sm); }
body.admin .booking:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.add-booking[open] > :not(summary) { animation: soft-in .3s var(--ease) both; }

/* ---- people who asked their device for less movement get none ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
