/* =============================================
   QPARTNERS CORE STYLESHEET v3.0
   Optimized: consolidated rules, removed duplication,
   improved performance, accessibility, consistency
   ============================================= */

/* =====================
   CSS CUSTOM PROPERTIES
   ===================== */
:root {
  /* Brand */
  --red: #d10f1b;
  --black: #0f0f12;
  --text: #141417;
  --muted: #6a6a72;
  --line: #ececef;
  --bg: #ffffff;
  --soft: #f7f7f8;

  /* UI */
  --radius: 18px;
  --radius-lg: 28px;
  --header-h: 72px;
  --shadow-sm: 0 10px 28px rgba(10,10,20,.06);
  --shadow-md: 0 18px 55px rgba(10,10,20,.09);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0.0, 0.2, 1);
  --dur: 0.18s;
}

/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  padding-top: var(--header-h);
  /* Premium background */
  background:
    radial-gradient(1200px 800px at 15% 0%, rgba(255,255,255,.92) 0%, rgba(255,255,255,0) 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(255,255,255,.68) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, #fbfbfc 0%, #f2f3f5 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .042;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =====================
   LAYOUT
   ===================== */
.container { width: 92%; max-width: 1260px; margin: 0 auto; }

/* =====================
   TYPOGRAPHY
   ===================== */
.h1, .h2, .h3 {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.h1 { font-size: 52px; }
.h2 { font-size: 38px; }
.h3 { font-size: 15px; letter-spacing: -0.01em; }
.p { font-size: 17px; color: #232329; }
.small { font-size: 13px; color: rgba(20,20,23,.62); }
.kicker {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =====================
   INTERACTIVE ELEMENTS
   ===================== */
.link {
  font-weight: 850;
  font-size: 13px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--black);
  transition: color var(--dur) var(--ease);
}
.link:hover { color: var(--red); }
.link .arrow { transform: translateY(-.5px); }

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-solid { background: var(--black); color: #fff; }
.btn-solid:hover { background: var(--red); transform: translateY(-1px); }

.btn-outline { background: #fff; border-color: var(--line); color: var(--black); }
.btn-outline:hover {
  border-color: rgba(209,15,27,.38);
  color: var(--red);
  transform: translateY(-1px);
}

/* =====================
   FOCUS STYLES (Accessibility)
   ===================== */
:focus-visible {
  outline: 2px solid rgba(209,15,27,.55);
  outline-offset: 2px;
  border-radius: 12px;
}
button:focus-visible, a:focus-visible { border-radius: 8px; }

/* =====================
   HEADER
   ===================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-h);
  min-height: var(--header-h);
  z-index: 9999;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  will-change: transform;
}

.navbar {
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0;
}

/* =====================
   LOGO
   ===================== */
.brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 180px;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.brand img {
  max-height: 72px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand:hover img { opacity: .88; transition: opacity var(--dur) var(--ease); }

/* =====================
   NAV LINKS
   ===================== */
.navlinks {
  list-style: none;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.navlinks a {
  padding: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: var(--black);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.navlinks a:hover {
  color: var(--red);
  background: rgba(209,15,27,.06);
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

/* =====================
   MOBILE NAV BUTTON
   ===================== */
.menu-btn { display: none; }

/* =====================
   MOBILE NAV DROPDOWN
   ===================== */
.mobile-nav { display: none; }

@media (max-width: 960px) {
  /* ---- Header ---- */
  :root { --header-h: 48px; }

  header {
    height: 48px;
    background: rgba(251,251,253,.72);
  }

  body { padding-top: 48px; }
  html { scroll-padding-top: 48px; }

  .navbar {
    height: 48px;
    padding: 0 4%;
    gap: 12px;
    grid-template-columns: 1fr auto;
  }

  .navlinks { display: none; }

  .brand { width: auto; max-width: 120px; }
  .brand img { max-height: 20px; }

  .nav-actions {
    gap: 10px;
    flex-direction: row-reverse;
  }

  .nav-actions .btn {
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 16px;
  }

  /* ---- Hamburger ---- */
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 32px;
    padding: 0;
    margin-right: -8px;
    border: none;
    background: transparent;
    color: var(--black);
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    font-size: 0;
  }

  .menu-btn::before,
  .menu-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: var(--black);
    transform: translate(-50%, -50%);
    transition:
      transform .25s var(--ease),
      box-shadow .25s var(--ease),
      opacity .25s var(--ease);
  }

  .menu-btn::before { box-shadow: 0 -6px 0 var(--black), 0 6px 0 var(--black); }
  .menu-btn::after { opacity: 0; }

  header.nav-open .menu-btn::before {
    box-shadow: none;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  header.nav-open .menu-btn::after {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  /* ---- Mobile dropdown ---- */
  .mobile-nav {
    display: block;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    overflow: hidden;
    pointer-events: none;
    border-top: 1px solid var(--line);
    background: rgba(251,251,253,.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition:
      max-height .28s var(--ease),
      opacity .18s var(--ease),
      transform .28s var(--ease);
  }

  .mobile-nav.open {
    max-height: 500px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .mobile-nav a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--black);
    font-weight: 900;
    transition: color var(--dur) var(--ease);
  }

  .mobile-nav a:hover { color: var(--red); }
  .mobile-nav a:last-child { border-bottom: 0; }
}

@media (max-width: 520px) {
  .navbar { padding: 0 3%; gap: 10px; }
  .brand { max-width: 100px; }
  .brand img { max-height: 18px; }
  .nav-actions { gap: 8px; }
  .menu-btn { width: 40px; }
  .nav-actions .btn {
    height: 28px;
    padding: 0 12px;
    font-size: 11px;
  }
}

@media (max-width: 340px) {
  .nav-actions .btn-solid { display: none; }
  .menu-btn { margin-right: 0; }
}

/* =====================
   SECTIONS
   ===================== */
.section { padding: 82px 0; }

.section.soft {
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 28px;
}

.title .left { max-width: 70ch; }
.title .right { display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================
   CARDS
   ===================== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(209,15,27,.28);
  box-shadow: var(--shadow-md);
}

.card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 900;
}

.card p { font-size: 14px; color: var(--muted); }

/* =====================
   FOOTER
   ===================== */
footer {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding: 64px 0 36px;
  background: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 28px;
  margin-bottom: 26px;
}

footer h4 {
  color: var(--black);
  margin-bottom: 14px;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-family: "Space Grotesk", Inter, sans-serif;
}

footer ul { list-style: none; }

footer li {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

footer li a { transition: color var(--dur) var(--ease); }
footer li a:hover { color: var(--red); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

/* =====================
   RESPONSIVE — CONTENT BREAKPOINTS
   ===================== */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .title { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 620px) {
  .h1 { font-size: 40px; }
  .h2 { font-size: 32px; }
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}

/* =====================
   SHARED PAGE COMPONENTS
   ===================== */
.container.narrow { max-width: 880px; }

.lead {
  font-size: 19px;
  margin-top: 18px;
  line-height: 1.85;
  max-width: 70ch;
}

/* ── Pillars grid ── */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.pillar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.pillar:hover {
  transform: translateY(-2px);
  border-color: rgba(209,15,27,.18);
  box-shadow: var(--shadow-md);
}

.pillar h3 {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pillar-icon-inline {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--red);
  transition: transform 0.3s var(--ease);
}

.pillar:hover .pillar-icon-inline { transform: scale(1.15); }

.pillar p { font-size: 14px; color: var(--muted); line-height: 1.7; }

@media (max-width: 980px) {
  .pillars { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

@media (max-width: 620px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar  { padding: 18px; }
  .lead    { font-size: 17px; }
}
