/* Big Shoulders Display, self-hosted (assets/fonts/README.md) so the
   type survives no signal. Variable weight, Latin subset. */
@font-face {
  font-family: "Big Shoulders Display";
  src: url("../assets/fonts/big-shoulders-display-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Barlow, self-hosted: body text. Athletic, road-sign feel that sits
   with the condensed display face. Static files, one per weight used. */
@font-face {
  font-family: "Barlow";
  src: url("../assets/fonts/barlow-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("../assets/fonts/barlow-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("../assets/fonts/barlow-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: transparent;
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Gym-wallpaper pattern behind everything: faint line-art dumbbells,
   kettlebells and plates with tally marks and sparks in the accent. One pre-colored tile
   per theme (assets/pattern-dark.svg, pattern-light.svg), set in
   tokens.css. Cards stay solid, so nothing she reads mid-set sits on it.
   (A CSS-mask version that took its color from a token didn't render in
   Chromium, so the colors are baked into the two files instead.) */
/* Scrolls with the page (not background-attachment: fixed): fixed left
   the pattern off below the first screen, and iOS Safari ignores it. */
html {
  background-color: var(--bg);
  background-image: var(--pattern);
  background-size: 320px 320px;
  background-repeat: repeat;
  min-height: 100%;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* 16px minimum: iOS zooms the page when focusing a smaller input. */
input, textarea, select {
  font: inherit;
  font-size: max(16px, 1em);
  color: inherit;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: inherit;
}

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

/* Standout text (titles, big numbers) in the title color. A soft glow
   in dark mode only; light mode is flat. The highlighter swipe behind it
   lives in gate.css. */
.neon {
  color: var(--neon);
  text-shadow: 0 0 10px color-mix(in srgb, var(--neon) 22%, transparent);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .neon {
    text-shadow: none;
  }
}

:root[data-theme="light"] .neon {
  text-shadow: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Same escape hatch as Winging It: back to the portfolio site. Top right,
   clear of the bottom sheet and the thumb. */
#home-link {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  /* Fixed white in both themes: the icon's face is transparent, so a
     themed background turned it dark in dark mode. */
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0.85;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Only on the password screen: on workout screens the bottom-left corner
   is thumb territory, and one stray tap would leave the app. */
body[data-screen]:not([data-screen="sign-in"]) #home-link {
  display: none;
}

#home-link img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
}
