/* Bitsfall site styles */

:root{
  --blue: #1631A6;       /* crash blue: hero, links, primary buttons */
  --blue-deep: #0F2380;  /* hover */
  --ink: #0D1733;        /* text on paper */
  --muted: #4B5573;      /* secondary text */
  --paper: #F4F6FA;      /* page background */
  --rule: #D5DBE8;       /* dividers */
  --bit: #FFFFFF;        /* bits and text on blue */
  --fault: #FFC93C;      /* the one bit that fails, focus on blue */

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
}

*{ box-sizing: border-box; margin: 0; padding: 0; }
html{ scroll-behavior: smooth; }
body{
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, canvas{ display: block; max-width: 100%; }
a{ color: inherit; }

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

/* Focus */
a:focus-visible, button:focus-visible{
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.hero a:focus-visible, .hero button:focus-visible{ outline-color: var(--fault); }

/* ---------- Hero (blue) ---------- */
.hero{
  background: var(--blue);
  color: var(--bit);
  overflow: hidden;
}

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.wordmark{
  font-size: 1.4rem;
  font-weight: 850;
  font-stretch: 125%;
  letter-spacing: .01em;
  text-decoration: none;
  line-height: 1;
}
.topnav{
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topnav a{
  text-decoration: none;
  font-size: .95rem;
  padding: 8px 10px;
  border-radius: 6px;
}
.topnav a:hover{ background: rgba(255,255,255,.12); }
.topnav .yt{
  border: 1.5px solid rgba(255,255,255,.7);
  margin-left: 6px;
}

.hero-grid{
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: end;
  padding-top: clamp(12px, 3vw, 32px);
}
.hero-text{ padding-bottom: clamp(28px, 4vw, 48px); }
.hero h1{
  font-size: clamp(2.3rem, 4.4vw, 3.6rem);
  font-weight: 800;
  font-stretch: 116%;
  line-height: 1.04;
  letter-spacing: -.01em;
  max-width: 20ch;
}
.hero .lead{
  margin-top: 16px;
  max-width: 34rem;
  font-size: 1.15rem;
  line-height: 1.55;
  color: rgba(255,255,255,.88);
}
.actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-light{ background: var(--bit); color: var(--blue); }
.btn-light:hover{ background: #E6EBFF; }
.btn-outline-light{ border-color: rgba(255,255,255,.75); color: var(--bit); background: transparent; }
.btn-outline-light:hover{ background: rgba(255,255,255,.12); }
.btn-blue{ background: var(--blue); color: var(--bit); }
.btn-blue:hover{ background: var(--blue-deep); }
.btn-outline{ border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover{ background: rgba(22,49,166,.07); }

/* The collapse */
.collapse{
  position: relative;
  align-self: stretch;
  min-height: 260px;
}
.collapse canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.replay{
  position: absolute;
  right: 0;
  top: 0;
  font-family: inherit;
  font-size: .85rem;
  color: rgba(255,255,255,.8);
  background: transparent;
  border: 0;
  padding: 6px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.replay:hover{ color: var(--bit); }
.replay[hidden]{ display: none; }

/* ---------- Sections (paper) ---------- */
.section{
  padding: clamp(56px, 8vw, 96px) 0;
  scroll-margin-top: 12px;
}
.section + .section{ border-top: 1px solid var(--rule); }

.section h2{
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 750;
  font-stretch: 112%;
  line-height: 1.15;
  letter-spacing: -.005em;
}
.section h3{
  font-size: 1.05rem;
  font-weight: 700;
  font-stretch: 108%;
  margin-bottom: 6px;
}
.section p{ max-width: 38rem; }
.muted{ color: var(--muted); }

/* Two-column rows: heading left, content right */
.split{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: clamp(20px, 4vw, 64px);
}
.split .body > * + *{ margin-top: 18px; }

.lists{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
  margin-top: 36px !important;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.lists ul{ list-style: none; }
.lists li{
  position: relative;
  padding-left: 22px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}
.lists li::before{
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: 8px;
  height: 8px;
  background: var(--blue);
}

/* Latest videos */
.videos-head{ max-width: 38rem; }
.videos-head p{ margin-top: 8px; }
.video-frame{
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  margin-top: 28px;
  background: var(--ink);
  border-radius: 6px;
  overflow: hidden;
}
.video-frame iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-fallback{
  max-width: 900px;
  margin-top: 28px;
  padding: 28px;
  border: 1.5px solid var(--blue);
  border-radius: 6px;
  background: #fff;
}
.video-fallback p{ margin-top: 6px; color: var(--muted); }
.video-fallback .btn{ margin-top: 18px; }
.more{ margin-top: 18px; }

.textlink{
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.textlink:hover{ color: var(--blue-deep); }

/* Contact */
.email{
  display: inline-block;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  font-weight: 750;
  font-stretch: 112%;
  line-height: 1.15;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 3px solid currentColor;
  overflow-wrap: anywhere;
}
.email:hover{ color: var(--blue-deep); }

/* Footer */
footer{
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  font-size: .95rem;
  color: var(--muted);
}
.foot{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  align-items: center;
}
.foot nav{ display: flex; gap: 20px; }
.foot a{ text-decoration: none; }
.foot a:hover{ color: var(--blue); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .hero-grid{ grid-template-columns: 1fr; align-items: start; }
  .hero-text{ padding-bottom: 8px; }
  .collapse{ min-height: 190px; }
  .split{ grid-template-columns: 1fr; }
}
@media (max-width: 560px){
  body{ font-size: 1.0625rem; }
  .wordmark{ font-size: 1.2rem; }
  .lists{ grid-template-columns: 1fr; }
  .actions .btn{ flex: 1 1 auto; }
  .collapse{ min-height: 150px; }
}
@media (max-width: 560px){
  .topnav a:not(.yt){ display: none; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .btn{ transition: none; }
}
