/* ============================================================
   Virentiq — Global CSS
   Design tokens, reset, shared components
   ============================================================ */

/* ─── Font Fallbacks (size-adjust prevents layout shift on swap) ─ */
/* Matches Bricolage Grotesque metrics so text doesn't reflow      */
@font-face {
  font-family: 'Bricolage Grotesque Fallback';
  src: local('Arial');
  size-adjust: 105%;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* Matches Space Grotesk metrics */
@font-face {
  font-family: 'Space Grotesk Fallback';
  src: local('Arial');
  size-adjust: 100%;
  ascent-override: 94%;
  descent-override: 26%;
  line-gap-override: 0%;
}

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  --field:       #0D1B3D;
  --tangerine:   #FF5B1F;
  --cyan:        #00E5FF;
  --gold:        #FFB300;
  --hotpink:     #FF2D87;
  --bone:        #F2EFE6;
  --bone-alt:    #E5DBC4;
  --ink:         #0F1410;
  --studio:      #A89B7C;
  --font-display: 'Bricolage Grotesque', 'Bricolage Grotesque Fallback', sans-serif;
  --font-body:    'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;

  /* Spacing */
  --section-pad-v:   96px;
  --section-pad-h:   56px;
  --inner-max:       1280px;
  --nav-height:      60px;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

/* Screen-reader only */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Layout Primitives ──────────────────────────────────────── */
.vq-section {
  padding: var(--section-pad-v) var(--section-pad-h);
}

.vq-section__inner {
  max-width: var(--inner-max);
  margin: 0 auto;
}

/* ─── Typography Atoms ───────────────────────────────────────── */
.vq-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  line-height: 1;
  display: block;
  margin-bottom: 16px;
}

.vq-section-h2 {
  font-family: var(--font-display);
  font-size: 76px;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-bottom: 56px;
}

.vq-dim {
  opacity: 0.42;
}

.vq-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  vertical-align: middle;
  display: inline-block;
}

.vq-wordmark__q {
  color: var(--gold);
}

/* ─── Buttons ────────────────────────────────────────────────── */
.vq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
  border-radius: 999px;
  padding: 14px 28px;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.vq-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.vq-btn:active {
  transform: translateY(0);
}

.vq-btn--tangerine {
  background: var(--tangerine);
  color: #ffffff;
}

.vq-btn--tangerine:hover {
  background: #e8521b;
  opacity: 1;
}

.vq-btn--gold-pill {
  background: var(--gold);
  color: var(--field);
}

.vq-btn--gold-pill:hover {
  background: #e0a000;
  opacity: 1;
}

.vq-btn--outline-white {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.vq-btn--outline-white:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
  opacity: 1;
}

.vq-btn--outline-ink {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(15, 20, 16, 0.35);
}

.vq-btn--outline-ink:hover {
  background: rgba(15, 20, 16, 0.06);
  border-color: var(--ink);
  opacity: 1;
}

/* ─── Navigation ─────────────────────────────────────────────── */
.vq-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 27, 61, 0.82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vq-nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 56px;
  height: var(--nav-height);
  max-width: calc(var(--inner-max) + 112px);
  margin: 0 auto;
}

.vq-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.vq-nav__brand .vq-wordmark {
  color: #ffffff;
  font-size: 20px;
}

.vq-nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: 24px;
  flex: 1;
}

.vq-nav__links a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s ease;
}

.vq-nav__links a:hover,
.vq-nav__links a.is-active {
  color: #ffffff;
}

.vq-nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.vq-nav__context-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 3px 7px;
  line-height: 1;
  flex-shrink: 0;
}

.vq-nav__notes-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s ease;
}

.vq-nav__notes-link:hover {
  color: #ffffff;
}

.vq-nav__notes-link--active {
  color: var(--gold);
}

.vq-nav__notes-link--active:hover {
  color: var(--gold);
  opacity: 0.85;
}

/* Hamburger */
.vq-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}

