/*
  MYD browser compatibility layer
  Supports current Safari, Chrome, Edge and Firefox on desktop, tablet and phone.
  Loaded after styles.css so the rules below safely normalize engine differences.
*/

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  /* Global overflow clipping can disable sticky positioning in Safari. */
  max-width: none;
  overflow-x: visible;
}

.container {
  width: calc(100% - 48px);
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.site-header,
.faq-heading {
  position: -webkit-sticky;
  position: sticky;
}

.site-header {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: #ffffff;
  }
}

button,
.button,
input,
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
}

/* Keep native selection behavior and a visible arrow in Safari/iOS. */
select {
  -webkit-appearance: menulist;
  appearance: auto;
  background-color: #ffffff;
}

input[type="radio"],
input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: auto;
  min-height: 0;
}

button,
a,
summary,
label {
  -webkit-tap-highlight-color: rgba(46, 120, 183, 0.14);
  touch-action: manipulation;
}

img,
svg {
  max-width: 100%;
}

.relationship-target {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 620 / 560;
}

.scope-note,
.center-pill {
  display: table;
  width: auto;
  margin-left: auto;
  margin-right: auto;
}

.t-ring-one {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.t-ring-two {
  top: 62px;
  right: 62px;
  bottom: 62px;
  left: 62px;
}

p,
li,
h1,
h2,
h3,
a,
.metric-value,
.case-label,
.contact-email {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Safari can retain the native disclosure marker unless both forms are reset. */
.faq-list summary {
  display: block;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

/* Explicit bar classes avoid nth-of-type conflicts with the screen-reader label. */
.nav-toggle .nav-bar {
  display: block;
}

@media (max-width: 1080px) {
  .container {
    width: calc(100% - 48px);
  }
}

@media (max-width: 900px) {
  .container {
    width: calc(100% - 34px);
  }

  .site-nav {
    z-index: 1001;
  }

  .site-nav.is-open {
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-toggle[aria-expanded="true"] .nav-bar-one {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-bar-two {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-bar-three {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .container {
    width: calc(100% - 48px);
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 26px);
  }

  .button {
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-nav {
    padding-bottom: 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .t-ring-two {
    top: 42px;
    right: 42px;
    bottom: 42px;
    left: 42px;
  }
}

/* Conservative fallbacks for older engines without min()/clamp(). */
@supports not (width: min(100%, 1000px)) {
  .brand {
    width: auto;
    max-width: 58%;
  }

  @media (max-width: 900px) {
    .hero-visual {
      width: 100%;
      max-width: 560px;
    }
  }
}

@supports not (font-size: clamp(1rem, 2vw, 2rem)) {
  h1 { font-size: 5rem; }
  h2 { font-size: 3.3rem; }
  .utility-card h1 { font-size: 4rem; }

  @media (max-width: 900px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 2.8rem; }
  }

  @media (max-width: 640px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
  }
}
