/* ===========================================================
   Ride Like The Wind — homepage styles
   Mobile-first: base rules target ~360-390px, then two
   breakpoints layer in tablet (768px) and desktop (1440px).
   =========================================================== */

:root {
  --color-plum: #4D2953;
  --color-plum-dark: #2A1528;
  --color-amber: #FFB000;
  --color-amber-dark: #E2941A;
  --color-cream: #EDEAE6;
  --color-footer-bg: rgb(237, 234, 230);
  --color-white: #FFFFFF;
  --color-text: #4D2953;
  --color-text-muted: #5C4A58;

  --font-display: 'Jost', 'Segoe UI', sans-serif;
  --font-body: 'Jost', 'Segoe UI', sans-serif;

  --content-max: 1200px;
  --pad-x: 16px;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.55;
  background: var(--color-white);
}

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 900; margin: 0 0 16px; }

a { color: inherit; }

.btn {
  display: inline-block;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--color-amber); color: var(--color-plum-dark); }
.btn--primary:hover { background: var(--color-amber-dark); }
.btn--dark {
  background: var(--color-plum-dark);
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  padding: 16px 32px;
  border-radius: 14px;
}
.btn--dark:hover { background: var(--color-plum); }
.btn--ghost { background: transparent; border-color: var(--color-white); color: var(--color-white); }
.btn--small { padding: 8px 14px; font-size: 0.85rem; }

.section-title {
  text-align: center;
  color: var(--color-plum);
  font-size: 1.92rem;
  margin-bottom: 32px;
}
.section-title--left { text-align: left; }

/* ---------- Announcement bar ---------- */
.announce-bar {
  background: var(--color-plum-dark);
  color: var(--color-white);
  padding: 12px var(--pad-x);
}
.announce-bar__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.announce-bar__logo { flex-shrink: 0; line-height: 0; }
.announce-bar__logo img { border-radius: 50%; }
.announce-bar__text { margin: 0; font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; flex: 1 1 100%; order: 3; }
.announce-bar__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background-color: var(--color-plum);
  background-image: url('../img/hero-cyclists.jpg');
  background-size: cover;
  background-position: center;
  color: var(--color-white);
  padding: 40px var(--pad-x);
  min-height: 340px;
  display: flex;
  align-items: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}
.hero__content { max-width: 640px; }
.hero__headline {
  font-size: 1.6rem;
  line-height: 1.25;
}
.hero__subhead {
  font-size: 1rem;
  color: #E6DCE4;
  max-width: 60ch;
  margin-bottom: 24px;
}
.hero__bullets {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero__bullets li {
  position: relative;
  padding-left: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-white);
}
.hero__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-amber);
}

