/* Barnard Racing Team: static site styles */

:root {
  --bg: #fafafa;
  --bg-alt: #f2f2f2;
  --bg-raceiq: #dcdcdc;
  --text: #000;
  --text-muted: #333;
  --text-on-dark: #fafafa;
  --accent: #c8102e;
  --gutter: clamp(16px, 2vw, 28px);
  --max: 1280px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.9rem);
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 2.25rem);
}

h4 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.large {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
}

.upper {
  text-transform: uppercase;
}

.center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(48px, 7vw, 96px) 0;
}

.section--alt {
  background: var(--bg-alt);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

/* Header */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  color: var(--text-on-dark);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
}

.site-header__logo img {
  width: 72px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 36px);
}

.site-nav a {
  text-decoration: none;
  font-size: 15px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: currentColor;
}

.social {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social a {
  display: inline-flex;
  border: 0;
}

.social svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: inherit;
  padding: 6px;
  cursor: pointer;
}

.nav-toggle svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    background: rgba(0, 0, 0, 0.94);
    font-size: 1.4rem;
  }

  .site-nav a {
    font-size: 1.4rem;
  }

  .site-header.is-open .site-nav {
    display: flex;
  }

  .site-header.is-open .nav-toggle {
    position: fixed;
    top: 18px;
    right: var(--gutter);
    z-index: 11;
  }
}

/* Hero */

.hero {
  position: relative;
  min-height: clamp(460px, 60vw, 900px);
  display: flex;
  align-items: center;
  color: var(--text-on-dark);
  background-color: #222;
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}

.hero > .container {
  position: relative;
  max-width: none;
  padding-top: 90px;
  padding-bottom: 40px;
}

.hero h1 {
  max-width: 22ch;
  text-transform: uppercase;
}

.hero--home h1 {
  text-transform: none;
  max-width: none;
}

.hero--right > .container {
  display: flex;
  justify-content: flex-end;
}

.hero--right .hero__text {
  width: min(100%, 520px);
}

.hero--bottom {
  align-items: flex-end;
}

.hero--bottom h1 {
  max-width: none;
}

.hero__eyebrow {
  text-transform: uppercase;
  margin-bottom: 0.25em;
}

@media (max-width: 600px) {
  /* Shorter heroes crop less of the landscape photos on narrow screens */
  .hero {
    min-height: 400px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  /* The home headline has forced line breaks, so it must fit "2nd in Shannonville" on one line */
  .hero--home h1 {
    font-size: clamp(1.5rem, 7.2vw, 2rem);
  }
}

/* Buttons */

.btn {
  display: inline-block;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 14px 44px;
  border-radius: 300px;
  border: 2px solid #000;
  background: transparent;
  color: #000;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover {
  background: #000;
  color: var(--text-on-dark);
}

.btn--solid {
  background: #000;
  color: var(--text-on-dark);
}

.btn--solid:hover {
  background: #333;
  border-color: #333;
}

.btn--light {
  background: #f0f0f0;
  border-color: #f0f0f0;
  color: #000;
  padding: 10px 18px;
  font-size: 12px;
}

.btn--light:hover {
  background: #fff;
  color: #000;
}

.btn--normal-case {
  text-transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Home */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}

.news-grid .instagram-media {
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 380px));
  justify-content: center;
  gap: clamp(32px, 8vw, 120px);
  margin-top: 64px;
  text-align: center;
}

.feature-cards img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-bottom: 16px;
}

.feature-cards .contain img {
  object-fit: contain;
}

.feature-cards p {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 16px;
}

.feature-cards .btn {
  padding: 8px 18px;
  font-size: 12px;
}

@media (max-width: 860px) {
  .news-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .feature-cards {
    grid-template-columns: minmax(0, 380px);
  }
}

/* Bike */

.carousel {
  position: relative;
}

.carousel__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 var(--gutter);
  scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track img {
  flex: 0 0 auto;
  width: clamp(240px, 30vw, 440px);
  min-width: 0;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  scroll-snap-align: center;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.carousel__btn--prev {
  left: calc(var(--gutter) + 12px);
}

.carousel__btn--next {
  right: calc(var(--gutter) + 12px);
}

.specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
  font-size: 14px;
}

.specs h4 {
  font-size: 1rem;
  margin: 0 0 1.2em;
}

.specs p + h4 {
  margin-top: 2em;
}

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

/* Team */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px clamp(24px, 9vw, 130px);
}

.team-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin-bottom: 18px;
}

.team-card h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  text-transform: uppercase;
  margin-bottom: 0.4em;
}

