/* ============================================================
   Fitaino: the site wears the app's clothes. Apple Health surfaces
   (grouped grey page, white cards; black and #1C1C1E in dark mode),
   the system font (SF Pro on Apple devices), brand blue only on
   actions and the streak orange only on the flame.
   ============================================================ */

:root {
  font-size: 62.5%;
  color-scheme: light dark;

  /* Surfaces: iOS systemGroupedBackground / secondarySystemGroupedBackground */
  --bg: #f2f2f7;
  --card: #ffffff;
  --raised: #e9e9ee;
  --hairline: rgba(60, 60, 67, 0.14);
  --hairline-strong: rgba(60, 60, 67, 0.24);

  /* Text: three roles, each at least 4.5:1 on --bg and --card */
  --text: #000000;
  --text-2: #55555a;
  --text-3: #6e6e73;

  /* Brand blue #0075FF is the app's accent. Filled buttons use a deeper step so
     white 17 px text clears 4.5:1; ink on light surfaces uses the same step. */
  --brand: #0075ff;
  --action: #0066e0;
  --action-hover: #005ac7;
  --action-ink: #ffffff;
  --link: #0066e0;

  /* The streak flame, #FF9900 like the app; never used as text on light surfaces */
  --streak: #ff9900;

  /* The app's Health-style header tint: brand blue fading into the page */
  --sky: rgba(0, 117, 255, 0.09);

  --shadow-shot: 0 24px 48px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shot-dim: none;

  --nav-bg: rgba(242, 242, 247, 0.72);

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Figures in SF Pro Rounded like the app's values, where the browser offers it */
  --font-rounded: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --radius-card: 2.6rem;
  --radius-control: 1.2rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --raised: #2c2c2e;
    --hairline: rgba(235, 235, 245, 0.12);
    --hairline-strong: rgba(235, 235, 245, 0.22);

    --text: #ffffff;
    --text-2: #c7c7cc;
    --text-3: #98989e;

    --action: #0066e0;
    --action-hover: #0075ff;
    --link: #4da3ff;

    --sky: rgba(0, 117, 255, 0.16);

    /* Depth from hairlines on black; light screenshots are dimmed a little so
       they do not glow against the dark page. */
    --shadow-shot: none;
    --shot-dim: brightness(0.9);

    --nav-bg: rgba(0, 0, 0, 0.64);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7.2rem;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.7rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(0, 117, 255, 0.24);
}

/* ---------- Type ---------- */

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(4rem, 5.4vw, 6.4rem);
  line-height: 1.06;
  letter-spacing: -0.005em;
}

h2 {
  font-size: clamp(3.2rem, 3.8vw, 4.8rem);
  line-height: 1.1;
  letter-spacing: -0.003em;
}

h3 {
  font-size: 2.2rem;
  line-height: 1.27;
}

h4 {
  font-size: 1.7rem;
  line-height: 1.3;
}

p {
  margin: 0;
  color: var(--text-2);
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-decoration: none;
}

img {
  max-width: 100%;
}

.lead {
  font-size: 2.1rem;
  line-height: 1.43;
  color: var(--text-2);
  max-width: 56rem;
}

.figure {
  font-family: var(--font-rounded);
  font-variant-numeric: tabular-nums;
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: 116rem;
  margin: 0 auto;
  padding: 0 3.2rem;
}

.section {
  padding: 12.8rem 0 0;
}

.section-head {
  display: grid;
  gap: 2rem;
  max-width: 72rem;
}

/* Plain rows split by hairlines, like an inset grouped list without the card */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rows li {
  padding: 1.6rem 0;
  border-top: 1px solid var(--hairline);
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1.4;
}

.rows li:last-child {
  border-bottom: 1px solid var(--hairline);
}

.card {
  background: var(--card);
  border-radius: var(--radius-card);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.4rem;
  padding: 0 2.2rem;
  border: none;
  border-radius: 99rem;
  font-family: inherit;
  font-size: 1.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--action);
  color: var(--action-ink);
}

.btn-primary:hover {
  background: var(--action-hover);
}

:where(a, button):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 0.8rem;
}

/* ---------- Store badges ---------- */

.store-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.store-badges a {
  display: block;
  border-radius: 0.8rem;
  transition: opacity 0.15s var(--ease);
}

.store-badges a:hover {
  opacity: 0.8;
}

.store-badges img {
  height: 4.8rem;
  width: auto;
  display: block;
}

/* ---------- App screenshots ----------
   The screen alone, no drawn hardware: the corners follow the iPhone screen
   (55 pt on a 402 x 874 pt display, so 13.7 % of the width and 6.3 % of the height). */

.shot {
  margin: 0;
  width: var(--shot-w, 28rem);
  flex: none;
  aspect-ratio: 1206 / 2622;
  border-radius: 13.7% / 6.3%;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--hairline), var(--shadow-shot);
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--shot-dim);
}

/* ---------- Load entrance: once, for the hero only ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rise {
  animation: rise 0.5s var(--ease) both;
}

.rise-2 {
  animation-delay: 0.06s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rise {
    animation: none;
  }

  .btn:active {
    transform: none;
  }
}

/* ---------- Legal pages ---------- */

.legal-page {
  max-width: 78rem;
  margin: 0 auto;
  padding: 12.8rem 3.2rem 9.6rem;
}

.legal-page-header {
  margin-bottom: 3.2rem;
}

.legal-page-header h1 {
  font-size: clamp(3.2rem, 4vw, 4rem);
}

.legal-body {
  border-top: 1px solid var(--hairline);
  padding-top: 3.2rem;
}

.legal-body h4 {
  margin: 4rem 0 1.2rem;
  font-size: 2.2rem;
}

.legal-body h5 {
  margin: 2.4rem 0 0.8rem;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
}

.legal-body h6 {
  margin: 2rem 0 0.8rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.legal-body p,
.legal-body li {
  font-size: 1.7rem;
  line-height: 1.53;
  color: var(--text-2);
}

/* ---------- Support and error page ---------- */

.support-page {
  min-height: 64vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16rem 3.2rem 9.6rem;
}

.support-card {
  max-width: 56rem;
  width: 100%;
  padding: 4rem;
  display: grid;
  gap: 1.6rem;
  justify-items: start;
}

.support-card .btn {
  margin-top: 1.6rem;
}

/* ---------- Misc ---------- */

main {
  display: block;
  min-height: 60vh;
}

#blazor-error-ui {
  display: none;
}

@media (max-width: 720px) {
  .container {
    padding: 0 2rem;
  }

  .section {
    padding-top: 8rem;
  }

  .lead {
    font-size: 1.9rem;
  }

  .legal-page,
  .support-page {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .support-card {
    padding: 2.8rem 2.4rem;
  }
}

.support-card h1 {
  font-size: clamp(3.2rem, 4vw, 4rem);
}
