@layer reset, base, components, site;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body { margin: 0; min-width: 320px; overflow-x: hidden; }
  img { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; }
}

@layer base {
  :root {
    --z-dropdown: 20;
    --z-sticky: 30;
    --z-backdrop: 40;
    --z-modal: 50;
    --z-toast: 60;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
  }
  body { font-family: system-ui, sans-serif; font-size: 1rem; line-height: 1.6; }
  a { color: inherit; text-underline-offset: .2em; }
  :focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
  h1, h2, h3 { text-wrap: balance; }
  p { max-width: 70ch; text-wrap: pretty; }
  .skip-link { position: fixed; top: -80px; left: 16px; z-index: var(--z-toast); padding: 12px 16px; background: #fff; color: #000; }
  .skip-link:focus { top: 16px; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}

@layer components {
  .site-header { position: sticky; top: 0; z-index: var(--z-sticky); min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px clamp(18px, 4vw, 64px); background: #fff; color: #111; border-bottom: 1px solid #c9c9c9; }
  .site-header nav { display: flex; gap: 22px; }
  .menu-toggle { display: none; width: 48px; height: 48px; align-items: center; justify-content: center; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
  .menu-toggle svg { width: 24px; height: 24px; }
  .brand { font-weight: 900; text-decoration: none; }
  .header-call { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; background: #111; color: #fff; text-decoration: none; }
  .page-shell { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }
  .basic-hero { min-height: 66vh; display: grid; align-content: center; padding-block: clamp(72px, 10vw, 140px); }
  .basic-hero h1 { max-width: 13ch; margin: 0; font-size: clamp(3rem, 8vw, 6rem); line-height: .96; letter-spacing: -.035em; }
  .basic-hero p { font-size: clamp(1rem, 2vw, 1.3rem); }
  .primary-action { min-height: 48px; display: inline-flex; width: fit-content; align-items: center; padding: 12px 18px; background: #111; color: #fff; font-weight: 800; text-decoration: none; }
  .service-mark { width: 100%; height: 2px; margin-top: .85rem; background: currentColor; opacity: .58; }
  .content-section { padding-block: clamp(64px, 8vw, 110px); }
  .content-section h1 { font-size: clamp(2.7rem, 7vw, 5.5rem); letter-spacing: -.035em; }
  footer { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; padding: 38px clamp(18px, 4vw, 64px); background: #111; color: #fff; }
  footer small { width: 100%; opacity: .82; }
  .chat-launcher { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: var(--z-sticky); min-width: 72px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; padding: 10px 14px; background: #fff; color: #111; box-shadow: 0 6px 8px rgba(0,0,0,.22); cursor: pointer; }
  .chat-launcher svg { width: 22px; height: 22px; }
  body[data-overlay-open] { overflow: hidden; }
  .demo-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 28px); border: 0; border-radius: 10px; padding: 0; background: #fff; color: #111; box-shadow: 0 24px 64px rgba(0,0,0,.34); }
  .demo-dialog::backdrop { background: rgba(0,0,0,.68); }
  .dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 22px 14px; }
  .dialog-head h2 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1; }
  .dialog-head button, .chat-choices button, .dialog-primary { min-height: 44px; border: 1px solid currentColor; padding: 9px 12px; background: transparent; color: inherit; cursor: pointer; }
  .dialog-primary { margin: 0 22px 22px; background: #111; color: #fff; font-weight: 800; }
  .demo-dialog form { display: grid; gap: 7px; padding: 0 22px 22px; }
  .demo-dialog input, .demo-dialog select, .demo-dialog textarea { width: 100%; min-height: 46px; border: 1px solid #555; border-radius: 4px; padding: 10px 12px; color: #111; background: #fff; }
  .demo-dialog textarea { min-height: 100px; resize: vertical; }
  [data-field-error] { min-height: 1.4em; color: #9e1733; font-weight: 700; }
  .form-success, .chat-transcript, .chat-choices, .popup-dialog > p { padding: 0 22px 22px; }
  .chat-transcript { max-height: 280px; overflow: auto; }
  .chat-message { max-width: 85%; padding: 10px 12px; background: #ececec; }
  .chat-message-visitor { margin-left: auto; background: #111; color: #fff; }
  .chat-choices { display: flex; flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; order: 3; }
  .site-header nav { position: fixed; inset: 72px 0 auto; display: none; flex-direction: column; gap: 0; padding: 16px; background: #fff; color: #111; box-shadow: 0 8px 8px rgba(0,0,0,.16); }
  .site-header nav[data-open] { display: flex; }
  .site-header nav a { min-height: 48px; display: flex; align-items: center; }
  .header-call { font-size: .85rem; }
  .basic-hero { min-height: 72vh; }
}

@media (max-width: 420px) {
  .site-header { gap: 10px; padding-inline: 12px; }
  .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-call { width: 48px; justify-content: center; padding-inline: 6px; overflow: hidden; font-size: 0; }
  .header-call::after { content: "Call"; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
