/* =============================================================
   SAFpedia — Design Tokens
   All colors are named by ROLE so they're easy to trace and swap:
   --color-blue / --color-red / --color-gold  → brand accents
   --color-blue-deep                          → dark-background variant (used only where a section needs a dark surface, e.g. tools/CTA)
   --color-*-light                            → soft tint versions for badges/hover states
   --color-text / --color-text-muted          → typography
   --color-bg / --color-bg-alt                → page backgrounds
   --color-border                             → hairline dividers
   ============================================================= */
:root {
  /* Blue */
  --color-blue: #2563EB;         /* normal blue — buttons, links, headings, icons */
  --color-blue-deep: #12305C;    /* dark blue — ONLY for dark section backgrounds (preloader, tools, CTA) */
  --color-blue-light: #E8EFFD;   /* light blue tint — badge backgrounds, hover fills */

  /* Red */
  --color-red: #D82F1E;          /* primary accent / CTA red */
  --color-red-deep: #B02416;     /* red hover / darker state */
  --color-red-light: #FCEAE8;    /* light red tint — badge backgrounds */

  /* Gold (small highlight only, never a base color) */
  --color-gold: #E8A93A;

  /* Neutrals */
  --color-white: #FFFFFF;
  --color-bg: #FFFFFF;           /* default page/section background */
  --color-bg-alt: #F7F8FB;       /* alternating section background */
  --color-text: #0B1220;         /* primary text */
  --color-text-muted: #4A5568;   /* secondary text */
  --color-border: #E3E7F0;       /* hairline dividers */

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radius / shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow-card: 0 4px 24px rgba(11, 46, 89, 0.08);
  --shadow-pop: 0 12px 40px rgba(11, 46, 89, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

.section-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================================
   Preloader (dark by design — a splash screen, not the hero)
   ============================================================= */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--color-blue-deep);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-content { text-align: center; }
.loader-ring {
  width: 46px; height: 46px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: rgba(255,255,255,0.8); font-size: 14px; letter-spacing: 0.04em; }

/* =============================================================
   Navbar
   ============================================================= */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav-container {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand-logo {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--color-blue);
  display: flex; align-items: baseline; gap: 2px;
}
.brand-logo::after {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-red);
  margin-left: 4px;
  align-self: flex-end;
  margin-bottom: 6px;
}
.nav-links {
  display: flex; align-items: center; gap: 34px;
}
.nav-link {
  font-size: 15px; font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav-link:hover, .nav-link.active { color: var(--color-blue); }
.nav-link.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--color-red); border-radius: 2px;
}
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: flex; align-items: center; gap: 4px; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 14px); left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  min-width: 210px;
  padding: 10px;
  opacity: 0; visibility: hidden;
  transition: all 0.2s ease;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--color-text-muted);
}
.nav-dropdown-menu a:hover { background: var(--color-blue-light); color: var(--color-blue); }

.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-signin {
  font-size: 15px; font-weight: 600; color: var(--color-blue);
  display: flex; align-items: center; gap: 6px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  padding: 12px 24px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-red); color: var(--color-white);
  box-shadow: 0 6px 18px rgba(216,47,30,0.28);
}
.btn-primary:hover { background: var(--color-red-deep); transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--color-blue);
  border: 1.5px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-blue); color: var(--color-blue); }
.btn-outline {
  background: transparent; color: var(--color-blue);
  border: 1.5px solid var(--color-blue);
}
.btn-outline:hover { background: var(--color-blue); color: var(--color-white); }
.btn-white { background: var(--color-white); color: var(--color-blue); }
.btn-white:hover { background: var(--color-bg-alt); }
.btn-sm { padding: 9px 18px; font-size: 14px; }

.mobile-menu-btn { display: none; font-size: 26px; color: var(--color-blue); }

@media (max-width: 960px) {
  .nav-links, .nav-signin { display: none; }
  .mobile-menu-btn { display: block; }
}