/* ---------- How it works ---------- */
.how-it-works {
  background: #EDEAE6;
  padding: 48px var(--pad-x);
}
.steps {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}
.step {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 13px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.step__icon-wrap {
  flex: 0 0 auto;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step__icon { margin: 0; width: 72px; height: 72px; object-fit: contain; }
.step__text-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step__label { font-size: 0.75rem; color: #6C757D; line-height: 13px; margin: 0; }
.step__arrow {
  display: none; /* shown at tablet+ between steps */
  align-self: center;
  width: 16px;
  height: 24px;
  flex-shrink: 0;
  position: relative;
  color: transparent; /* hide the ›  glyph itself, the triangle is drawn below */
}
.step__arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 8px solid var(--color-plum);
}

/* ---------- Press strip ---------- */
.press {
  padding: 40px var(--pad-x);
  text-align: center;
}
.press__logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto 20px;
  gap: 24px;
}
.press__logo { height: 44px; width: auto; opacity: 0.85; }
.press__logo--roadcc { height: 28px; }
.press__logo--cyclingweekly { height: 55px; }
.press__logo--cyclingnews { height: 33px; }
.press__quote { font-style: italic; color: var(--color-plum); font-size: 1.5rem; margin: 0; }

/* ---------- Pricing ---------- */
.pricing {
  background: var(--color-amber);
  padding: 48px var(--pad-x);
  text-align: center;
}
.pricing__title {
  max-width: 1100px;
  margin: 0 auto 32px;
  font-size: 1.9rem;
  color: var(--color-plum);
  letter-spacing: -0.01em;
}
.pricing__cards {
  max-width: var(--content-max);
  margin: 0 auto 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.pricing-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 12px;
  aspect-ratio: 745 / 833;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  container-type: inline-size;
}
.pricing-card__img {
  width: 100%;
  aspect-ratio: 678 / 587;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.pricing-card__label {
  line-height: 1.25;
  padding: 16px 8px 4px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--color-amber-dark);
  margin: 0;
  font-size: clamp(0.85rem, 7cqw, 1.4rem);
  letter-spacing: -0.03em;
}
.pricing-card--highlight {
  background: var(--color-amber);
  border: 3px solid var(--color-white);
}
.pricing-card--highlight .pricing-card__label { color: var(--color-white); }

/* ---------- Why did I make this / story ---------- */
.story {
  background: var(--color-cream);
  padding: 48px var(--pad-x);
}
.story__row {
  max-width: var(--content-max);
  margin: 0 auto 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.story__row:last-child { margin-bottom: 0; }
.story__photo {
  border-radius: 50%;
  width: 220px;
  height: 220px;
  object-fit: cover;
  flex-shrink: 0;
}
.story__row--reverse { flex-direction: column; }
.story__text p { color: var(--color-text-muted); }

/* ---------- Q&A ---------- */
.qa {
  padding: 48px var(--pad-x);
  background: var(--color-white);
}
.qa__grid {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.qa-item h3 { font-size: 1.2rem; margin-bottom: 8px; }
.qa-item p { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }

/* ---------- Tutorial (kept in case section is reinstated quickly) ---------- */
.tutorial {
  background: var(--color-cream);
  padding: 48px var(--pad-x);
  text-align: center;
}
.tutorial__video {
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--color-amber);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
}
.tutorial__video video { width: 100%; height: 100%; border-radius: var(--radius); }

/* ---------- Testimonials ---------- */
.testimonials {
  padding: 48px var(--pad-x);
  text-align: center;
  background: var(--color-white);
}
.testimonials__box {
  max-width: 640px;
  margin: 0 auto;
  background: #EDEAE6;
  border-radius: 20px;
  padding: 32px 24px;
}
.testimonial-carousel {
  position: relative;
  min-height: 220px;
}
.testimonial {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  animation: testimonialFade 25s infinite;
}
.testimonial:nth-child(1) { animation-delay: 0s; }
.testimonial:nth-child(2) { animation-delay: -5s; }
.testimonial:nth-child(3) { animation-delay: -10s; }
.testimonial:nth-child(4) { animation-delay: -15s; }
.testimonial:nth-child(5) { animation-delay: -20s; }
.testimonial p {
  max-width: 640px;
  margin: 0 auto 12px;
  font-style: italic;
  color: var(--color-text-muted);
}
.testimonial cite { font-style: normal; font-weight: 600; }

@keyframes testimonialFade {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  16%  { opacity: 1; }
  20%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Auth pages (sign in / sign up) ---------- */
.auth-page {
  background: var(--color-cream);
  padding: 64px var(--pad-x);
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.auth-card h1 {
  font-size: 1.6rem;
  color: var(--color-plum);
  margin-bottom: 8px;
}
.auth-card__subtext {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-plum);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #D8D2D6;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
}
.form-group input:focus {
  outline: none;
  border-color: var(--color-plum);
}
.btn--full { width: 100%; text-align: center; margin-top: 8px; }
.auth-error {
  background: #FBEAEA;
  border: 1px solid #E3A9A9;
  color: #8A2C2C;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.auth-card__footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.auth-card__footer a { color: var(--color-plum); font-weight: 600; text-decoration: underline; }

/* ---------- Legal pages (terms / privacy / cookies) ---------- */
.legal {
  padding: 48px var(--pad-x);
  background: var(--color-white);
}
.legal__inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.legal__updated {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: -8px;
  margin-bottom: 32px;
}
.legal__inner h2 {
  font-size: 1.4rem;
  margin-top: 40px;
}
.legal__inner h2:first-of-type { margin-top: 0; }
.legal__inner p, .legal__inner li {
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.legal__inner ul { padding-left: 20px; margin-bottom: 16px; }
.legal__inner a { color: var(--color-plum); text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  background: var(--color-footer-bg);
  padding: 40px var(--pad-x) 24px;
  overflow: hidden;
}
.footer__pattern {
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  background: url('../img/footer-wheel-pattern.svg') no-repeat center / contain;
  opacity: 0.25;
  pointer-events: none;
}
.footer__top {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.footer__title { font-size: 1.32rem; margin: 0; }
.footer__social { display: flex; gap: 12px; }
.footer__social img { filter: none; }
.footer__links {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}
.footer__links a { text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer__copyright {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ===========================================================
   Tablet — 768px and up
   =========================================================== */
@media (min-width: 768px) {
  :root { --pad-x: 32px; }

  .announce-bar__inner {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    text-align: left;
  }
  .announce-bar__actions { justify-self: end; }

  .hero { padding-top: 64px; padding-bottom: 64px; min-height: 440px; }
  .hero__content { flex: 1; }
  .hero__media { flex: 1; }
  .hero__headline { font-size: 2.2rem; }

  .steps { flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: stretch; gap: 12px; }
  .step { flex: 1 1 0; min-width: 0; max-width: 190px; padding: 13px; margin: 0; container-type: inline-size; }
  .step__icon { width: clamp(36px, 55cqw, 72px); height: clamp(36px, 55cqw, 72px); }
  .step__arrow { display: block; }

  .pricing__cards { flex-direction: row; }
  .pricing-card { flex: 1; }

  .story__row { flex-direction: row; text-align: left; gap: 40px; }
  .story__row--reverse { flex-direction: row-reverse; }
  .story__photo { width: 320px; height: 320px; }

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

  .footer__top { flex-direction: row; justify-content: space-between; align-items: center; }
  .footer__links { flex-direction: row; gap: 24px; }
  .footer__copyright { text-align: left; }
  .testimonial-carousel { min-height: 110px; }
}

/* ===========================================================
   Desktop — 1440px working width (content capped at --content-max)
   =========================================================== */
@media (min-width: 1440px) {
  .hero { min-height: 500px; }
  .hero__headline { font-size: 2.6rem; }
  .qa__grid { grid-template-columns: repeat(5, 1fr); }
  .pricing__title { max-width: none; white-space: nowrap; }
  .story__photo { width: 400px; height: 400px; }
}