/* Also the one owner of text-field focus (the last block of this file). One shared pressed (depress) state for every button on the site (homepage and landing pages, and every blog page through the blog kit). Loaded last, so it owns the :active look; rest and hover colors are not touched.
   Press: scale .97 (.94 for small round icon buttons), a slightly darker fill (filled buttons, about 8%) or a light tint (outline, ghost and chip buttons),
   and the shadow tightened. Quick in (80ms), smooth out (160ms). Reduced motion: no scale, color and shadow only. Disabled buttons never press.
   The tint is a flat gradient layered over the button's own background, so it works whatever the fill is. Hover rules stay under (hover: hover). */

/* ---- release (rest): the transform settles in 160ms ---- */
body:not(.no-press) :is(.btn-primary, .btn-cta, .btn-secondary, .btn-ghost, .demo-submit, .biz-comp-send, .case-more, .case-chip, .pc-toggle, .sec-link, .blog-search button, .arc-theme-toggle, .nav-mobile-toggle, .case-round, .nav-docs-link, summary.faq-question) {
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease-out, background-color .18s ease, background-image .16s ease, border-color .18s ease, color .18s ease, box-shadow .16s ease, opacity .16s ease;
}

/* ---- pressed ---- */
body:not(.no-press) :is(.btn-primary, .btn-cta, .demo-submit, .biz-comp-send):is(:active):not(:disabled):not([aria-disabled="true"]),
body:not(.no-press) .pc .pc-card .pc-btn.btn-primary:active {
  transform: scale(.97) !important; translate: none !important; scale: none !important;
  background-image: linear-gradient(rgba(0,0,0,.08), rgba(0,0,0,.08)) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.12) !important;
  transition-duration: .08s, .08s, .08s, .08s, .08s, .08s, .08s;
}
body:not(.no-press) :is(.btn-secondary, .btn-ghost, .case-more, .case-chip, .pc-toggle, .sec-link, .nav-docs-link):is(:active):not(:disabled):not([aria-disabled="true"]),
body:not(.no-press) .pc .pc-card .pc-btn.btn-secondary:active {
  transform: scale(.97) !important; translate: none !important; scale: none !important;
  background-image: linear-gradient(rgba(0,0,0,.06), rgba(0,0,0,.06)) !important;
  box-shadow: none !important;
  transition-duration: .08s, .08s, .08s, .08s, .08s, .08s, .08s;
}
body:not(.no-press) :is(.arc-theme-toggle, .nav-mobile-toggle, .case-round):is(:active):not(:disabled) {
  transform: scale(.94) !important;
  background-image: linear-gradient(rgba(0,0,0,.06), rgba(0,0,0,.06)) !important;
  transition-duration: .08s, .08s, .08s, .08s, .08s, .08s, .08s;
}
/* a FAQ row is wide, so it takes the tint only */
body:not(.no-press) summary.faq-question:active { background-image: linear-gradient(rgba(0,0,0,.04), rgba(0,0,0,.04)); }

html[data-theme="dark"] body:not(.no-press) :is(.btn-secondary, .btn-ghost, .case-more, .case-chip, .pc-toggle, .sec-link, .nav-docs-link):active,
html[data-theme="dark"] body:not(.no-press) .pc .pc-card .pc-btn.btn-secondary:active,
html[data-theme="dark"] body:not(.no-press) :is(.arc-theme-toggle, .nav-mobile-toggle, .case-round):active { background-image: linear-gradient(rgba(255,255,255,.10), rgba(255,255,255,.10)) !important; }
html[data-theme="dark"] body:not(.no-press) summary.faq-question:active { background-image: linear-gradient(rgba(255,255,255,.06), rgba(255,255,255,.06)); }

@media (prefers-reduced-motion: reduce) {
  body:not(.no-press) :is(.btn-primary, .btn-cta, .btn-secondary, .btn-ghost, .demo-submit, .biz-comp-send, .case-more, .case-chip, .pc-toggle, .sec-link, .blog-search button, .arc-theme-toggle, .nav-mobile-toggle, .case-round, .nav-docs-link):active,
  body:not(.no-press) .pc .pc-card .pc-btn:active { transform: none !important; }
}

/* ---- Text-field focus: one style for every field on the site ----
   The field's own border turns brand blue and a tight 3px soft ring hugs it (box-shadow, the field's own radius). No outline, no offset:
   an outline stacked on a ring is what made focused fields look doubled. A field that sits inside a bordered wrapper (the hero phone pill,
   the composer bar, the blog search, the calculator box) leaves its own box plain and the wrapper takes the ring. Buttons and links keep their
   own focus rings (css/landing.css, css/landing-imessage-refresh.css). */
:root { --field-focus: #3266d8; --field-ring: color-mix(in srgb, var(--field-focus) 20%, transparent); }
:root[data-theme="dark"] { --field-focus: #a8c9ff; --field-ring: color-mix(in srgb, var(--field-focus) 26%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --field-focus: #a8c9ff; --field-ring: color-mix(in srgb, var(--field-focus) 26%, transparent); } }

html body :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="submit"], [type="button"], [type="reset"], [type="file"], [type="color"], [type="hidden"]), textarea, select):is(:focus, :focus-visible):not(.demo-form *, .biz-comp *, .blog-search-field *, .be-box *, .sup-field *) {
  outline: 0; outline-offset: 0; border-color: var(--field-focus); box-shadow: 0 0 0 3px var(--field-ring);
}
/* inside a wrapper: no box of its own */
html body :is(.demo-form, .biz-comp, .blog-search-field, .be-box, .sup-field) :is(input, textarea, select):is(:focus, :focus-visible) { outline: 0; outline-offset: 0; box-shadow: none; }
html body :is(.demo-form, .biz-comp, .blog-search-field, .be-box, .sup-field):focus-within:focus-within { border-color: var(--field-focus); box-shadow: 0 0 0 3px var(--field-ring); }
/* phones: the hero's pill is the field, the form around it has no box */
@media (max-width: 480px) {
  html body .demo-card .demo-form:focus-within:focus-within { border-color: transparent; box-shadow: none; }
  html body .demo-card .demo-field:focus-within:focus-within { border-color: var(--field-focus); box-shadow: 0 0 0 3px var(--field-ring); }
}
