/* ==========================================================================
   Flow Tribe — Base
   --------------------------------------------------------------------------
   Element-level defaults built from tokens. Everything here applies to bare
   HTML; component styling lives with its component.
   ========================================================================== */

body {
  font-family: var(--ft-font-sans);
  font-size: var(--ft-text-md);
  line-height: var(--ft-leading-normal);
  color: var(--ft-text-primary);
  background-color: var(--ft-bg-page);
}

/* ---- Headings -------------------------------------------------------------
   Satoshi, per the Design System. Tight leading and slightly negative
   tracking at large sizes — default type metrics look loose and
   unconsidered above ~24px.

   Weight follows the specified scale rather than being uniform: the two
   largest steps are Bold, and Card (22px) and Subheading (18px) are
   Medium. A 22px heading set Bold competes with the section above it. */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ft-font-display);
  font-weight: var(--ft-weight-bold);
  line-height: var(--ft-leading-tight);
  letter-spacing: var(--ft-tracking-tight);
  color: var(--ft-text-primary);
}

h1 { font-size: var(--ft-text-3xl); }
h2 { font-size: var(--ft-text-2xl); }
h3 { font-size: var(--ft-text-xl); font-weight: var(--ft-weight-medium); }
h4 { font-size: var(--ft-text-lg); font-weight: var(--ft-weight-medium); }
h5 { font-size: var(--ft-text-md); }
h6 { font-size: var(--ft-text-sm); }

@media (min-width: 768px) {
  h1 { font-size: var(--ft-text-4xl); }
  h2 { font-size: var(--ft-text-3xl); }
}

p {
  line-height: var(--ft-leading-relaxed);
}

strong { font-weight: var(--ft-weight-semibold); }
small  { font-size: var(--ft-text-sm); }

/* ---- Links ---------------------------------------------------------------- */
a {
  color: var(--ft-text-brand);
  text-decoration-color: var(--ft-burgundy-200);
  text-underline-offset: 0.2em;
  transition: color var(--ft-duration-fast) var(--ft-ease-standard);
}

a:hover {
  color: var(--ft-burgundy-800);
}

code,
kbd,
samp {
  font-family: var(--ft-font-mono);
  font-size: 0.9em;
}

hr {
  border: none;
  border-top: 1px solid var(--ft-border-subtle);
  margin: var(--ft-space-6) 0;
}

/* ---- Selection ------------------------------------------------------------ */
::selection {
  background-color: var(--ft-burgundy-100);
  color: var(--ft-burgundy-900);
}

/* ---- Scrollbars -----------------------------------------------------------
   Styled on desktop only; mobile uses the platform's own overlay scrollbars. */
@media (min-width: 768px) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--ft-neutral-300) transparent;
  }

  *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  *::-webkit-scrollbar-track {
    background: transparent;
  }

  *::-webkit-scrollbar-thumb {
    background-color: var(--ft-neutral-300);
    border: 3px solid transparent;
    border-radius: var(--ft-radius-full);
    background-clip: content-box;
  }

  *::-webkit-scrollbar-thumb:hover {
    background-color: var(--ft-neutral-400);
  }
}

/* ---- Accessibility helpers ------------------------------------------------ */

/* Visually hidden but available to screen readers. Used for form labels
   where the visual design carries the meaning some other way. */
.ft-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — visible only when focused. */
.ft-skip-link {
  position: absolute;
  top: var(--ft-space-2);
  left: var(--ft-space-2);
  z-index: var(--ft-z-toast);
  padding: var(--ft-space-3) var(--ft-space-4);
  background-color: var(--ft-bg-surface);
  border-radius: var(--ft-radius-md);
  box-shadow: var(--ft-shadow-md);
  font-weight: var(--ft-weight-semibold);
  transform: translateY(-200%);
}

.ft-skip-link:focus {
  transform: translateY(0);
}
