html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body { position: relative; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("/static/broken-clanker.jpg") no-repeat center center;
  background-size: cover;
  transform: scale(1.85);
  opacity: 0.24;
  mix-blend-mode: lighten;
  filter: contrast(1.15) brightness(0.85);
  pointer-events: none;
  z-index: 0;
}

.wrap, .container, main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1360px !important;
}

.card, .signup-box, .box, .tldr, .stat, table, .calc {
  background: rgba(22, 27, 34, 0.78) !important;
  backdrop-filter: blur(2px);
}

/* Keep 5 pricing cards cleanly in 1 row on desktop */
@media (min-width: 1120px) {
  .grid:has(> .card:nth-child(5)) {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 14px;
  }
}

/* Balanced tablet layout */
@media (max-width: 1119px) and (min-width: 641px) {
  .wrap {
    padding: 36px 20px 64px !important;
  }
  .grid:has(> .card:nth-child(5)) {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  }
}

/* Mobile optimization */
@media (max-width: 640px) {
  body::before {
    transform: scale(1.25);
    opacity: 0.18;
  }
  .wrap {
    padding: 24px 16px 56px !important;
  }
  header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 28px !important;
  }
  .brand {
    font-size: 0.95rem !important;
    line-height: 1.3;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    width: 100%;
  }
  nav a {
    margin-left: 0 !important;
    font-size: 0.88rem !important;
  }
  h1 {
    font-size: 1.65rem !important;
    line-height: 1.2 !important;
  }
  h2 {
    font-size: 1.15rem !important;
    margin-top: 36px !important;
  }
  .punchline {
    font-size: 0.94rem !important;
  }
  .signup-box {
    max-width: 100% !important;
    padding: 16px !important;
  }
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  input[type="email"],
  input[type="text"],
  input[type="password"],
  input[type="number"],
  select {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important; /* prevents iOS Safari zoom on focus */
  }
  .signup-box button,
  .cta-row .btn {
    width: 100%;
    text-align: center;
  }
  .grid,
  .calc-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  pre {
    padding: 12px !important;
    font-size: 0.76rem !important;
    max-width: 100%;
  }
  th, td {
    padding: 10px 10px !important;
    font-size: 0.78rem !important;
  }
}
