/*
  Site components. Every value comes from tokens.css.
  Media query breakpoints are the only literals: CSS can't read
  custom properties inside @media.

  Contents
    1. Layout
    2. Nav
    3. Buttons & chips
    4. App icons
    5. Home hero
    6. Product hero & carousel
    7. Sections, cards & grids
    8. Product, feature & info cards
    9. Testimonials & bands
   10. Page illustrations (Cashew mock, Cyclist placeholder)
   11. Legal & FAQ
   12. Footer
*/

/* ==== 1. Layout ==== */
.wrap {
  width: 100%;
  max-width: var(--size-container);
  margin: 0 auto;
  padding: 0 var(--space-gutter) calc(var(--space-section) * 3);
}

.section {
  margin-top: var(--space-section);
}

/* Keep anchored sections clear of the sticky nav when jumped to. */
[id] {
  scroll-margin-top: calc(var(--size-tab-bar) + var(--space-gutter) * 2);
}

.section--center {
  text-align: center;
}

/* ==== 2. Nav ==== */
.site-nav {
  position: sticky;
  top: var(--space-gutter);
  z-index: 10;
  margin-top: var(--space-gutter);
}

.site-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  height: var(--size-tab-bar);
  padding: 0 var(--space-xl);
  border: var(--border-hairline) solid var(--color-card-border);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-tab-top) 0%, var(--color-tab-bottom) 100%);
  box-shadow: var(--shadow-float);
}

.site-nav__logo {
  height: var(--size-logo-nav);
  max-width: none;
}

.site-nav__links {
  display: flex;
  gap: var(--space-xl);
  font-size: var(--text-nav);
  font-weight: var(--weight-medium);
}

.site-nav__links a {
  color: var(--color-text-strong);
}

.site-nav__links a:hover {
  color: var(--color-ink);
}

@media (max-width: 640px) {
  .site-nav__bar {
    padding: 0 var(--space-lg);
  }

  .site-nav__links {
    gap: var(--space-md);
    font-size: var(--text-body);
  }
}

/* ==== 3. Buttons & chips ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-xl);
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
}

/* Buttons are links, so each variant pins its color on :hover too —
   otherwise base.css's a:hover color wins. */
.btn--primary,
.btn--primary:hover {
  background: var(--color-numeral);
  color: var(--color-active-tab);
}

.btn--store,
.btn--store:hover {
  height: var(--size-button);
  padding: 0 var(--space-lg);
  border-radius: var(--radius-sm);
  background: var(--logo-body);
  color: var(--color-on-accent);
  font-size: var(--text-label);
}

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: var(--size-chip);
  padding: 0 var(--space-lg);
  border-radius: var(--radius-pill);
  background: var(--color-chip);
  color: var(--accent-teal-ink);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
}

/* ==== 4. App icons ==== */
.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-on-accent);
}

.app-icon svg {
  width: 45%;
  height: 45%;
}

.app-icon--cashew { background: var(--gradient-cashew); }
.app-icon--speedo { background: var(--gradient-speedo); }
.app-icon--cyclist { background: var(--gradient-cyclist); }

/* ==== 5. Home hero ==== */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--space-section) + var(--space-xs));
  padding: calc(var(--space-section) * 3) var(--space-xs) var(--space-xl);
}

