/* =====================================================================
   css/riq.css  (shared RefactIQ primitives for landing + SaaS parity)
   - Tokens + base + reusable components
   - No page layout rules in here
   ===================================================================== */

/* === Base scaling & dark tokens (from SaaS) === */
html{
  font-size: 14px;
  position: relative;
  min-height: 100%;
}
@media (min-width: 768px){ html{ font-size: 16px; } }

:root{
  --bg: #0d1117;
  --panel: #161b22;
  --panel-1: #141a22;
  --panel-2: #0f141a;
  --border: #30363d;
  --text: #c9d1d9;
  --muted: #8b949e;

  --brand: #58a6ff;
  --brand-strong: #2f81f7;
  --brand-2: #7ee787;

  --danger: #f85149;
  --warn: #d29922;
  --ok: #3fb950;

  --input-bg: #0f1218;
  --focus: #4dabf7;

  --radius: 12px;
  --radius-lg: 16px;

  --s1: 6px;
  --s2: 10px;
  --s3: 16px;
  --s4: 24px;
  --shadow: 0 6px 14px rgba(0,0,0,.35);

  /* Scrollbar theming */
  --sb-track: rgba(255,255,255,.04);
  --sb-thumb: rgba(229,231,235,.22);
  --sb-thumb-hover: rgba(229,231,235,.32);
}

/* === Base reset / defaults === */
*{ box-sizing: border-box; }
html, body{ width:100%; overflow-x:hidden; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Scrollbars */
*{
  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb) var(--sb-track);
}
*::-webkit-scrollbar{ width: 12px; height: 12px; }
*::-webkit-scrollbar-track{ background: var(--sb-track); }
*::-webkit-scrollbar-thumb{
  background-color: var(--sb-thumb);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover{ background-color: var(--sb-thumb-hover); }

a{ color: var(--brand); text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 3px; }

.muted{ color: var(--muted); }
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  letter-spacing: .02em;
}

/* === Containers / spacing helpers === */
.riq-container{
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}
.riq-section{
  padding: clamp(28px, 4.2vw, 52px) 0; /* ~30% tighter */
}
.riq-section-tight{
  padding: clamp(20px, 2.8vw, 36px) 0; /* ~30% tighter */
}

/* === Top bar (landing header) === */
.riq-topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13,17,23,0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.riq-topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 14px 0;
}
.riq-topbar-left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.riq-topbar-right{
  display:flex;
  align-items:center;
  gap: 10px;
}
.riq-brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.riq-brand img{
  height: 30px;
  width: auto;
  display:block;
}

/* === Burger + menu === */
.riq-burger{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
  color: rgba(229,231,235,0.88);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.riq-burger:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}
.riq-burger:active{ transform: translateY(1px); }
.riq-burger:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(88,166,255,.22), 0 0 0 6px rgba(88,166,255,.10);
}
.riq-scrim[hidden],
.riq-menu[hidden]{
  display: none !important;
}
.riq-scrim{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 80;
}
.riq-menu{
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: min(320px, 88vw);
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255,255,255,0.10);
  z-index: 90;
  display:flex;
  flex-direction: column;
  padding: 14px;
  box-shadow: 0 28px 90px rgba(0,0,0,0.55);
  transform: translateX(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}
.riq-menu[data-open="true"]{
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.riq-menu-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 6px 2px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.riq-menu-title{
  font-weight: 900;
  letter-spacing: .01em;
}
.riq-iconbtn{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
  color: rgba(229,231,235,0.88);
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.riq-iconbtn:hover{ background: rgba(255,255,255,0.06); }
.riq-menu-nav{
  display:flex;
  flex-direction: column;
  padding: 12px 2px 0;
  gap: 6px;
}
.riq-menu-nav a{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 10px 10px;
  border-radius: 12px;
  color: rgba(229,231,235,0.86);
  text-decoration:none;
  border: 1px solid transparent;
}
.riq-menu-nav a:hover{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  text-decoration: none;
}
.riq-menu-cta{
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.riq-btn--block{ width: 100%; }
.riq-menu-micro{
  margin-top: 10px;
  font-size: 13px;
  color: rgba(229,231,235,.55);
}

/* === Cards / surfaces === */
.riq-card{
  border: 1px solid var(--border);
  background: radial-gradient(900px circle at 20% 0%,
              rgba(255,255,255,0.06), rgba(255,255,255,0) 60%),
              var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.riq-card-pad{ padding: clamp(14px, 2vw, 20px); }

.riq-card-subtle{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius);
}

/* === Pills / badges === */
.riq-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(229,231,235,0.92);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.riq-pill--brand{
  border-color: rgba(88,166,255,.45);
  background: rgba(88,166,255,.10);
  color: var(--brand);
}
.riq-pill--ok{
  border-color: rgba(63,185,80,.45);
  background: rgba(63,185,80,.10);
  color: var(--ok);
}

/* === Buttons === */
.riq-btn{
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 650;
  letter-spacing: .01em;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: .5rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease, border-color .15s ease;
  user-select: none;
}
.riq-btn:active{ transform: translateY(1px); }

.riq-btn--primary{
  color: #fff;
  background: linear-gradient(180deg, rgba(47,129,247,1) 0%, rgba(31,111,235,1) 100%);
  border-color: rgba(88,166,255,.55);
  box-shadow:
    0 10px 26px rgba(0,0,0,.45),
    0 0 0 1px rgba(88,166,255,.12) inset,
    0 10px 22px -14px rgba(47,129,247,.65);
}
.riq-btn--primary:hover{
  filter: brightness(1.06);
  border-color: rgba(88,166,255,.65);
  transform: translateY(-1px);
}
.riq-btn--ghost{
  background: transparent;
  color: var(--text);
  border-color: rgba(255,255,255,0.16);
}
.riq-btn--ghost:hover{ background: rgba(255,255,255,0.06); }

.riq-btn--outline{
  background: rgba(88,166,255,.06);
  color: rgba(229,231,235,0.92);
  border-color: rgba(88,166,255,.40);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.riq-btn--outline:hover{
  background: rgba(88,166,255,.10);
  border-color: rgba(88,166,255,.55);
  transform: translateY(-1px);
}

.riq-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(88,166,255,.22), 0 0 0 6px rgba(88,166,255,.10);
}

/* === Inputs === */
.riq-input{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display:block;
  width:100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  line-height: 1.3;
}
.riq-input::placeholder{ color: rgba(139,148,158,.95); }
.riq-input:focus{
  outline: none;
  border-color: rgba(88,166,255,.55);
  box-shadow: 0 0 0 3px rgba(88,166,255,.18);
}

/* === Type === */
.riq-h1{
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(34px, 3.8vw, 52px);
}
.riq-lede{
  margin-top: 14px;
  font-size: clamp(16px, 1.35vw, 19px);
  color: rgba(229,231,235,.78);
  line-height: 1.55;
}
.riq-h2{
  margin: 0 0 10px;
  font-size: clamp(22px, 2.3vw, 30px);
  letter-spacing: -0.01em;
}
.riq-kicker{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(229,231,235,.55);
}

/* === Simple grids === */
.riq-grid-2{
  display:grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 960px){
  .riq-grid-2{ grid-template-columns: 1.12fr 0.88fr; gap: 30px; }
}

.riq-grid-3{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 960px){
  .riq-grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
}