/* STO Global Foundation — Phase 1 canonical token sync. */

html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-width: 20rem; /* 320px mandatory QA floor */
  color: var(--sto-carbon);
  background: var(--sto-soft-white);
  font-family: var(--sto-font-primary);
  font-size: var(--sto-type-body);
  font-weight: var(--sto-weight-body);
  line-height: var(--sto-leading-body);
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin-block-start: 0; }

h1 {
  font-size: var(--sto-type-h1);
  font-weight: var(--sto-weight-h1);
  line-height: var(--sto-leading-display);
  text-wrap: balance;
}

h2 {
  font-size: var(--sto-type-h2);
  font-weight: var(--sto-weight-h2);
  line-height: var(--sto-leading-heading);
  text-wrap: balance;
}

h3 {
  font-size: var(--sto-type-h3);
  font-weight: var(--sto-weight-h3);
  line-height: var(--sto-leading-heading);
}

.sto-lead {
  font-size: var(--sto-type-lead);
  font-weight: var(--sto-weight-lead);
}

.sto-tech-label,
.sto-tech-value {
  font-family: var(--sto-font-mono);
  font-size: var(--sto-type-tech);
  font-weight: var(--sto-weight-tech);
}

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

/* Canonical content wrapper. */
.sto-container {
  width: min(var(--sto-container), calc(100% - (2 * var(--sto-page-gutter))));
  margin-inline: auto;
}

.sto-section { padding-block: var(--sto-section-space); }

/* Accessible focus is non-negotiable. */
:where(a, button, [role="button"], summary):focus-visible {
  outline: 3px solid var(--sto-signal);
  outline-offset: 3px;
}

/* CTA contract */
.sto-cta {
  min-height: var(--sto-button-h);
  min-width: var(--sto-touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--sto-button-radius);
  font-family: var(--sto-font-primary);
  font-size: var(--sto-type-button);
  font-weight: var(--sto-weight-button);
  text-decoration: none;
  cursor: pointer;
}

.sto-cta--compact { min-height: var(--sto-button-h-compact); }

.sto-cta--primary {
  padding-inline: var(--sto-button-pad-primary);
  color: var(--sto-carbon);
  background: var(--sto-signal);
}

.sto-cta--primary:hover { background: var(--sto-signal-hover); }

.sto-cta--secondary {
  padding-inline: var(--sto-button-pad-secondary);
  color: var(--sto-soft-white);
  background: var(--sto-graphite);
}

.sto-link {
  color: inherit;
  text-underline-offset: .18em;
}

/* Header geometry. Desktop and mobile are separate approved variants/templates. */
.sto-header {
  min-height: var(--sto-header-h);
  display: flex;
  align-items: center;
}

.sto-header.is-compact { min-height: var(--sto-header-h-sticky); }

.sto-mobile-header {
  min-height: var(--sto-header-mobile-h);
  display: flex;
  align-items: center;
}

/* Bottom mobile conversion layer: exactly Call + WhatsApp. Visibility switch is
 * chosen at the observed content-fit threshold in Bricks and is NOT a global token. */
.sto-mobile-sticky {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 2.7fr) minmax(0, 1fr);
  background: var(--sto-graphite);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sto-mobile-sticky > * { min-height: var(--sto-button-h-compact); }

.sto-sticky-safe-end {
  padding-bottom: calc(var(--sto-sticky-safe-extra) + env(safe-area-inset-bottom, 0px));
}

/* Practical info = data, not marketing cards. Intrinsic grid removes viewport breakpoint dependency. */
.sto-practical-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  border-block: 1px solid var(--sto-line-light);
}

.sto-practical-info__item {
  min-width: 0;
  border-inline-end: 1px solid var(--sto-line-light);
}

.sto-practical-info__item:last-child { border-inline-end: 0; }

/* FAQ: use native <details>/<summary> when not using Bricks Accordion. */
.sto-faq details { border-block-end: 1px solid var(--sto-line-light); }

.sto-faq summary {
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Footer geometry uses the approved mobile/desktop endpoints fluidly. */
.sto-footer {
  padding-block-start: clamp(var(--sto-footer-pad-top-mobile), 6.25vw, var(--sto-footer-pad-top));
  padding-block-end: clamp(var(--sto-footer-pad-bottom-mobile), 2.5vw, var(--sto-footer-pad-bottom));
}

.sto-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--sto-footer-group-gap);
}

/* Reduced motion: critical content never depends on animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
