/*
 * Shared styles for every page of connect.tlay.io.
 *
 * The page markup keeps the approved design's inline styles, so the desktop
 * look lives in the HTML. This file only adds what the design canvas could
 * not express: base resets, the small-screen layout, and form states.
 * Overrides of inline styles need !important.
 */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { max-width: 100%; }
/* Anchor targets should not hide under the top edge. */
[id] { scroll-margin-top: 16px; }

:focus-visible { outline: 2px solid #8EA2FF; outline-offset: 2px; }

/* App store buttons with no store URL yet. */
.app-dl[aria-disabled="true"] { cursor: default; }

/* ---------- forms (see /assets/site.js) ---------- */
.form-status { grid-column: 1 / -1; margin: 0; font-size: 14px; line-height: 1.5; }
.form-status a { color: inherit; font-weight: 600; }
.js-mailto[data-kind="waitlist"] .form-status { flex: 1 1 100%; color: #C5CCDD; }
.js-mailto[data-kind="apply"] .form-status { color: #5B6478; }

/* ---------- tablet and down ---------- */
@media (max-width: 900px) {
  .sec { padding-top: 88px !important; padding-bottom: 88px !important; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  /* Header: logo + actions on one row, nav as a swipeable row underneath. */
  .site-header { padding-top: 16px !important; padding-bottom: 12px !important; row-gap: 12px !important; }
  .site-header > a:first-child { order: 1; }
  .site-header > div { order: 2; }
  .site-nav {
    order: 3; flex: 1 1 100%; flex-wrap: nowrap !important;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    white-space: nowrap; margin: 0 -24px; padding-left: 24px; padding-right: 24px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav > a { flex: none; }
  /* Docs-style pill nav keeps its pill, so it cannot bleed to the edges. */
  .site-nav[style*="border-radius: 999px"] { margin: 0; padding: 4px !important; justify-content: space-between; }
  .site-nav[style*="border-radius: 999px"] > a { padding: 8px 12px !important; }
  /* Home nav: plain links, tighter spacing. */
  .site-nav:not([style*="border-radius: 999px"]) { gap: 22px !important; font-size: 14px !important; }

  .sec { padding-top: 72px !important; padding-bottom: 72px !important; }

  /* Type scale: the design's display sizes are tuned for 1440px. */
  h1[style*="font-size: 68px"] { font-size: 44px !important; }
  h1[style*="font-size: 56px"] { font-size: 40px !important; }
  h2[style*="font-size: 48px"], h2[style*="font-size: 46px"] { font-size: 34px !important; }
  h2[style*="font-size: 40px"] { font-size: 30px !important; }
  h2[style*="font-size: 32px"] { font-size: 26px !important; }
  h2[style*="font-size: 28px"] { font-size: 24px !important; }

  /* Hero visual: drop the payment card below the usage card so they do not overlap. */
  .hero-card-pay { top: 47% !important; }

  /* Big white form card: less padding so fields get the width. */
  .js-mailto[data-kind="apply"] { padding: 24px 20px !important; border-radius: 22px !important; }

  /* Docs / guide: table of contents as a compact two-column block, slimmer cards. */
  .doc-layout { padding-top: 28px !important; padding-bottom: 72px !important; gap: 28px !important; }
  .toc { flex: 1 1 100% !important; display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 4px; }
  .toc > span { grid-column: 1 / -1; }
  .toc > a { padding: 6px 8px !important; font-size: 13.5px; line-height: 1.4; }
  .doc-layout main { gap: 28px !important; }
  .doc-layout main > section { padding: 24px 18px !important; border-radius: 20px !important; }
  .doc-layout pre { padding: 14px 16px !important; font-size: 12px !important; }

  /* Wide tables scroll inside their own box instead of squeezing every column. */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .doc-layout th, .doc-layout td { min-width: 104px; }
  .doc-layout td:first-child, .doc-layout th:first-child { min-width: 88px; }
}

@media (max-width: 420px) {
  .site-nav[style*="border-radius: 999px"] { font-size: 14px !important; }
  .site-nav[style*="border-radius: 999px"] > a { padding: 7px 10px !important; }
}

@media (max-width: 380px) {
  h1[style*="font-size: 68px"] { font-size: 40px !important; }
  .site-header > div a { padding-left: 12px !important; padding-right: 12px !important; }
}
