/* ==========================================================================
   TAPSTRIX Base Typography, Containers, Buttons & Accessibility
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--tsx-font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--tsx-ink);
  background-color: var(--tsx-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6,
.tsx-heading {
  font-family: var(--tsx-font-heading);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.14;
  color: inherit;
  margin-top: 0;
}

p {
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Skip link for keyboard accessibility */
.tsx-skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 2000;
  padding: 10px 18px;
  background: var(--tsx-coral);
  color: var(--tsx-white);
  font-weight: 600;
  border-radius: var(--tsx-radius-sm);
  transition: top 180ms ease;
}

.tsx-skip-link:focus {
  top: 16px;
}

/* Accessible visible focus rings */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--tsx-coral);
  outline-offset: 3px;
}

/* Layout Containers */
.tsx-container {
  width: 100%;
  max-width: var(--tsx-container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (max-width: 575.98px) {
  .tsx-container {
    padding-inline: 18px;
  }
}

/* Section Spacing Rhythm */
.tsx-section {
  padding-block: var(--tsx-section-py-desktop);
  position: relative;
}

@media (max-width: 1024px) {
  .tsx-section {
    padding-block: var(--tsx-section-py-tablet);
  }
}

@media (max-width: 767.98px) {
  .tsx-section {
    padding-block: var(--tsx-section-py-mobile);
  }
}

.tsx-section-dark {
  background-color: var(--tsx-espresso);
  color: var(--tsx-text-on-dark);
}

.tsx-section-cream {
  background-color: var(--tsx-cream);
  color: var(--tsx-ink);
}

/* Eyebrow & Section Headings */
.tsx-eyebrow {
  display: inline-block;
  font-family: var(--tsx-font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tsx-coral);
  margin-bottom: 14px;
}

.tsx-section-title {
  font-size: clamp(2rem, 3.2vw, 2.85rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 18px;
}

.tsx-section-lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--tsx-muted-brown);
  max-width: 540px;
}

.tsx-section-dark .tsx-section-lead {
  color: var(--tsx-text-muted-dark);
}

.tsx-accent {
  color: var(--tsx-coral);
}

/* Buttons */
.btn-tsx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--tsx-font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  padding: 15px 26px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--tsx-duration) var(--tsx-ease),
              box-shadow var(--tsx-duration) var(--tsx-ease),
              background-color var(--tsx-duration) var(--tsx-ease),
              border-color var(--tsx-duration) var(--tsx-ease),
              color var(--tsx-duration) var(--tsx-ease);
  white-space: nowrap;
}

.btn-tsx svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: transform var(--tsx-duration) var(--tsx-ease);
}

.btn-tsx:hover svg.tsx-arrow-icon {
  transform: translateX(3px);
}

.btn-tsx-sm {
  padding: 11px 18px;
  font-size: 0.875rem;
  border-radius: 10px;
}

.btn-tsx-primary {
  background: var(--tsx-grad-primary);
  color: var(--tsx-white);
  box-shadow: var(--tsx-shadow-coral);
}

.btn-tsx-primary:hover {
  background: var(--tsx-grad-primary-hover);
  color: var(--tsx-white);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(255, 80, 56, 0.36);
}

.btn-tsx-outline-dark {
  background: rgba(255, 255, 255, 0.04);
  color: var(--tsx-white);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-tsx-outline-dark:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--tsx-white);
  border-color: rgba(255, 255, 255, 0.44);
  transform: translateY(-2px);
}

.btn-tsx-outline-light {
  background: var(--tsx-white);
  color: var(--tsx-ink);
  border-color: var(--tsx-border);
  box-shadow: var(--tsx-shadow-xs);
}

.btn-tsx-outline-light:hover {
  border-color: var(--tsx-coral);
  color: var(--tsx-coral);
  transform: translateY(-2px);
  box-shadow: var(--tsx-shadow-sm);
}

.btn-tsx-ghost-coral {
  background: transparent;
  color: var(--tsx-coral);
  padding: 0;
  border: 0;
  font-weight: 600;
}

.btn-tsx-ghost-coral:hover {
  color: var(--tsx-deep-orange);
}

/* Mobile Button & Typography Safety */
@media (max-width: 575.98px) {
  .btn-tsx {
    padding: 13px 20px;
    font-size: 0.92rem;
    white-space: normal;
    text-align: center;
  }
  .tsx-btn-mobile-full {
    width: 100%;
  }
  .tsx-section-title {
    font-size: clamp(1.75rem, 7.2vw, 2.25rem);
    margin-bottom: 14px;
  }
  .tsx-section-lead {
    font-size: 0.96rem;
    line-height: 1.65;
  }
}

/* ==========================================================================
   Premium Scroll-Glide Reveal Choreography (GPU-Composited, Zero-CLS)
   ========================================================================== */
html.tsx-anim-ready [data-tsx-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 720ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 780ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--tsx-delay, 0ms);
  will-change: opacity, transform;
}

html.tsx-anim-ready [data-tsx-reveal="left"] {
  transform: translate3d(-32px, 0, 0);
}

html.tsx-anim-ready [data-tsx-reveal="right"] {
  transform: translate3d(32px, 0, 0);
}

html.tsx-anim-ready [data-tsx-reveal="scale"] {
  transform: translate3d(0, 20px, 0) scale(0.96);
}

html.tsx-anim-ready [data-tsx-reveal="subtle"] {
  transform: translate3d(0, 14px, 0);
}

html.tsx-anim-ready [data-tsx-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: auto;
}

/* Sticky Header Scroll Reading Progress Hairline */
.tsx-scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
  pointer-events: none;
  overflow: hidden;
}

.tsx-scroll-meter span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #FF5038 0%, #FF8A38 100%);
  box-shadow: 0 0 8px rgba(255, 80, 56, 0.55);
  will-change: transform;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html.tsx-anim-ready [data-tsx-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