.team-card p {
  text-transform: uppercase;
  font-size: 0.95rem;
  font-weight: 400;
}

@media (max-width: 860px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
  }
}

@media (max-width: 520px) {
  .team-grid {
    gap: 32px 16px;
  }

  .team-card img {
    margin-bottom: 10px;
  }

  .team-card h3 {
    font-size: 1.05rem;
  }

  .team-card p {
    font-size: 0.75rem;
  }
}

@media (max-width: 340px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

/* Partners */

.partner-group {
  margin-bottom: 72px;
  text-align: center;
}

.partner-group:last-child {
  margin-bottom: 0;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  align-items: center;
  margin-top: 32px;
}

/* Flex rather than grid so a partly filled last row stays centred */
.logo-grid--centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.logo-grid--centered a {
  width: 240px;
}

.logo-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  padding: 12px;
}

.logo-grid img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

@media (max-width: 860px) {
  .logo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
  }

  .logo-grid--centered a {
    width: 150px;
  }

  .partner-group {
    margin-bottom: 48px;
  }
}

/* Results */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.stats strong {
  display: block;
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  font-weight: 500;
  line-height: 1.2;
}

.stats span {
  font-size: 14px;
  font-weight: 400;
}

.championships {
  max-width: 440px;
  margin: 56px auto 0;
}

.championships h3 {
  text-align: center;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 1.2em;
}

.championships p {
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 1.1em;
}

.results-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  margin-top: 56px;
}

.results-links .logo {
  display: block;
  width: min(100%, 520px);
}

.results-links .logo-sm {
  width: min(100%, 480px);
}

.results-links .logo img {
  width: 100%;
}

.results-links .btn {
  text-transform: none;
  padding: 14px 76px;
}

/* Calendar */

.calendar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 56px;
}

.calendar-head .btn {
  text-transform: none;
  padding: 14px 64px;
}

.schedule {
  width: 100%;
  max-width: 810px;
  margin: 0 auto 32px;
}

.soar {
  text-align: center;
}

.soar img {
  width: min(100%, 500px);
  margin: 0 auto 4px;
}

.soar h4 {
  font-size: 1rem;
  font-weight: 400;
}

.soar .note {
  font-weight: 600;
  font-size: 1.2rem;
  margin: 2.2em 0 3em;
}

/* RaceIQ */

.page-raceiq {
  background: var(--bg-raceiq);
}

.page-raceiq .site-footer {
  background: var(--bg);
}

.raceiq {
  padding-top: 160px;
}

.raceiq__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px;
}

.raceiq__intro {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.6em;
}

.raceiq h4 {
  margin: 2.2em 0 0.6em;
}

.raceiq ul {
  margin: 0;
  padding-left: 40px;
}

.raceiq li {
  margin-bottom: 0.5em;
}

.raceiq__collage {
  position: relative;
  min-height: 820px;
}

.raceiq__collage img {
  position: absolute;
}

.raceiq__collage .img-pot {
  right: 6%;
  top: 30%;
  width: 72%;
  aspect-ratio: 512 / 560;
  object-fit: cover;
}

.raceiq__collage .img-hardware {
  right: 0;
  top: 0;
  width: 70%;
}

.raceiq__collage .img-app {
  left: 0;
  top: 15%;
  width: 46%;
}

.raceiq__tagline {
  text-align: center;
  font-weight: 500;
  font-size: 1.25rem;
  margin: 80px 0 0;
  padding-bottom: 96px;
}

@media (max-width: 960px) {
  .raceiq {
    padding-top: 110px;
  }

  .raceiq__layout {
    grid-template-columns: 1fr;
  }

  .raceiq__collage {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .raceiq__collage img {
    position: static;
    width: 100% !important;
    aspect-ratio: auto;
  }

  /* Hardware photo full width, then app screenshot and fork photo side by side */
  .raceiq__collage .img-hardware {
    grid-column: 1 / -1;
    order: -1;
  }

  .raceiq__collage .img-pot {
    order: 1;
    height: 100%;
    object-fit: cover;
  }

  .raceiq__tagline {
    margin-top: 56px;
    padding-bottom: 64px;
  }
}

/* Footer */

.site-footer {
  padding: 56px 0 40px;
  font-size: 14px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.site-footer h4 {
  font-size: 1.1rem;
  margin-bottom: 0.8em;
}

.site-footer p {
  margin: 0;
  line-height: 1.8;
}

.site-footer .social svg {
  width: 20px;
  height: 20px;
}

/* Not found */

.not-found {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #111;
  color: var(--text-on-dark);
}

.not-found .btn {
  border-color: var(--text-on-dark);
  color: var(--text-on-dark);
}