.mobile-menu {
  position: fixed; top: 72px; left: 0; right: 0; bottom: 0;
  background: var(--color-white);
  z-index: 999;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-nav-link {
  display: block; padding: 16px 4px;
  font-size: 18px; font-weight: 600; color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

/* =============================================================
   Hero — white background, orbit/gradient blobs as the only color
   ============================================================= */
.hero {
  position: relative;
  background: var(--color-bg);
  overflow: hidden;
  padding: 96px 0 64px;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.gradient-orb {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.28;
}
.orb-1 { width: 420px; height: 420px; background: var(--color-blue); top: -140px; right: -100px; }
.orb-2 { width: 320px; height: 320px; background: var(--color-gold); bottom: -100px; left: -80px; opacity: 0.22; }
.orb-3 { width: 260px; height: 260px; background: var(--color-blue); top: 40%; left: 55%; opacity: 0.2; }

.hero-container { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hero-content { max-width: 760px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-blue-light);
  border: 1px solid var(--color-border);
  color: var(--color-blue);
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 28px;
}
.badge-icon { color: var(--color-gold); font-size: 16px; display: flex; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.12;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.gradient-text { color: var(--color-red); font-style: italic; }

.hero-subtitle {
  font-size: 17px; color: var(--color-text-muted);
  max-width: 600px; margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 60px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, auto); gap: 40px;
  border-top: 1px solid var(--color-border);
  padding-top: 32px;
}
.stat-item h3 {
  font-family: var(--font-display);
  font-size: 28px; color: var(--color-blue); margin-bottom: 4px;
}
.stat-item p { font-size: 13px; color: var(--color-text-muted); }

@media (max-width: 640px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

/* Thread motif — signature element */
.thread-divider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 36px 0;
}
.thread-line { flex: 1; max-width: 120px; height: 1px; background: var(--color-border); }
.thread-chip {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--color-red);
}
.thread-chip:nth-child(3) { background: var(--color-blue); }
.thread-chip:nth-child(5) { background: var(--color-gold); }

/* =============================================================
   Trust bar
   ============================================================= */
.trust-bar { background: var(--color-bg-alt); padding: 32px 0; border-bottom: 1px solid var(--color-border); }
.trust-row {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap; text-align: center;
}
.trust-avatars { display: flex; }
.trust-avatars img {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--color-white);
  margin-left: -10px;
  object-fit: cover;
}
.trust-avatars img:first-child { margin-left: 0; }
.trust-text { font-size: 14px; color: var(--color-text-muted); }
.trust-text strong { color: var(--color-blue); }

/* =============================================================
   Section headers
   ============================================================= */
.section-badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-red);
  background: var(--color-red-light);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 600;
  color: var(--color-blue);
  line-height: 1.2;
  margin-bottom: 16px;
}
.section-description {
  font-size: 16px; color: var(--color-text-muted);
  max-width: 560px;
}
.section-header { text-align: center; margin: 0 auto 56px; }
.section-header .section-description { margin: 0 auto; }

/* =============================================================
   About / Three Pillars
   ============================================================= */
.about { padding: 96px 0; }
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.image-wrapper {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.image-overlay { position: absolute; bottom: 20px; left: 20px; }
.overlay-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-white); padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--color-blue);
  box-shadow: var(--shadow-card);
}
.overlay-badge ion-icon { color: var(--color-gold); }

.about-features { margin: 28px 0 32px; display: flex; flex-direction: column; gap: 20px; }
.feature-item { display: flex; gap: 14px; align-items: flex-start; }
.feature-icon {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-blue-light); color: var(--color-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.feature-text h4 { font-size: 15px; font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.feature-text p { font-size: 14px; color: var(--color-text-muted); }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-image { order: -1; }
}

/* =============================================================
   Pillars (Learn / Sell / Earn)
   ============================================================= */
.pillars { padding: 96px 0; background: var(--color-bg-alt); }
.pillars-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.pillar-card {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--r-lg); padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pillar-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.pillar-index {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  color: var(--color-white); background: var(--color-blue);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.pillar-card:nth-child(2) .pillar-index { background: var(--color-red); }
.pillar-card:nth-child(3) .pillar-index { background: var(--color-gold); color: var(--color-text); }
.pillar-card h3 { font-size: 19px; font-weight: 700; color: var(--color-blue); margin-bottom: 10px; }
.pillar-card p { font-size: 14.5px; color: var(--color-text-muted); margin-bottom: 18px; }
.pillar-link { font-size: 14px; font-weight: 600; color: var(--color-blue); display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 860px) {
  .pillars-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   How it works
   ============================================================= */
.how-it-works { padding: 96px 0; }
.steps-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: 20px;
}
.step-card { text-align: left; padding: 0 8px; position: relative; }
.step-num {
  font-family: var(--font-display); font-size: 40px; font-weight: 600;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-blue);
  margin-bottom: 14px;
}
.step-card h4 { font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: 8px; }
.step-card p { font-size: 14px; color: var(--color-text-muted); }

@media (max-width: 860px) {
  .steps-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .steps-row { grid-template-columns: 1fr; }
}

/* =============================================================
   Feature strip (tools grid) — intentionally dark for contrast
   ============================================================= */
.tools-section { padding: 96px 0; background: var(--color-blue-deep); }
.tools-section .section-badge { background: rgba(255,255,255,0.1); color: var(--color-gold); }
.tools-section .section-title { color: var(--color-white); }
.tools-section .section-description { color: rgba(255,255,255,0.7); }
.tools-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: 20px;
}
.tool-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-md); padding: 24px;
}
.tool-card ion-icon { font-size: 24px; color: var(--color-gold); margin-bottom: 14px; }
.tool-card h4 { font-size: 15.5px; font-weight: 700; color: var(--color-white); margin-bottom: 8px; }
.tool-card p { font-size: 13.5px; color: rgba(255,255,255,0.65); }