.vq-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.vq-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.vq-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.vq-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.vq-mobile-menu {
  background: var(--field);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.vq-mobile-menu nav {
  display: flex;
  flex-direction: column;
  padding: 24px 24px 32px;
  gap: 0;
}

.vq-mobile-menu a {
  display: block;
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.15s;
}

.vq-mobile-menu a:last-child {
  border-bottom: none;
  margin-top: 16px;
}

.vq-mobile-menu a:hover {
  color: #ffffff;
}

/* ─── Engine Pill ─────────────────────────────────────────────── */
.vq-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.vq-engine-pill:hover {
  opacity: 0.8;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.vq-footer {
  background: #000000;
  color: rgba(255, 255, 255, 0.7);
  padding: 80px 56px 0;
}

.vq-footer__inner {
  max-width: var(--inner-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 80px;
}

.vq-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vq-footer__brand .vq-wordmark {
  color: #ffffff;
  margin-top: 4px;
}

.vq-footer__tagline {
  font-size: 14px;
  opacity: 0.55;
  margin-top: 8px;
  line-height: 1.45;
}

.vq-footer__col {
  display: flex;
  flex-direction: column;
}

.vq-footer__col .vq-eyebrow {
  margin-bottom: 20px;
}

.vq-footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  transition: color 0.15s ease;
  line-height: 1.4;
}

.vq-footer a:hover {
  color: #ffffff;
}

.vq-footer__bottom {
  max-width: var(--inner-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 0 32px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.35);
  gap: 24px;
  flex-wrap: wrap;
}

/* ─── Pagination ─────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 64px 56px;
  max-width: var(--inner-max);
  margin: 0 auto;
}

.page-numbers {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--bone-alt);
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.page-numbers:hover {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
}

.page-numbers.current {
  background: var(--tangerine);
  color: #ffffff;
  border-color: var(--tangerine);
}

.page-numbers.dots {
  border: none;
  background: none;
  cursor: default;
}

/* ─── Page-specific styles ───────────────────────────────────── */
.vq-page__header {
  background: var(--field);
  color: white;
  padding: 80px 56px 64px;
}

.vq-page__title {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-top: 16px;
}

.vq-page__body {
  padding: 64px 56px;
}

.vq-page__body .vq-post-body p {
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 20px;
  max-width: 760px;
}

/* ─── Search form ─────────────────────────────────────────────── */
.vq-search-form {
  display: flex;
  gap: 0;
  max-width: 640px;
}

.vq-search-form__input,
.vq-404__search input[type="search"] {
  flex: 1;
  padding: 14px 20px;
  border-radius: 8px 0 0 8px;
  border: 1px solid var(--bone-alt);
  border-right: none;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: white;
  outline: none;
}

.vq-search-form__input:focus,
.vq-404__search input[type="search"]:focus {
  border-color: var(--tangerine);
  box-shadow: 0 0 0 3px rgba(255, 91, 31, 0.15);
}

.vq-search-form .vq-btn,
.vq-404__search .vq-btn {
  border-radius: 0 8px 8px 0;
}

.vq-search-bar-section {
  padding: 40px 56px;
  background: var(--bone);
}

/* ─── 404 Page ───────────────────────────────────────────────── */
.vq-404__hero {
  background: var(--field);
  color: white;
  padding: 120px 56px;
  min-height: 70vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.vq-404__echo {
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.vq-404__inner {
  position: relative;
  z-index: 2;
}

.vq-404__h1 {
  font-family: var(--font-display);
  font-size: 88px;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: white;
  margin-top: 16px;
  margin-bottom: 24px;
}

.vq-404__dek {
  font-size: 22px;
  line-height: 1.5;
  opacity: 0.75;
  max-width: 560px;
  margin-bottom: 40px;
}

.vq-404__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.vq-404__search {
  display: flex;
  flex-direction: column;
  max-width: 440px;
}

.vq-404__search > div {
  display: flex;
}

/* ─── Posts empty state ──────────────────────────────────────── */
.vq-posts__empty {
  padding: 80px 56px;
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
}

.vq-posts__empty p {
  margin-top: 16px;
  font-size: 18px;
  opacity: 0.65;
}

/* ─── Post nav ───────────────────────────────────────────────── */
.vq-post-nav {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--bone-alt);
}

.vq-post-nav .nav-links {
  padding: 0;
  justify-content: space-between;
}

.vq-post-nav .nav-previous,
.vq-post-nav .nav-next {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 45%;
}

.vq-post-nav .vq-post-nav__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.vq-post-nav a {
  text-decoration: none;
}

/* ─── Responsive — Tablet (760–1099px) ───────────────────────── */
@media (max-width: 1099px) {
  :root {
    --section-pad-v: 100px;
    --section-pad-h: 40px;
  }

  .vq-section-h2 {
    font-size: 56px;
    margin-bottom: 40px;
  }

  .vq-nav__inner {
    padding: 0 32px;
  }

  .vq-nav__links {
    display: none;
  }

  .vq-hamburger {
    display: flex;
  }

  .vq-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px 24px;
  }

  .vq-page__title {
    font-size: 48px;
  }

  .vq-404__h1 {
    font-size: 64px;
  }
}

/* ─── Responsive — Mobile (<760px) ──────────────────────────── */
@media (max-width: 759px) {
  :root {
    --section-pad-v: 72px;
    --section-pad-h: 20px;
  }

  .vq-section-h2 {
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.03em;
  }

  .vq-nav__inner {
    padding: 0 20px;
  }

  .vq-nav__actions .vq-btn {
    display: none;
  }

  .vq-footer {
    padding: 56px 20px 0;
  }

  .vq-footer__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .vq-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nav-links {
    padding: 40px 20px;
    flex-wrap: wrap;
  }

  .vq-page__header {
    padding: 56px 20px 40px;
  }

  .vq-page__body {
    padding: 40px 20px;
  }

  .vq-page__title {
    font-size: 36px;
  }

  .vq-404__hero {
    padding: 80px 20px;
  }

  .vq-404__h1 {
    font-size: 44px;
  }

  .vq-404__dek {
    font-size: 18px;
  }

  .vq-search-bar-section {
    padding: 32px 20px;
  }

  .vq-posts__empty {
    padding: 56px 20px;
  }
}
