/* =========================================================================
   HOME area pages: the public home (connect.html), support, error and the
   connector consent page. Loaded from those templates' head block.
   Components come from app.css (.ui-*); this file only lays them out.
   ========================================================================= */

/* ─── Public home: hero ─────────────────────────────────────────────────── */
.home { overflow-x: clip; }
.home-hero .ui-hero__content { padding-bottom: 168px; }
.home-hero h1 { font-size: var(--fs-hero); line-height: 1.02; margin: 14px 0 18px; max-width: 12.5em; }
.home-hero .ui-lede { max-width: 33em; }
.home-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.home-risk { margin-top: 14px; font-size: 13px; line-height: 1.5; color: #9AA6AF; max-width: 46ch; }
.home-risk a { color: inherit; text-underline-offset: 3px; }

/* Product frame floating over the hero seam */
.home-float {
  position: relative; z-index: 2;
  max-width: var(--page-max);
  margin: -112px auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: stretch;
}
.home-peek { display: grid; align-content: start; gap: 10px; padding: 18px; }
.home-peek__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.home-peek__name { font-size: 20px; font-weight: 650; color: #fff; letter-spacing: -.01em; }
.home-peek .ui-chart { min-height: 56px; }
.home-peek .ui-stats { gap: var(--sp-5); margin-top: 4px; }
.home-peek .ui-stat__value { font-size: 26px; }
.home-peek .ui-coach--line { margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.home-peek .ui-coach--line .ui-coach__text { font-size: 13px; }
.home-fit { padding: 18px; display: grid; align-content: start; gap: 8px; }
.home-fit__nums { display: flex; gap: 18px; font-size: 13px; color: #AEB9C1; align-items: baseline; }
.home-fit__nums .ui-num { font-size: 22px; margin-left: 4px; }
.home-fit__nums .is-ice { color: var(--ice); }
.home-fit .ui-chart { min-height: 190px; }
.home-fit .ui-coach--line { margin-top: 0; }
.home-sample { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }

/* ─── Sections ──────────────────────────────────────────────────────────── */
.home-section { max-width: var(--page-max); margin: 0 auto; padding: var(--sp-10) var(--gutter) 0; scroll-margin-top: 24px; }
.home-section__head { display: grid; gap: 10px; margin-bottom: var(--sp-6); max-width: 720px; }
.home-section__head .ui-title { font-size: clamp(30px, 3.6vw, 44px); }
.home-section__head .ui-lede { font-size: 16.5px; }

/* How it works: numbered steps */
.home-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); counter-reset: step; }
.home-step { position: relative; padding: 24px 22px 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.home-step__n { display: block; font-family: var(--num-font); font-weight: 600; font-size: 56px; line-height: .9; color: var(--ice); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.home-step__title { margin: 14px 0 8px; font-size: var(--fs-md); font-weight: 650; color: #fff; }
.home-step p { font-size: 14.5px; line-height: 1.6; color: var(--text-3); }
.home-step::after {
  content: ""; position: absolute; top: 50px; right: -17px; width: 18px; height: 1px;
  background: linear-gradient(90deg, var(--line-2), rgba(var(--ice-rgb),.6));
}
.home-step:last-child::after { display: none; }

/* Features: three photo value props */
.home-props { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.home-prop { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.home-prop__ph { position: relative; aspect-ratio: 16 / 11; background: var(--s2); overflow: hidden; }
.home-prop__ph img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.home-prop__ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--card) 0%, rgba(14,17,20,0) 55%); }
.home-prop__tx { padding: 2px 22px 24px; }
.home-prop__n { font-family: var(--num-font); font-size: 15px; font-weight: 600; letter-spacing: .12em; color: var(--ice); }
.home-prop__title { margin: 6px 0 8px; font-size: var(--fs-lg); font-weight: 650; color: #fff; letter-spacing: -.005em; }
.home-prop p { font-size: 14.5px; line-height: 1.6; color: var(--text-3); }

/* Also in the app: compact feature list */
.home-more { margin-top: var(--sp-5); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.home-more__item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; padding: 20px 22px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.home-more__item:nth-child(-n+3) { border-top: 0; }
.home-more__item:nth-child(3n+1) { border-left: 0; }
.home-more__item .ui-icon-tile { grid-row: span 2; }
.home-more__item .ui-icon-tile svg { width: 20px; height: 20px; }
.home-more__title { font-weight: 650; color: #fff; font-size: 15px; align-self: end; }
.home-more__item p { font-size: 13.5px; line-height: 1.55; color: var(--text-3); }

/* Proof strip */
.home-proof { max-width: var(--page-max); margin: var(--sp-9) auto 0; padding: 0 var(--gutter); }
.home-proof__in { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.home-proof__item { padding: 22px 24px; border-left: 1px solid var(--line); }
.home-proof__item:first-child { border-left: 0; }
.home-proof__num { font-family: var(--num-font); font-size: 40px; font-weight: 500; line-height: 1; color: var(--bright); font-variant-numeric: tabular-nums; }
.home-proof__item span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* Closing banner */
.home-closer-wrap { max-width: var(--page-max); margin: var(--sp-8) auto 0; padding: 0 var(--gutter); }
.home-closer { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--line); min-height: 320px; padding: 48px 44px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; background: var(--s1); }
.home-closer__ph { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.home-closer::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,9,11,.94) 0%, rgba(8,9,11,.7) 45%, rgba(8,9,11,.15) 100%); }
.home-closer__text { max-width: 30em; display: grid; gap: 10px; }
.home-closer__title { font-size: clamp(26px, 3vw, 36px); font-weight: 300; letter-spacing: -.015em; line-height: 1.1; color: #fff; }
.home-closer__title b { font-weight: 750; }
.home-closer__cta { display: grid; gap: 10px; justify-items: start; }
.home-closer .home-risk { margin-top: 0; color: #AEB9C1; }

/* ─── Public home: tablet and phone ─────────────────────────────────────── */
@media (max-width: 1023.98px) {
  .home-float { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home-steps, .home-props { grid-template-columns: minmax(0, 1fr); }
  .home-step::after { display: none; }
  .home-props { gap: var(--sp-4); }
  .home-prop { flex-direction: row; }
  .home-prop__ph { flex: 0 0 38%; aspect-ratio: auto; min-height: 200px; }
  .home-prop__ph::after { background: linear-gradient(270deg, var(--card) 0%, rgba(14,17,20,0) 45%); }
  .home-prop__tx { padding: 22px; align-self: center; }
  .home-more { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home-more__item:nth-child(n) { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .home-more__item:nth-child(-n+2) { border-top: 0; }
  .home-more__item:nth-child(2n+1) { border-left: 0; }
  .home-proof__in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-proof__item:nth-child(3) { border-left: 0; }
  .home-proof__item:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 759.98px) {
  .home-hero { padding-top: 260px; }
  .home-hero .ui-hero__content { padding-bottom: var(--sp-6); }
  .home-hero h1 { font-size: 40px; margin: 12px 0 14px; }
  .home-hero .ui-lede { font-size: 16px; }
  .home-ctas { margin-top: 22px; }
  .home-ctas .ui-strava-btn { flex: 1 1 100%; justify-content: center; }
  .home-ctas .ui-btn { flex: 1 1 100%; }
  .home-float { margin-top: 0; grid-template-columns: minmax(0, 1fr); }
  .home-fit .ui-chart { min-height: 170px; }
  .home-section { padding-top: var(--sp-9); }
  .home-section__head .ui-title { font-size: 30px; }
  .home-step { padding: 20px 18px 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 16px; }
  .home-step__n { grid-row: span 2; font-size: 44px; }
  .home-step__title { margin: 2px 0 4px; }
  .home-prop { flex-direction: column; }
  .home-prop__ph { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .home-prop__ph::after { background: linear-gradient(0deg, var(--card) 0%, rgba(14,17,20,0) 55%); }
  .home-prop__tx { padding: 0 18px 20px; }
  .home-more { grid-template-columns: minmax(0, 1fr); }
  .home-more__item:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .home-more__item:first-child { border-top: 0; }
  .home-more__item { padding: 16px 18px; }
  .home-proof { margin-top: var(--sp-8); }
  .home-proof__item { padding: 16px; }
  .home-proof__num { font-size: 30px; }
  .home-closer { padding: 28px 20px; min-height: 0; }
  .home-closer::before { background: linear-gradient(0deg, rgba(8,9,11,.94) 0%, rgba(8,9,11,.75) 60%, rgba(8,9,11,.4) 100%); }
  .home-closer__cta, .home-closer__cta .ui-strava-btn { width: 100%; justify-content: center; }
}

/* ─── Support: article with FAQ expanders and a contact card ────────────── */
.support-page .ui-page-header { margin-bottom: var(--sp-5); }
.support-intro { margin-bottom: var(--sp-6); }
.ui-faq { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ui-faq__item { border-top: 1px solid var(--line); }
.ui-faq__item:first-child { border-top: 0; }
.ui-faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 16px 22px;
  font-size: 15.5px; font-weight: 600; color: #fff;
}
.ui-faq__q:hover { background: var(--s2); }
.ui-faq__q:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ice); }
.ui-faq__q svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); transition: transform var(--dur-2) var(--ease); }
.ui-faq__item[open] .ui-faq__q svg { transform: rotate(180deg); color: var(--ice); }
.ui-faq__a { padding: 0 22px 20px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
.ui-faq__a p + p, .ui-faq__a p + ul, .ui-faq__a ul + p { margin-top: .7em; }
.ui-faq__a ul { list-style: none; display: grid; gap: 8px; }
.ui-faq__a li { position: relative; padding-left: 18px; }
.ui-faq__a li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--ice); }
.ui-faq__a strong, .ui-faq__a b { color: #fff; font-weight: 600; }
.ui-faq__a code { font-family: var(--num-font); font-size: 15px; color: var(--bright); }
.support-contact { margin-top: var(--sp-5); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.support-contact .ui-h3 { margin-bottom: 4px; }
.support-note { margin-top: var(--sp-5); font-size: 12.5px; color: var(--muted); line-height: 1.55; }
@media (max-width: 759.98px) {
  .ui-faq__q { padding: 14px 18px; font-size: 15px; }
  .ui-faq__a { padding: 0 18px 18px; }
}

/* ─── Error and consent: centred single card ────────────────────────────── */
.center-page { min-height: calc(100vh - var(--topbar-h) - 160px); display: grid; place-items: center; padding: var(--sp-8) var(--gutter); }
.center-page__card { width: min(100%, 520px); }
.error-card { text-align: center; }
.error-card .ui-empty { padding: var(--sp-6) var(--sp-2) var(--sp-4); }
.error-card .ui-empty__ghost { height: 96px; }
.error-card__detail {
  width: 100%; max-width: 44ch;
  margin-top: 4px; padding: 12px 14px;
  border-radius: var(--r-sm); background: var(--s2); border: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.5; color: var(--text-2);
  text-align: left; overflow-wrap: anywhere;
}
.error-card__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; margin-top: 10px; }
.error-card .ui-empty .ui-btn { margin-top: 0; }
.error-card .ui-empty__ghost { color: var(--line-2); margin-bottom: -40px; }
.error-card .ui-icon-tile { position: relative; }

.consent-card { padding: 28px; }
.consent-card__marks { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--muted); }
.consent-card__marks .ui-icon-tile { flex-basis: 44px; width: 44px; height: 44px; }
.consent-card__marks .ui-icon-tile svg { width: 22px; height: 22px; }
.consent-card .ui-title { font-size: 28px; overflow-wrap: anywhere; }
.consent-card__lede { margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.consent-card__list { list-style: none; display: grid; gap: 12px; margin: 20px 0; padding: 18px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.consent-card__list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.consent-card__list svg { width: 18px; height: 18px; margin-top: 2px; color: var(--green); }
.consent-card__fine { font-size: 13px; line-height: 1.55; color: var(--muted); }
.consent-card__fine b { color: var(--text-2); font-weight: 600; }
.consent-card__actions { display: flex; gap: 10px; margin-top: 22px; }
.consent-card__actions .ui-btn { flex: 1 1 0; }
@media (max-width: 759.98px) {
  .center-page { padding: var(--sp-6) var(--gutter); place-items: start center; min-height: 0; }
  .consent-card { padding: 22px 18px; }
  .consent-card .ui-title { font-size: 24px; }
}
.support-contact__actions { margin-top: 14px; }
