/* Cheqqa marketing — mobile / safe-area / fold-friendly (used with marketing_home + marketing_plans) */

html {
  scroll-padding-top: max(72px, calc(env(safe-area-inset-top, 0px) + 52px));
}

.hero-pills {
  touch-action: pan-x;
}

/* —— Marketing home: hero —— */
@media (max-width: 960px) {
  .hero-wrap {
    align-items: flex-start;
    min-height: 0;
    padding-top: max(5.5rem, calc(env(safe-area-inset-top, 0px) + 4rem));
    padding-bottom: 2.5rem;
  }

  .hero {
    gap: 1.25rem;
  }

  .hero-card {
    border-radius: 20px;
    padding: 14px 14px 16px;
    max-width: 100%;
  }

  .beam-canvas {
    opacity: 0.44;
  }

  .orb-1 {
    width: min(88vw, 380px);
    height: min(88vw, 380px);
  }

  .orb-2 {
    width: min(72vw, 300px);
    height: min(72vw, 300px);
  }

  .orb-3 {
    width: min(60vw, 200px);
    height: min(60vw, 200px);
  }

  .window-title {
    font-size: 0.625rem;
    max-width: min(12rem, 46vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preview-body {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .hero-card .mini-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }

  .hero-card .mini-nav button {
    width: auto;
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: center;
    padding: 10px 8px;
    font-size: 0.6875rem;
  }

  .alert-row {
    grid-template-columns: 32px 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    align-items: start;
  }

  .alert-row .ico {
    width: 32px;
    height: 32px;
    font-size: 0.625rem;
    grid-row: 1 / span 2;
  }

  .alert-row > div:nth-child(2) {
    min-width: 0;
  }

  .alert-row .badge {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    margin-top: 0;
  }
}

.nav-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.nav-menu-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s;
}

.nav-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-menu-btn:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 3px;
}

.nav-menu-btn-lines {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.nav-mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s;
}

.nav-mobile-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  width: min(20rem, calc(100vw - env(safe-area-inset-left, 0px)));
  max-width: 100%;
  background: #0e1016;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: max(4.25rem, calc(env(safe-area-inset-top, 0px) + 3rem));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  padding-left: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.3s;
}

.nav-mobile-drawer.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  transition-delay: 0s;
}

.nav-mobile-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile-drawer-inner > a:not(.btn) {
  display: block;
  padding: 14px 12px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #f4f6fb;
  -webkit-tap-highlight-color: transparent;
}

.nav-mobile-drawer-inner > a:not(.btn):hover,
.nav-mobile-drawer-inner > a:not(.btn):focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.nav-mobile-drawer-inner > a[aria-current="page"] {
  color: #5eead4;
  background: rgba(94, 234, 212, 0.1);
}

