/* ─── Shared static-page header + footer ───────────────────────────────────
   Visual twin of the React <Navbar> and <Footer> (src/components/landing/),
   for the hand-coded HTML pages under public/. Markup is generated by
   scripts/static-chrome.ts and injected at build time by the `static-chrome`
   Vite plugin — see vite.config.ts.

   Values are lifted verbatim from the React components so the two read as one
   header. If you restyle Navbar.tsx or Footer.tsx, mirror it here.

   NOT loaded by /docs/* — the docs hub keeps its own topbar.
   Depends on the tokens in static-theme.css; load that FIRST.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --thq-header-h: 5.5rem;
  --thq-ink: #f6f7f9;
  --thq-ink-dim: #818898;
  --thq-line: #1e2129;
  --thq-teal: #2bd4bd;
  --thq-glass: rgba(15, 16, 20, 0.55);
  --thq-font: "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    system-ui, sans-serif;
}

/* Push page content clear of the fixed header. Each page's own .wrap padding
   stacks on top of this, which is the breathing room we want. */
body {
  padding-top: var(--thq-header-h);
}

/* ── Legacy reset ───────────────────────────────────────────────────────────
   Each static page still carries its own inline `nav {…}` / `footer {…}`
   element rules from when it hand-rolled its own chrome (display:flex, gap,
   margin, colour, border-top, …). Those bare element selectors match the
   shared chrome too. Rather than regex 18 files' <style> blocks, neutralise
   them here — class selectors beat element selectors, so this always wins and
   the pages stay safe to edit by hand.
   ────────────────────────────────────────────────────────────────────────── */

.thq-nav,
.thq-footer {
  display: block;
  gap: 0;
  margin-bottom: 0;
  font-size: inherit;
  flex-wrap: nowrap;
  align-items: stretch;
}

.thq-footer a,
.thq-nav a {
  margin-right: 0;
}

/* Chrome links must ignore the shared `a:visited` colour in static-theme.css.
   A bare `.thq-nav-link` (0,1,0) LOSES to `a:visited` (0,1,1), so a visited
   nav item would render accent-teal while its unvisited siblings stayed grey.
   Re-stating each with :visited (0,2,0) settles it. */
.thq-brand:visited {
  color: var(--thq-ink);
}

.thq-nav-link:visited {
  color: var(--thq-ink-dim);
}

.thq-cta:visited {
  color: #0f1014;
}

.thq-foot-col a:visited {
  color: var(--fg);
}

.thq-foot-logo:visited {
  color: var(--fg);
}

.thq-crumb a:visited {
  color: var(--fg-dim);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.thq-header-pattern {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 70;
  height: min(42vh, 380px);
  pointer-events: none;
  user-select: none;
  background: url("/images/pattern-top.png") top center / 100% auto no-repeat;
}

.thq-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
}

@media (min-width: 640px) {
  .thq-header {
    padding: 1rem 1.5rem;
  }
}

.thq-nav {
  position: relative;
  max-width: 1152px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--thq-line);
  border-radius: 20px;
  background: var(--thq-glass);
  box-shadow: inset 0 0 24px rgba(100, 100, 100, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  /* reset the legacy `nav{}` element rules the static pages still carry */
  display: block;
  gap: 0;
  margin-bottom: 0;
  font-size: inherit;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .thq-nav {
    background: rgba(15, 16, 20, 0.35);
  }
}

/* Teal glow blob, top-left — mirrors the radial gradient in Navbar.tsx */
.thq-nav::before {
  content: "";
  position: absolute;
  top: -0.625rem;
  left: -1.25rem;
  width: 104px;
  height: 4rem;
  pointer-events: none;
  opacity: 0.55;
  filter: blur(2px);
  background: radial-gradient(
    ellipse 80% 70% at 30% 40%,
    rgba(43, 212, 189, 0.45) 0%,
    rgba(43, 212, 189, 0.08) 45%,
    transparent 70%
  );
}

.thq-nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

@media (min-width: 640px) {
  .thq-nav-inner {
    padding: 1rem 1.5rem;
  }
}

.thq-brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  color: var(--thq-ink);
  text-decoration: none;
}

/* The shared `a:hover { text-decoration: underline }` in static-theme.css would
   otherwise underline the wordmark on hover. */
.thq-brand:hover {
  text-decoration: none;
}

.thq-brand span {
  font-family: var(--thq-font);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.75rem;
  letter-spacing: -0.5px;
}

.thq-brand .thq-rabbit {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  color: var(--thq-teal);
}

