/* Shared floor: tokens, reset, forms, compare slider, contact bar.
   The look (colour tokens, layout) lives in site.css. Logical properties only (RTL page). */

@property --p { syntax: '<number>'; inherits: true; initial-value: 0.5; }

:root {
  --e-out: cubic-bezier(0.23, 1, 0.32, 1);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;
  --gutter: clamp(16px, 4.5vw, 64px);
  --section: clamp(64px, 10vw, 136px);
  --measure: 62ch;
  --bar-h: 0px;
  --radius: 2px;
  --f-body: 'Assistant', system-ui, sans-serif;
  --f-display: 'Assistant', system-ui, sans-serif;
  --t-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
}

/* z-index scale (systemic layers only): 50 sticky page chrome |
   80 mobile contact bar | 100 skip link. Nothing else sets z-index. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-block-start: var(--head-h, 64px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--t-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--canvas);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
::selection { background: var(--accent-fill); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; inset-block-start: var(--s2); inset-inline-start: var(--s2); z-index: 100; padding: var(--s2) var(--s4); background: var(--ink); color: var(--canvas); transform: translateY(-200%); }
.skip:focus { transform: none; }

/* Reveal: opacity + small rise; reduced motion keeps opacity only. */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 520ms var(--e-out), transform 520ms var(--e-out); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal].reveal-now { transition: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { transform: none; transition: opacity 200ms linear; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding-inline: var(--s5);
  border: 1px solid currentColor; border-radius: var(--radius);
  background: transparent; color: inherit; font-weight: 600; font-size: var(--t-0); line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 140ms var(--e-out), background-color 140ms var(--e-out), color 140ms var(--e-out), border-color 140ms var(--e-out);
}
.btn:active { transform: scale(0.97); }
.btn--solid { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
  .btn--solid:hover { filter: brightness(1.08); }
}
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }

/* Form */
.lead { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s5); }
.field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.field--wide, .lead__actions { grid-column: 1 / -1; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: var(--s3) var(--s4);
  background: var(--field-bg, transparent); border: 1px solid var(--line-strong, currentColor); border-radius: var(--radius);
  text-align: start;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.field [aria-invalid='true'] { border-color: var(--danger, #b3261e); box-shadow: inset 0 0 0 1px var(--danger, #b3261e); }
.lead__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.lead__status { font-size: 0.875rem; min-height: 1.5em; color: var(--ink-soft); }
.lead__status[data-state='error'] { color: var(--danger, #b3261e); font-weight: 600; }
@media (max-width: 640px) { .lead { grid-template-columns: 1fr; } }

/* Compare slider (RTL-safe: positions use inset-inline-*, clip uses the page direction) */
.cmp { position: relative; overflow: hidden; aspect-ratio: 16 / 9; --p: 0.5; touch-action: pan-y; user-select: none; -webkit-user-select: none; background: #111; }
.cmp__layer { position: absolute; inset: 0; }
.cmp__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* RTL: before is revealed from the right edge, so the left share (1 - p) is clipped away. */
.cmp__layer--before { clip-path: inset(0 0 0 calc((1 - var(--p)) * 100%)); }
[dir='ltr'] .cmp__layer--before { clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0); }
.cmp__divider { position: absolute; inset-block: 0; inset-inline-start: calc(var(--p) * 100%); width: 0; pointer-events: none; }
.cmp__divider::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: -1px; width: 2px; background: var(--cmp-line, #f4f4f1); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.cmp__handle {
  position: absolute; inset-block-start: 50%; inset-inline-start: -28px; width: 56px; height: 56px; margin-block-start: -28px;
  display: grid; place-items: center; padding: 0; border: 2px solid var(--cmp-line, #f4f4f1); border-radius: 50%;
  background: var(--cmp-handle, #1b1d1f); color: var(--cmp-line, #f4f4f1); cursor: ew-resize; pointer-events: auto; touch-action: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.cmp__handle::before, .cmp__handle::after { content: ''; position: absolute; inset-block-start: 50%; width: 9px; height: 9px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
/* Arrows are symmetric, so they use physical sides: right one points right, left one points left. */
.cmp__handle::before { right: 12px; transform: translateY(-50%) rotate(45deg); }
.cmp__handle::after { left: 12px; transform: translateY(-50%) rotate(-135deg); }
.cmp.is-dragging { cursor: ew-resize; }
@media (prefers-reduced-motion: no-preference) { .cmp.is-keying { transition: --p 200ms var(--e-out); } }
@media (hover: hover) and (pointer: fine) { .cmp__handle:hover { transform: scale(1.06); } }
.cmp__handle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Mobile conversion bar: one-tap WhatsApp and one-tap call. 61px (52px buttons), about 7% of a 844px screen.
   It steps aside (main.js watchBar) while a heading, the contact section, the form or the footer is on screen;
   hidden means out of the tab order too (visibility after the slide). */
.contactbar { display: none; }
@media (max-width: 767px) {
  :root { --bar-h: calc(61px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-block-end: calc(var(--bar-h) + 16px); }
  .contactbar {
    position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 80; display: flex; gap: var(--s2);
    padding: var(--s1) var(--s3) calc(var(--s1) + env(safe-area-inset-bottom, 0px));
    background: var(--bar-bg); border-block-start: 1px solid var(--bar-line);
    transition: transform 200ms var(--e-out), visibility 0s linear 0s;
  }
  .contactbar.is-away { transform: translateY(100%); visibility: hidden; transition: transform 200ms var(--e-out), visibility 0s linear 200ms; }
  .contactbar .btn { min-height: 52px; padding-inline: var(--s4); font-size: 1rem; }
  .contactbar .btn--wa { flex: 1 1 auto; min-width: 0; background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
  .contactbar .btn--tel { flex: 0 0 auto; color: var(--bar-ink); }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) { .contactbar, .contactbar.is-away { transition: none; } }

.noscript, .boot-error { padding: var(--s7) var(--gutter); max-width: var(--measure); }