.nav-mobile-drawer-actions {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-mobile-drawer .btn-block {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

@media (max-width: 820px) {
  .nav-menu-btn {
    display: inline-flex;
  }

  .nav-links > a:not(.btn) {
    display: none !important;
  }

  .nav-inner {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    gap: 12px;
  }

  .nav-mobile-drawer-actions {
    display: flex;
  }
}

@media (max-width: 400px) {
  .nav-links .btn {
    display: none !important;
  }

  .brand img.logo-img {
    max-width: min(200px, 48vw);
    height: 36px;
    max-height: 40px;
  }
}

@media (max-width: 480px) {
  .hero-wrap {
    padding-top: max(5.5rem, calc(env(safe-area-inset-top, 0px) + 4.5rem));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: 3.5rem;
  }

  section {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .cta {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  footer {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(3rem, env(safe-area-inset-bottom, 0px));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-wrap h1 {
    font-size: clamp(1.45rem, 8.5vw, 2.75rem);
    line-height: 1.14;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  h2 {
    font-size: clamp(1.35rem, 6vw, 2.25rem);
  }

  .lead {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 28px;
  }

  .hero-actions .btn {
    width: 100%;
    flex: none;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .hero-wrap .hero-tagline {
    font-size: clamp(0.8125rem, 3.5vw, 0.98rem);
    line-height: 1.38;
    margin-bottom: 12px;
    max-width: 100%;
    letter-spacing: -0.015em;
  }

  .hero-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 12px;
    overflow-x: visible;
    width: 100%;
    align-items: stretch;
  }

  .hero-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    gap: 4px;
    padding: 5px 4px 6px;
    font-size: clamp(0.44rem, 1.95vw, 0.5625rem);
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    box-sizing: border-box;
  }

  .hero-pill-dot {
    width: clamp(3.75px, 1.2vw, 5px);
    height: clamp(3.75px, 1.2vw, 5px);
    flex-shrink: 0;
  }

  .hero-pill-dot.d1 {
    box-shadow: 0 0 0 clamp(1.5px, 0.52vw, 2px) rgba(94, 234, 212, 0.14);
  }

  .hero-pill-dot.d2 {
    box-shadow: 0 0 0 clamp(1.5px, 0.52vw, 2px) rgba(167, 139, 250, 0.12);
  }

  .hero-pill-dot.d3 {
    box-shadow: 0 0 0 clamp(1.5px, 0.52vw, 2px) rgba(251, 191, 36, 0.14);
  }
}

@media (max-width: 360px) {
  .hero-wrap .hero-tagline {
    font-size: clamp(0.78rem, 3.8vw, 0.9rem);
  }

  .hero-pill {
    padding: 5px 3px 5px;
    font-size: clamp(0.39rem, 2.1vw, 0.51rem);
  }
}

@media (max-width: 320px) {
  .hero-wrap h1,
  .plans-page h1 {
    font-size: 1.32rem;
    letter-spacing: -0.028em;
  }

  .nav-inner {
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
}

@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }

  .mini-nav button {
    min-height: 40px;
    padding: 10px 14px;
  }
}

/* Plans page — reflow comparison on narrow viewports (no horizontal scroll) */
@media (max-width: 700px) {
  .plans-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
    border-radius: 0;
  }

  .plans-table {
    min-width: 0;
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: separate;
    border-spacing: 0;
  }

  .plans-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .plans-table tbody {
    display: block;
    width: 100%;
  }

  .plans-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 14px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: #141822;
  }

  .plans-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .plans-table tbody th {
    display: block;
    grid-column: 1 / span 3;
    grid-row: 1;
    width: 100%;
    padding: 0 0 10px;
    margin: 0 0 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    line-height: 1.35;
    text-align: left;
  }

  /* Row shape: <th> then three <td>s — use nth-of-type, not nth-child (th is first child). */
  .plans-table tbody td:nth-of-type(1) {
    grid-column: 1;
    grid-row: 2;
  }

  .plans-table tbody td:nth-of-type(2) {
    grid-column: 2;
    grid-row: 2;
  }

  .plans-table tbody td:nth-of-type(3) {
    grid-column: 3;
    grid-row: 2;
  }

  .plans-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 6px;
    border: none !important;
    white-space: normal;
    min-height: 3.75rem;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    gap: 6px;
  }

  .plans-table tbody td:nth-of-type(1)::before {
    content: "Standard";
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.2;
    text-align: center;
  }

  .plans-table tbody td:nth-of-type(2)::before {
    content: "Standard Plus";
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.15;
    text-align: center;
    max-width: 100%;
    padding: 0 2px;
  }

  .plans-table tbody td:nth-of-type(3)::before {
    content: "Bespoke";
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.2;
    text-align: center;
  }

  .plans-table .plan-yes {
    font-size: 0.95rem;
    line-height: 1;
  }

  .plans-table .plan-no {
    font-size: 0.95rem;
    line-height: 1;
  }

  .plans-table .plan-future {
    max-width: none;
    width: 100%;
    font-size: 0.625rem;
    line-height: 1.25;
    padding: 0 2px;
  }

  .plans-table tbody tr:last-child th,
  .plans-table tbody tr:last-child td {
    border-bottom: none;
  }
}

/* Plans page (class hooks from marketing_plans.html) */
.plans-page {
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

@media (max-width: 480px) {
  .plans-page {
    padding-top: 6.5rem;
    padding-bottom: 3rem;
  }

  .plans-page h1 {
    font-size: clamp(1.35rem, 7vw, 1.85rem);
  }

  .plans-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .plans-cta .btn {
    width: 100%;
    justify-content: center;
  }
}
