/* Responsive layer for the Ghost site. The design's own styles are inline;
   these rules only adapt them for smaller screens. */
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; overflow-x: hidden; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid #5B3FE0; outline-offset: 3px; border-radius: 4px; }
.hp { position: absolute; left: -9999px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-toggle { display: none; font: inherit; font-weight: 700; font-size: 16px; min-height: 44px; padding: 8px 16px; margin-left: auto; background: #FFFFFF; color: #141A2E; border: 2px solid #141A2E; border-radius: 999px; cursor: pointer; }
section[id] { scroll-margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* hero art scales with the column */
svg[width="620"] { width: 100%; height: auto; }
div[style*="height: 600px"] { height: auto !important; }

@media (max-width: 1180px) {
  header { position: relative; flex-wrap: wrap; gap: 16px !important; }
  .nav-toggle { display: inline-block; }
  nav#main-nav { display: none !important; order: 10; width: 100%; flex-direction: column; gap: 4px !important; margin: 8px 0 0 !important; padding-top: 8px; border-top: 2px solid #141A2E; }
  nav#main-nav.is-open { display: flex !important; }
  nav#main-nav a { padding: 10px 0; font-size: 18px; }
  [style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 1000px) {
  header, section, footer, main { padding-left: 32px !important; padding-right: 32px !important; }
  section { padding-top: 72px !important; padding-bottom: 72px !important; }
  section[style*="padding: 26px"] { padding-top: 20px !important; padding-bottom: 20px !important; }
  [style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"],
  [style*="grid-template-columns: minmax(0, 5fr) minmax(0, 6fr)"],
  [style*="grid-template-columns: minmax(0, 7fr) minmax(0, 4fr)"] { grid-template-columns: minmax(0, 1fr) !important; gap: 40px !important; }
  [style*="justify-content: space-between; align-items: end"],
  [style*="justify-content: space-between; align-items: center; gap: 48px"],
  [style*="justify-content: space-between; align-items: start"] { flex-direction: column !important; align-items: flex-start !important; gap: 20px !important; }
  section[style*="justify-content: space-between; gap: 24px"] { flex-wrap: wrap; justify-content: center !important; gap: 10px 28px !important; font-size: 15px !important; }
  h1 { font-size: 64px !important; }
  h2[style*="font-size: 120px"] { font-size: 88px !important; }
  h2 { font-size: 46px !important; }
  footer nav { flex-wrap: wrap; gap: 12px 24px !important; }
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  header, section, footer, main { padding-left: 20px !important; padding-right: 20px !important; }
  section { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  h1 { font-size: 46px !important; }
  h2[style*="font-size: 120px"] { font-size: 68px !important; }
  h2 { font-size: 36px !important; }
  h3[style*="font-size: 38px"] { font-size: 30px !important; }
  article, form, [style*="padding: 40px"] { padding: 24px !important; }
  header > a[href$="#contact"] { padding: 10px 16px !important; font-size: 15px !important; }
  [style*="display: flex; gap: 16px; margin-top: 8px"] { flex-wrap: wrap; }
  [style*="display: flex; gap: 14px; align-items: end"] { flex-direction: column; align-items: stretch !important; }
  [style*="font-size: 28px; color: #B9A9FF"] { font-size: 22px !important; }
  div[style*="font-family: 'JetBrains Mono'"][style*="padding: 32px"] { font-size: 14px !important; padding: 20px !important; overflow-x: auto; }
  .table-scroll table { min-width: 560px; }
  footer > div { flex-direction: column !important; }
}
@media (max-width: 420px) {
  [style*="grid-template-columns: repeat(5"] { grid-template-columns: minmax(0, 1fr) !important; }
  header > a[href$="#contact"] { display: none; }
}

/* QA pass 1 fixes */
li span[style*="color: #5B3FE0"] { white-space: nowrap; }
@media (max-width: 700px) {
  [style*="grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  [style*="grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px"] > div { padding: 12px 6px !important; }
  [style*="grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px"] svg { width: 64px; height: auto; }
  [style*="grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px"] span[style*="font-size: 22px"] { font-size: 17px !important; }
  table:has(#lib-rows) th:nth-child(n+5), #lib-rows td:nth-child(n+5) { display: none; }
  .table-scroll table:has(#lib-rows) { min-width: 0; }
  #lib-rows td { padding-left: 12px !important; padding-right: 12px !important; }
}
@media (max-width: 420px) {
  [style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