.hero__copy {
  flex: 1 1 var(--size-col-copy);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.hero__title {
  font-size: var(--text-hero);
  line-height: var(--line-hero);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.hero__subtitle {
  max-width: var(--measure-narrow);
  font-size: var(--text-body-lg);
  line-height: var(--leading-normal);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

.hero__visual {
  flex: 1 1 var(--size-col-visual);
  height: var(--size-visual-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.hero__bar {
  width: var(--size-bar-width);
  height: var(--size-bar-height);
  border-radius: var(--radius-section);
  box-shadow: var(--shadow-float);
}

.hero__bar--raised {
  margin-top: var(--space-lg);
}

/* ==== 6. Product hero & carousel ==== */
.product-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--space-section) + var(--space-xs));
  padding: calc(var(--space-section) * 2) var(--space-xs) var(--space-xl);
}

.product-hero__copy {
  flex: 1 1 var(--size-col-copy);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.product-hero__icon {
  width: var(--size-icon-xl);
  height: var(--size-icon-xl);
  border-radius: var(--radius-stat);
}

.product-hero__title {
  max-width: 11em;
  font-size: var(--text-hero);
  line-height: var(--line-hero);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.product-hero__tagline {
  font-size: var(--text-card-title-lg);
  font-weight: var(--weight-semibold);
  color: var(--accent-teal-ink);
}

.product-hero__desc {
  max-width: var(--measure-narrow);
  font-size: var(--text-body-lg);
  line-height: var(--leading-normal);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

.product-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}

.product-carousel {
  flex: 1 1 var(--size-col-visual);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.product-carousel__viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-carousel__shot {
  width: var(--size-shot);
  height: auto;
  border-radius: var(--radius-section);
  box-shadow: var(--shadow-float);
}

.product-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--size-arrow);
  height: var(--size-arrow);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-active-tab);
  box-shadow: var(--shadow-float);
  font-size: var(--text-card-title-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.product-carousel__arrow--prev { left: calc(var(--size-arrow) / -2); }
.product-carousel__arrow--next { right: calc(var(--size-arrow) / -2); }

.product-carousel__dots {
  display: flex;
  gap: var(--space-md);
}

.product-carousel__dot {
  width: var(--size-dot);
  height: var(--size-dot);
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-chip);
}

.product-carousel__dot[aria-current="true"] {
  background: var(--color-numeral);
}

/* ==== 7. Sections, cards & grids ==== */
.section-title {
  margin-bottom: var(--space-xl);
  font-size: var(--text-section-title);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.card {
  background: linear-gradient(180deg, var(--color-card-top) 0%, var(--color-card-bottom) 100%);
  border-radius: var(--radius-section);
}

.grid-2,
.grid-3 {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 860px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ==== 8. Product, feature & info cards ==== */
.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-xl);
}

.product-card__icon {
  width: var(--size-icon-lg);
  height: var(--size-icon-lg);
  border-radius: var(--radius-chip);
}

.product-card__title {
  font-size: var(--text-card-title-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.product-card__desc {
  font-size: var(--text-caption);
  line-height: var(--leading-normal);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

.product-card__link {
  margin-top: var(--space-2xs);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  color: var(--accent-teal-ink);
}

.feature-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  border-radius: var(--radius-stat);
  background: var(--color-card-flat);
}

.feature-card__icon {
  flex-shrink: 0;
  width: var(--size-icon-sm);
  height: var(--size-icon-sm);
  color: var(--accent-teal-ink);
}

.feature-card__icon svg {
  width: 100%;
  height: 100%;
}

.feature-grid--cashew .feature-card__icon {
  color: var(--color-numeral);
}

.feature-card__title {
  margin-bottom: var(--space-xs);
  font-size: var(--text-nav);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.feature-card__desc {
  font-size: var(--text-label);
  line-height: var(--leading-tight);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-xl);
}

.info-card__tile {
  width: var(--size-icon-md);
  height: var(--size-icon-md);
  border-radius: var(--radius-chip);
  background: var(--color-chip);
}

.info-card__title {
  font-size: var(--text-nav);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.info-card__desc {
  font-size: var(--text-caption);
  line-height: var(--leading-normal);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

/* ==== 9. Testimonials & bands ==== */
.testimonial {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-xl);
  border-radius: var(--radius-section);
  background: var(--color-card-flat);
}

.testimonial__stars {
  font-size: var(--text-card-title-lg);
  letter-spacing: var(--tracking-wide);
  color: var(--accent-sand);
}

.testimonial__quote {
  font-size: var(--text-caption);
  line-height: var(--leading-normal);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

.testimonial__source {
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  color: var(--color-subtle);
}

.band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  padding: calc(var(--space-section) + var(--space-lg));
  border-radius: var(--radius-section);
  background: var(--color-card-flat);
}

.band--center {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.band__title {
  margin-bottom: var(--space-sm);
  font-size: var(--text-section-title);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.band__body {
  max-width: var(--measure-band);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
}

.band__link {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--accent-teal-ink);
}

/* ==== 10. Page illustrations ==== */

/* Cashew: dashboard mock built from markup, not a screenshot */
.cashew-mock {
  flex: 1 1 var(--size-col-visual);
  max-width: var(--measure-narrow);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-xl);
}

.cashew-mock__stats {
  display: flex;
  gap: var(--space-md);
}

.cashew-mock__stat {
  flex: 1;
  padding: var(--space-lg);
  border-radius: var(--radius-stat);
  background: var(--color-card-top);
}

.cashew-mock__label {
  margin-bottom: var(--space-2xs);
  font-size: var(--text-caption);
  color: var(--color-muted);
}

.cashew-mock__value {
  font-size: var(--text-card-title-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-numeral);
}

.cashew-mock__legend {
  display: flex;
  justify-content: space-between;
  padding-bottom: var(--space-sm);
  font-size: var(--text-caption);
  color: var(--color-muted);
}

.cashew-mock__split {
  display: flex;
  height: var(--size-split-bar);
  overflow: hidden;
  border-radius: var(--radius-pill);
}

.cashew-mock__principal {
  flex: 68;
  background: var(--color-numeral);
}

.cashew-mock__interest {
  flex: 32;
  background: var(--accent-lavender);
}

.cashew-mock__schedule {
  padding: var(--space-lg);
  border-radius: var(--radius-stat);
  background: var(--color-card-flat);
}

.cashew-mock__schedule .cashew-mock__label {
  margin-bottom: var(--space-sm);
}

.cashew-mock__row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: var(--border-hairline) solid var(--color-track);
  font-size: var(--text-caption);
  color: var(--color-muted);
}

.cashew-mock__row:last-child {
  border-bottom: none;
}

/* Cyclist: "screens coming soon" placeholder */
.cyclist-placeholder {
  flex: 1 1 var(--size-col-visual);
  height: var(--size-visual-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  color: var(--color-subtle);
}

.cyclist-placeholder svg {
  width: var(--size-glyph-lg);
  height: var(--size-glyph-lg);
}

.cyclist-placeholder__wheel--back { stroke: var(--accent-sand); }
.cyclist-placeholder__wheel--front { stroke: var(--accent-berry); }

/* ==== 11. Legal & FAQ ==== */
.legal-header {
  padding: calc(var(--space-section) * 2) var(--space-xs) var(--space-xl);
}

.legal-header__eyebrow {
  margin-bottom: var(--space-sm);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-teal-ink);
}

.legal-header__title {
  font-size: var(--text-section-title);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.legal-header__updated {
  margin-top: var(--space-sm);
  font-size: var(--text-caption);
  color: var(--color-subtle);
}

.legal {
  max-width: var(--measure-prose);
  font-size: var(--text-body);
  line-height: var(--leading-relaxed);
  color: var(--color-text-strong);
}

.legal h2 {
  margin-top: var(--space-section);
  margin-bottom: var(--space-sm);
  font-size: var(--text-card-title-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.legal h2:first-child {
  margin-top: 0;
}

.legal p,
.legal ul {
  margin: 0 0 var(--space-lg);
}

.legal ul {
  padding-left: var(--space-xl);
  list-style: disc;
}

.legal li {
  margin-bottom: var(--space-sm);
}

.faq-item {
  padding: var(--space-xl) 0;
  border-bottom: var(--border-hairline) solid var(--color-track);
}

.faq-item:first-child {
  padding-top: 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item__q {
  margin-bottom: var(--space-sm);
  font-size: var(--text-card-title-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.faq-item__a {
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--color-muted);
}

/* ==== 12. Footer ==== */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-xl);
  margin-top: calc(var(--space-section) * 3);
  padding-top: var(--space-xl);
  border-top: var(--border-hairline) solid var(--color-track);
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.site-footer__logo {
  align-self: flex-start;
  height: var(--size-logo-footer);
  max-width: none;
}

.site-footer__copyright {
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  color: var(--color-subtle);
}

.site-footer__columns {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space-section) * 1.8);
}

.site-footer__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  font-size: var(--text-caption);
}

.site-footer__heading {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-subtle);
}

.site-footer__column a {
  color: var(--color-text-strong);
}

.site-footer__pending {
  color: var(--color-subtle);
}
