/* =====================================================================
   BidWise — Global Styles
   Fonts are loaded from Google Fonts (see HTML <link> tags)
   ===================================================================== */

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; }
img { max-width: 100%; display: block; }
::selection { background: rgba(37,229,155,0.3); }

/* Design tokens */
:root {
  --ink:         #0A0716;
  --ink2:        #120C29;
  --accent:      #25E59B;
  --accent-deep: #17C98A;
  --accent-ink:  #0C9A6A;
  --accent-glow: rgba(37,229,155,0.38);
  --indigo:      #7C6BF5;
  --card:        rgba(255,255,255,0.05);
  --line:        rgba(255,255,255,0.10);
}

/* Keyframe animations */
@keyframes bwGrad   { 0%   { background-position: 0%   50%; }
                      50%  { background-position: 100% 50%; }
                      100% { background-position: 0%   50%; } }
@keyframes bwFloat  { 0%, 100% { transform: translateY(0);    }
                      50%      { transform: translateY(-16px); } }
@keyframes bwFloat2 { 0%, 100% { transform: translateY(0);    }
                      50%      { transform: translateY(12px);  } }
@keyframes bwSpin   { to { transform: rotate(360deg); } }
@keyframes bwPulse  { 0%, 100% { opacity: .45; transform: scale(1);    }
                      50%      { opacity: .9;  transform: scale(1.06); } }
@keyframes bwCaret  { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── Responsive nav ────────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, background 0.35s ease;
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* scrolled state: hamburger lines turn dark */
.nav-hamburger.scrolled span { background: #14121F; }
/* but keep white when menu is open, regardless of scroll */
.nav-hamburger.is-open span  { background: #fff !important; }

.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 24px 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.nav-mobile.is-open { display: block; }

.nav-mobile-links { display: flex; flex-direction: column; margin-bottom: 16px; }

.nav-mobile-links a {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  opacity: .92;
}
.nav-mobile-links a:last-child { border-bottom: none; }

.nav-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #06231A;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 20px;
  border-radius: 11px;
  text-decoration: none;
  box-shadow: 0 8px 22px var(--accent-glow);
  margin-top: 4px;
}

@media (max-width: 780px) {
  .nav-links     { display: none !important; }
  .nav-cta       { display: none !important; }
  .nav-hamburger { display: flex; }
}

/* ── Rule engine — mobile fixes ────────────────────────────────────── */
@media (max-width: 640px) {
  /* tighter card padding */
  #ruleRef { padding: 20px 14px !important; }

  /* bubble: smaller font so it never clips at the right edge */
  [data-rule="bubble"] > div {
    font-size: 15px !important;
    padding: 5px 10px !important;
  }

  /* narrow bands (Declined 10%, Accept 15%): hide label text,
     the animated color still shows which zone is active */
  [data-band="declined"],
  [data-band="accepted"] { font-size: 0 !important; }

  /* scale: hide middle labels, keep just $0 … $500 */
  .rule-scale-mid { display: none; }

  /* outcome row: wrap so the badge drops to its own line */
  .rule-outcome { flex-wrap: wrap !important; gap: 12px !important; }
  [data-rule="draft"] {
    width: 100%;
    justify-content: center !important;
  }
}

/* ── Legal pages (terms / privacy) ────────────────────────────────── */
.legal-page {
  min-height: 100vh;
  background: #fff;
  font-family: 'Manrope', -apple-system, sans-serif;
  color: #14121F;
  -webkit-font-smoothing: antialiased;
}

.legal-hero {
  background: var(--ink);
  padding: 120px 0 64px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.legal-hero__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: #CFCBEC;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.legal-hero__label span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.legal-hero__title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0 0 16px;
}

.legal-hero__date {
  color: #9D98BF;
  font-size: 14px;
}

.legal-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.legal-body h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #14121F;
  margin: 48px 0 12px;
  letter-spacing: -.02em;
}

.legal-body h2:first-child { margin-top: 0; }

.legal-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #14121F;
  margin: 28px 0 8px;
  letter-spacing: -.01em;
}

.legal-body p, .legal-body li {
  font-size: 15px;
  line-height: 1.75;
  color: #4A4768;
  margin: 0 0 14px;
}

.legal-body ul, .legal-body ol {
  padding-left: 22px;
  margin: 0 0 14px;
}

.legal-body li { margin-bottom: 6px; }

.legal-body a {
  color: var(--accent-ink);
  text-decoration: underline;
}

.legal-placeholder {
  background: #F7F7FA;
  border: 1.5px dashed #D6D4E8;
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
  color: #9A97AB;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Blog listing ──────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  background: #fff;
  border: 1px solid #ECECF1;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(20,18,31,0.10);
}

.blog-card__cover {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0E0A22 0%, #1A1240 50%, #0A1628 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blog-card__cover-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(37,229,155,0.15);
  border: 1px solid rgba(37,229,155,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card__body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: rgba(12,154,106,0.08);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  width: fit-content;
}

.blog-card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: #14121F;
  margin: 0 0 10px;
}

.blog-card__excerpt {
  font-size: 14px;
  line-height: 1.65;
  color: #6B6880;
  margin: 0 0 20px;
  flex: 1;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: #9A97AB;
  font-weight: 500;
  padding-top: 16px;
  border-top: 1px solid #F0EFF5;
}

.blog-card__meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #CCCAD8;
  flex-shrink: 0;
}

/* ── Blog post (article) ───────────────────────────────────────────── */
.blog-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.blog-article h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #14121F;
  margin: 52px 0 14px;
  letter-spacing: -.025em;
  line-height: 1.2;
}
.blog-article h2:first-child { margin-top: 0; }

.blog-article h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: #14121F;
  margin: 30px 0 10px;
  letter-spacing: -.01em;
}

.blog-article p {
  font-size: 16px;
  line-height: 1.8;
  color: #4A4768;
  margin: 0 0 20px;
}

.blog-article ul, .blog-article ol {
  padding-left: 24px;
  margin: 0 0 20px;
}

.blog-article li {
  font-size: 16px;
  line-height: 1.75;
  color: #4A4768;
  margin-bottom: 8px;
}

.blog-article a { color: var(--accent-ink); text-decoration: underline; }

.blog-article blockquote {
  border-left: 3px solid var(--accent);
  margin: 32px 0;
  padding: 16px 24px;
  background: rgba(37,229,155,0.05);
  border-radius: 0 10px 10px 0;
}
.blog-article blockquote p {
  margin: 0;
  font-size: 17px;
  font-style: italic;
  color: #3D3A4F;
}

.blog-article .blog-cta-box {
  background: linear-gradient(135deg, #0E0A22, #13102B);
  border: 1px solid rgba(37,229,155,0.3);
  border-radius: 18px;
  padding: 32px 28px;
  margin: 48px 0;
  text-align: center;
}
.blog-article .blog-cta-box h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  margin: 0 0 10px;
  letter-spacing: -.02em;
}
.blog-article .blog-cta-box p {
  color: #ADA8C9;
  font-size: 15px;
  margin: 0 0 20px;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
  margin-bottom: 40px;
  transition: gap .2s;
}
.blog-back:hover { gap: 11px; }

.blog-related {
  background: #F6F7F9;
  padding: 64px 24px;
}
.blog-related__inner {
  max-width: 1080px;
  margin: 0 auto;
}
.blog-related__title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -.02em;
  color: #14121F;
  margin: 0 0 28px;
}
.blog-related__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 580px) { .blog-related__grid { grid-template-columns: 1fr; } }