@media (max-width: 860px) { .tools-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .tools-grid { grid-template-columns: 1fr; } }

/* =============================================================
   Payments / reach strip
   ============================================================= */
.payments-section { padding: 80px 0; text-align: center; }
.payments-logos {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 32px;
  margin-top: 32px; align-items: center;
}
.payments-logos span {
  font-weight: 700; font-size: 15px; color: var(--color-text-muted);
  padding: 10px 18px; border: 1px solid var(--color-border); border-radius: var(--r-sm);
}

/* =============================================================
   Testimonials
   ============================================================= */
.testimonials { padding: 96px 0; background: var(--color-bg-alt); }
.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial-card {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--r-lg); padding: 28px;
}
.testimonial-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.testimonial-header img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.testimonial-info h4 { font-size: 15px; font-weight: 700; }
.testimonial-info p { font-size: 13px; color: var(--color-text-muted); }
.rating { color: var(--color-gold); font-size: 14px; margin-bottom: 12px; display: flex; gap: 2px; }
.testimonial-text { font-size: 14.5px; color: var(--color-text-muted); }

@media (max-width: 860px) { .testimonials-grid { grid-template-columns: 1fr; } }

/* =============================================================
   Press strip
   ============================================================= */
.press-section { padding: 60px 0; text-align: center; }
.press-logos {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 40px;
  margin-top: 28px; opacity: 0.6;
  font-weight: 700; font-size: 15px; color: var(--color-text-muted);
}

/* =============================================================
   CTA — intentionally dark for contrast, mirrors tools-section
   ============================================================= */
.cta-section {
  background: linear-gradient(135deg, var(--color-blue-deep), var(--color-red-deep));
  padding: 88px 0;
}
.cta-container { max-width: 720px; margin: 0 auto; padding: 0 24px; text-align: center; }
.cta-content h2 {
  font-family: var(--font-display); font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  color: var(--color-white); margin-bottom: 16px; font-weight: 600;
}
.cta-content p { color: rgba(255,255,255,0.8); font-size: 16px; margin-bottom: 32px; }

/* =============================================================
   Footer
   ============================================================= */
.footer { background: var(--color-text); color: rgba(255,255,255,0.7); padding: 72px 0 24px; }
.footer-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand h3 { font-family: var(--font-display); color: var(--color-white); font-size: 22px; margin-bottom: 12px; }
.footer-brand p { font-size: 14px; margin-bottom: 20px; }
.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; transition: background 0.2s ease;
}
.social-links a:hover { background: var(--color-red); }
.footer-links h4, .footer-contact h4 { color: var(--color-white); font-size: 14.5px; margin-bottom: 18px; }
.footer-links ul { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { font-size: 14px; }
.footer-links a:hover { color: var(--color-white); }
.contact-item { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 12px; }
.contact-item ion-icon { color: var(--color-gold); }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; font-size: 13px; flex-wrap: wrap; gap: 12px;
}
.footer-bottom-links { display: flex; gap: 20px; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   Scroll reveal utility
   ============================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }