:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --type-h1: clamp(3.25rem, 8.5vw, 7.5rem);
  --type-h2: clamp(2.4rem, 5.5vw, 4.75rem);
  --type-h3: clamp(1.75rem, 3.4vw, 3rem);
  --type-h4: clamp(1.2rem, 2vw, 1.5rem);
  --type-body: clamp(1rem, 0.96rem + 0.16vw, 1.08rem);
  --type-small: 0.875rem;
  --leading-heading: 0.98;
  --leading-body: 1.7;
  --tracking-heading: -0.035em;
  --tracking-luxe: 0.16em;
}

html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: var(--type-body);
  /* Preserve the effective Tailwind CDN baseline for unclassified wrappers. */
  line-height: 1.5;
}

.ds-eyebrow {
  color: var(--color-brass);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: var(--tracking-luxe);
  text-transform: uppercase;
}

.ds-heading-1 {
  font-family: var(--font-display);
  font-size: var(--type-h1);
  line-height: var(--leading-heading);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
}

.ds-heading-2 {
  font-family: var(--font-display);
  font-size: var(--type-h2);
  line-height: var(--leading-heading);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
}

.ds-heading-3 {
  font-family: var(--font-display);
  font-size: var(--type-h3);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.ds-body {
  font-size: var(--type-body);
  line-height: var(--leading-body);
}

:where(h1, h2, h3, .font-display) {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: var(--tracking-heading);
}

:where(h4) {
  font-size: var(--type-h4);
  line-height: 1.2;
}

:where(p, li) {
  line-height: var(--leading-body);
}

:where(h1, h2, h3, h4, p, a, button, label, summary, figcaption, [data-i18n]) {
  overflow-wrap: anywhere;
}

:where(h1, h2, h3, .font-display) {
  text-wrap: balance;
}

:where(p, li, [data-i18n]) {
  text-wrap: pretty;
}

:where(a, button, input, select, textarea) {
  max-width: 100%;
}

html[lang="zh-TW"] :where(.font-display, .ds-heading-1, .ds-heading-2, .ds-heading-3),
html[lang="ar"] :where(.font-display, .ds-heading-1, .ds-heading-2, .ds-heading-3) {
  font-family: var(--font-sans);
  letter-spacing: -0.015em;
}

html[lang="zh-TW"] :where(h1, h2, h3, .font-display),
html[lang="ar"] :where(h1, h2, h3, .font-display) {
  line-height: 1.12;
}

@media (min-width: 641px) {
  :where(h1, .ds-heading-1) {
    line-height: 1.02;
  }

  :where(h2, .ds-heading-2) {
    line-height: 1.04;
  }

  :where(h3, .ds-heading-3) {
    line-height: 1.08;
  }
}

@media (max-width: 640px) {
  :where(h1, h2, h3, h4, .font-display) {
    text-align: inherit;
    text-wrap: balance;
  }

  :where(p, li, summary) {
    font-size: clamp(0.95rem, 3.7vw, 1.06rem);
    line-height: 1.68;
  }

  :where(.text-xs, .text-sm) {
    line-height: 1.45;
  }

  :where([class*="uppercase"], .ds-eyebrow) {
    letter-spacing: 0.08em;
  }

  :where(a[class*="rounded"], button[class*="rounded"], .btn, .btn-primary, .btn-secondary, .btn-ghost) {
    line-height: 1.25;
  }

  #mobile-menu a {
    font-size: clamp(1.85rem, 8vw, 2.7rem) !important;
    line-height: 1.08 !important;
    padding-block: clamp(0.75rem, 3.5vw, 1rem) !important;
    text-align: center;
  }

  #mobile-menu select,
  footer select {
    font-size: 1rem;
  }
}
