/* base.css — BalanceMD */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* scroll-behavior: smooth; — removed: causes trackpad scroll issues in Chrome/Mac */
  hanging-punctuation: first last;
  scroll-padding-top: var(--space-16);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.15; }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

::selection {
  background: oklch(from var(--color-gold) l c h / 0.2);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

a, button, [role='button'], [role='link'], input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* Skip-to-content link: hidden until keyboard-focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: var(--color-gold, #bc902e);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
}

/* iOS horizontal bounce fix — only applies on touch devices (iPhone/iPad) */
@supports (-webkit-touch-callout: none) {
  html { overflow-x: clip; }
}

/* Sticky mobile CTA — keeps discovery call one tap away on long pages */
.sticky-mobile-cta {
  display: none;
}
@media (max-width: 900px) {
  .sticky-mobile-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(245, 245, 242, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--color-divider);
    z-index: 900;
  }
  .sticky-mobile-cta a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--color-gold);
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    letter-spacing: 0.01em;
  }
  main {
    padding-bottom: 80px;
  }
}