.thq-nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.thq-nav-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .thq-nav-links,
  .thq-nav-actions {
    display: flex;
  }
}

.thq-nav-link {
  border-radius: 10px;
  padding: 0.5rem 0.875rem;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.176px;
  color: var(--thq-ink-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.thq-nav-link:hover {
  color: var(--thq-ink);
  text-decoration: none;
}

.thq-nav-actions .thq-nav-link {
  padding-inline: 1rem;
}

.thq-cta {
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.176px;
  color: #0f1014;
  background: var(--thq-teal);
  box-shadow: 0 0 0 1px rgba(43, 212, 189, 0.5);
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.2s var(--ease);
}

.thq-cta:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.thq-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--thq-ink);
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.thq-burger svg {
  width: 1.25rem;
  height: 1.25rem;
}

.thq-burger:hover {
  background: rgba(33, 35, 44, 0.6);
}

@media (min-width: 768px) {
  .thq-burger {
    display: none;
  }
}

/* ── Mobile drawer ──────────────────────────────────────────────────────── */

.thq-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-top: 1px solid var(--thq-line);
}

.thq-mobile[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .thq-mobile {
    display: none;
  }
}

.thq-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--thq-line);
}

.thq-mobile-actions .thq-cta {
  text-align: center;
  padding-block: 0.625rem;
}

/* Blog posts lost their "/ Blog" breadcrumb when the hand-rolled nav went.
   This is the way back up, without forking the shared header. */
.thq-crumb {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
}

.thq-crumb a {
  color: var(--fg-dim);
  text-decoration: none;
}

.thq-crumb a:hover {
  color: var(--accent);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.thq-footer {
  position: relative;
  overflow: hidden;
  /* override the legacy `footer{}` element rules on the static pages */
  margin-top: 6rem;
  padding: 3.5rem 1.5rem 1.75rem;
  border-top: 0;
  font-size: inherit;
  color: var(--fg);
  /* Solid --bg base UNDER the teal gradient. The gradient's own stops are
     translucent, so without an opaque base the page's dot field shows through
     the footer — the dots must stop where the footer starts. */
  background-color: hsl(var(--background));
  background-image: linear-gradient(
    180deg,
    hsl(var(--background)) 0%,
    hsl(var(--primary) / 0.06) 50%,
    hsl(var(--primary) / 0.25) 100%
  );
}

@media (min-width: 640px) {
  .thq-footer {
    padding-top: 4rem;
  }
}

.thq-footer-inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
}

.thq-foot-cols {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .thq-foot-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .thq-foot-cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
  }
}

.thq-foot-col h4 {
  margin: 0 0 1.25rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.thq-foot-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thq-foot-col li {
  margin: 0;
}

.thq-foot-col a {
  position: relative;
  display: inline-block;
  font-size: 13px;
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.thq-foot-col a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: hsl(var(--primary) / 0.6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.thq-foot-col a:hover {
  color: var(--accent);
  text-decoration: none;
}

.thq-foot-col a:hover::after {
  transform: scaleX(1);
}

/* Compliance bar */
.thq-foot-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
}

.thq-foot-bar::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--border)), transparent);
}

@media (min-width: 640px) {
  .thq-foot-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 4rem;
  }
}

.thq-foot-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.thq-foot-brand > span {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}

.thq-foot-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--thq-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.thq-foot-logo:hover {
  opacity: 0.9;
  text-decoration: none;
}

.thq-foot-logo .thq-rabbit {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.thq-foot-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid hsl(var(--primary) / 0.15);
  border-radius: 9999px;
  background: hsl(var(--primary) / 0.04);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-dim);
}

.thq-dot {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: hsl(var(--success));
}

.thq-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: hsl(var(--success));
  animation: thq-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes thq-ping {
  75%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Oversized brand mark, clipped by the footer's overflow — same as Footer.tsx */
.thq-foot-mark {
  position: absolute;
  bottom: -2.5rem;
  left: 0;
  z-index: 0;
  aspect-ratio: 888 / 847;
  height: clamp(13rem, 34vw, 28rem);
  max-width: none;
  transform: translateX(-28%);
  pointer-events: none;
  user-select: none;
  opacity: 0.5;
  background: hsl(var(--primary));
  -webkit-mask: url("/images/footer-logo.svg") center / contain no-repeat;
  mask: url("/images/footer-logo.svg") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .thq-dot::after {
    animation: none;
  }
  .thq-nav-link,
  .thq-cta,
  .thq-foot-col a,
  .thq-foot-col a::after {
    transition: none;
  }
}
