/* ═══════════════════════════════════════════════════════════
   rf.css — Rational Forge global stylesheet
   All custom components, animations, and design tokens.
   Tailwind CDN handles layout utilities in HTML.
═══════════════════════════════════════════════════════════ */

/* ── 1. Design tokens ──────────────────────────────────── */
:root {
  --rf-red:     #b60018;
  --rf-blue:    #132451;
  --rf-lblue:   #005ab2;
  --rf-cyan:    #00a1fb;
  --rf-orange:  #ff5600;
  --rf-yellow:  #ffd900;

  --nav-h:     72px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-pop:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius-card: 18px;
}

html { scroll-padding-top: var(--nav-h); }
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }


/* ── 2. Scroll reveal ──────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.62s var(--ease), transform 0.62s var(--ease);
}
.reveal.visible  { opacity: 1; transform: none; }
.reveal-d1       { transition-delay: 0.10s; }
.reveal-d2       { transition-delay: 0.22s; }
.reveal-d3       { transition-delay: 0.34s; }
.reveal-d4       { transition-delay: 0.46s; }


/* ── 3. Gradient text helpers ──────────────────────────── */
.gt-blue {
  background: linear-gradient(135deg, var(--rf-cyan) 0%, #60bfff 45%, var(--rf-lblue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ── 4. Section label ──────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rf-lblue);
  margin-bottom: 14px;
}
.section-label::before {
  content: '';
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  flex-shrink: 0;
}
.dark .section-label { color: var(--rf-cyan); }


/* ── 5. Navbar ─────────────────────────────────────────── */
#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
#navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07);
}
.dark #navbar.scrolled {
  background: rgba(6, 10, 22, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Nav links — white over hero, dark when scrolled */
.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rf-cyan);
  border-radius: 2px;
  transition: width 0.24s var(--ease);
}
.nav-link:hover             { color: #fff; }
.nav-link:hover::after      { width: 100%; }
#navbar.scrolled .nav-link  { color: #4b5563; }
#navbar.scrolled .nav-link:hover { color: var(--rf-blue); }
#navbar.scrolled .nav-link:hover::after { background: var(--rf-blue); }
.dark #navbar.scrolled .nav-link { color: #9ca3af; }
.dark #navbar.scrolled .nav-link:hover { color: #fff; }
.dark #navbar.scrolled .nav-link:hover::after { background: var(--rf-cyan); }

/* Brand "Forge" text — cyan over hero, dark blue when scrolled light, cyan when scrolled dark */
#navForge                         { color: #00a1fb; transition: color 0.32s; }
#navbar.scrolled #navForge        { color: #005ab2;  }
.dark #navbar.scrolled #navForge  { color: #00a1fb; }

/* Icon buttons */
.nav-btn                   { color: rgba(255,255,255,0.82); transition: color 0.2s; }
#navbar.scrolled .nav-btn  { color: #4b5563; }
.dark #navbar.scrolled .nav-btn { color: #9ca3af; }


/* ── 6. Hero ───────────────────────────────────────────── */
.hero-bg {
  background:
    radial-gradient(ellipse 72% 58% at 82% 18%, rgba(0, 90, 178, 0.28) 0%, transparent 68%),
    radial-gradient(ellipse 48% 38% at 52% 52%, rgba(0, 161, 251, 0.08) 0%, transparent 60%),
    linear-gradient(158deg, #050d1c 0%, #0e1a38 38%, #091527 68%, #050d1c 100%);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.042) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  pointer-events: none;
}

/* Staggered hero entrance animations */
.h-title, .h-sub, .h-scroll {
  opacity: 0;
  transform: translateY(16px);
  animation: hIn 0.65s var(--ease) forwards;
}
.h-badge  { animation-delay: 0.14s; }
.h-title  { animation-delay: 0.28s; }
.h-sub    { animation-delay: 0.44s; }
.h-cta    { animation-delay: 0.58s; }
.h-scroll { animation-delay: 0.86s; }
@keyframes hIn { to { opacity: 1; transform: none; } }

/* Scroll bounce indicator */
@keyframes sbounce { 0%,100% { transform:translateY(0); opacity:.5; } 50% { transform:translateY(7px); opacity:1; } }
.scroll-bounce { animation: sbounce 2.2s ease-in-out infinite; }


/* ── 7. Buttons ────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  background: var(--rf-red);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(182, 0, 24, 0.36);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}
.btn-primary:hover  { background: #8c0012; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(182,0,24,0.46); }
.btn-primary:active { transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.36); transform: translateY(-1px); }


/* ── 8. Feature cards ──────────────────────────────────── */
.f-card {
  padding: 32px;
  border-radius: var(--radius-card);
  background: #fff;
  border: 1px solid #e5e7eb;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.dark .f-card           { background: #111827; border-color: #1f2937; }
.f-card:hover           { border-color: #bfdbfe; box-shadow: 0 8px 32px rgba(0,90,178,0.09); transform: translateY(-4px); }
.dark .f-card:hover     { border-color: rgba(0,161,251,0.22); box-shadow: 0 8px 32px rgba(0,161,251,0.07); }

.f-icon {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}


/* ── 9. News cards ─────────────────────────────────────── */
.n-card {
  display: flex;
  gap: 20px;
  padding: 24px 28px;
  border-radius: var(--radius-card);
  border: 1px solid #e5e7eb;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.24s, box-shadow 0.22s, transform 0.22s;
}
.dark .n-card        { background: #111827; border-color: #1f2937; }
.n-card:hover        { border-color: #bfdbfe; box-shadow: 0 8px 28px rgba(0,90,178,0.09); transform: translateY(-3px); }
.dark .n-card:hover  { border-color: rgba(0,161,251,0.28); box-shadow: 0 8px 28px rgba(0,161,251,0.07); }


/* ── 10. Product cards ─────────────────────────────────── */
.p-card {
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}
.dark .p-card        { background: #111827; border-color: #1f2937; }
.p-card:hover        { box-shadow: 0 20px 52px rgba(0,0,0,0.12); transform: translateY(-6px); }


/* ── 11. Badges ────────────────────────────────────────── */
.badge-orange {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 86, 0, 0.10);
  color: var(--rf-orange);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 86, 0, 0.20);
}
.badge-gray {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid #e5e7eb;
}
.dark .badge-gray { background: #1f2937; color: #9ca3af; border-color: #374151; }


/* ── 12. Divider ───────────────────────────────────────── */
.hr-fade {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
}
.dark .hr-fade { background: linear-gradient(90deg, transparent, #1f2937 20%, #1f2937 80%, transparent); }


/* ── 13. Mobile drawer ─────────────────────────────────── */
#drawer             { position: fixed; inset: 0; z-index: 1001; pointer-events: none; }
#drawer.open        { pointer-events: all; }
#d-overlay          { position: absolute; inset: 0; background: rgba(0,0,0,0.50); opacity: 0; transition: opacity 0.28s; }
#drawer.open #d-overlay { opacity: 1; }
#d-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(300px, 88vw);
  background: #fff;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.34s var(--ease);
  box-shadow: -6px 0 28px rgba(0,0,0,0.12);
}
.dark #d-panel         { background: #0d1525; }
#drawer.open #d-panel  { transform: none; }


/* ── 14. Coming Soon modal ─────────────────────────────── */
#cs-modal             { position: fixed; inset: 0; z-index: 2000; pointer-events: none; display: flex; align-items: center; justify-content: center; }
#cs-modal.open        { pointer-events: all; }
#cs-overlay2          { position: absolute; inset: 0; background: rgba(0,0,0,0.52); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.28s; }
#cs-modal.open #cs-overlay2 { opacity: 1; }
#cs-box {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 24px;
  padding: 44px 36px 36px;
  text-align: center;
  box-shadow: 0 28px 72px rgba(0,0,0,0.20);
  border: 1px solid rgba(0,0,0,0.06);
  transform: scale(0.93) translateY(12px);
  opacity: 0;
  transition: transform 0.30s var(--ease-pop), opacity 0.26s var(--ease);
}
.dark #cs-box { background: #111827; border-color: #1f2937; }
#cs-modal.open #cs-box { transform: none; opacity: 1; }
#cs-close-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #6b7280;
  transition: background 0.18s, color 0.18s;
}
.dark #cs-close-btn { background: #1f2937; color: #9ca3af; }
#cs-close-btn:hover { background: #e5e7eb; color: #111827; }
.dark #cs-close-btn:hover { background: #374151; color: #fff; }

.cs-icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rf-blue), var(--rf-lblue));
}


/* ── 15. Quote block ───────────────────────────────────── */
.quote-block {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.dark .quote-block { background: #030712; border-color: #1f2937; }


/* ── 16. Process step numbers ──────────────────────────── */
.step-num {
  width: 96px; height: 96px;
  border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 1.875rem;
  font-weight: 900;
  color: #fff;
}
.step-num-1 { background: linear-gradient(145deg, var(--rf-cyan), var(--rf-lblue));  box-shadow: 0 8px 28px rgba(0,161,251,0.28); }
.step-num-2 { background: linear-gradient(145deg, var(--rf-orange), var(--rf-red));  box-shadow: 0 8px 28px rgba(255,86,0,0.26); }
.step-num-3 { background: linear-gradient(145deg, var(--rf-yellow), var(--rf-orange)); box-shadow: 0 8px 28px rgba(255,86,0,0.22); }


/* ── 17. News accordion ────────────────────────────────── */
.article-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
}
.article-body.open {
  max-height: 4000px;
  transition: max-height 0.55s ease-in;
}
.chevron             { transition: transform 0.28s ease; flex-shrink: 0; }
.chevron.rotate      { transform: rotate(180deg); }

/* ── 18. Arrow link ────────────────────────────────────── */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: gap 0.2s var(--ease);
  text-decoration: none;
}
.arrow-link:hover { gap: 10px; }
.arrow-link svg   { flex-shrink: 0; transition: transform 0.2s var(--ease); }
.arrow-link:hover svg { transform: translateX(2px); }
