/* =====================================================
   WorldBest IPO — global stylesheet (owned by scaffold)
   Fintech dashboard aesthetic, light theme, mobile-first
   Breakpoints: 720px / 1024px
   ===================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --brand: #1e3a8a;
  --brand-2: #3730a3;
  --gain: #059669;
  --loss: #dc2626;
  --warn: #d97706;
  --line: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.10);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }
svg.logo { height: 32px; width: 32px; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }

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

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

main > section { margin: 32px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.muted { color: var(--muted); }

/* ---------- Sticky header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}
.brand:hover { text-decoration: none; }
.wordmark { font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }

/* Hamburger (mobile) */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
}
.site-nav.open { display: flex; }
.site-nav a {
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.site-nav a:hover { background: var(--bg); text-decoration: none; }
.site-nav a.active { color: var(--brand); border-left-color: var(--brand); background: #eef2ff; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1e3a8a, #3730a3);
  color: #ffffff;
  padding: 40px 0 44px;
}
.hero h1 { color: #ffffff; margin-bottom: 12px; }
.hero p { color: rgba(255, 255, 255, 0.88); max-width: 640px; }
.hero .data-stamp { color: rgba(255, 255, 255, 0.75); font-size: 0.85rem; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #ffffff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-light { background: #ffffff; color: var(--brand); }
.btn-light:hover { background: #eef2ff; }
.btn-outline-light { background: transparent; color: #ffffff; border-color: rgba(255, 255, 255, 0.6); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); }
.btn-cta { background: var(--gain); color: #ffffff; box-shadow: var(--shadow); }
.btn-cta:hover { background: #047857; }

/* ---------- Stat strip ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: -24px; /* overlap hero bottom when placed right after */
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.stat-value { display: block; font-size: 1.25rem; font-weight: 800; }
.stat-note { display: block; font-size: 0.78rem; color: var(--muted); }

/* ---------- Status badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-open { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.badge-upcoming { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-closed { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.badge-listed { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ---------- Cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.card,
.ipo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.ipo-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.ipo-card h3 { margin: 0; font-size: 1.02rem; }
.ipo-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.9rem; }
.ipo-card dt { color: var(--muted); font-weight: 400; }
.ipo-card dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Data tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 70vh;
  overflow-y: auto;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 640px;
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--brand);
  color: #ffffff;
  text-align: left;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  white-space: nowrap;
}
.table-wrap td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.table-wrap tbody tr:nth-child(even) { background: var(--bg); }
.table-wrap tbody tr:hover { background: #eef2ff; }
.table-wrap td:first-child { font-weight: 600; }

td.gain, .gain { color: var(--gain); font-weight: 700; }
td.loss, .loss { color: var(--loss); font-weight: 700; }
td.warn, .warn { color: var(--warn); font-weight: 700; }

.data-unavailable {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

/* "Data as of" stamp */
.data-stamp {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 8px 0 0;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, #1e3a8a, #3730a3);
  border-radius: var(--radius);
  color: #ffffff;
  margin: 32px auto;
  max-width: 1088px;
  box-shadow: var(--shadow-lg);
}
.cta-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  padding: 28px 24px;
}
.cta-text h2 { color: #ffffff; margin-bottom: 6px; }
.cta-text p { color: rgba(255, 255, 255, 0.88); margin: 0; }

/* ---------- Ad slot placeholder ---------- */
.ad-slot {
  min-height: 90px;
  margin: 24px auto;
  max-width: 1088px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 12px, #f8fafc 12px, #f8fafc 24px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot::after {
  content: 'Advertisement';
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Steps (How it works) ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  counter-reset: step;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.step-card .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--brand);
  font-weight: 800;
  margin-bottom: 10px;
}
.step-card h3 { margin-bottom: 6px; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 14px 40px 14px 16px;
  font-weight: 600;
  list-style: none;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-answer { padding: 12px 16px; color: var(--muted); font-size: 0.94rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---------- Guides / article typography ---------- */
article.guide,
.article-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  max-width: 780px;
}
article.guide h1 { font-size: 1.6rem; }
article.guide h2 { margin-top: 1.6em; }
article.guide h3 { margin-top: 1.3em; }
article.guide p, article.guide li { font-size: 0.98rem; line-height: 1.75; }
article.guide ul, article.guide ol { padding-left: 1.3em; margin: 0 0 1em; }
article.guide blockquote {
  margin: 1em 0;
  padding: 10px 16px;
  border-left: 4px solid var(--brand);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}
article.guide table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
article.guide th, article.guide td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
article.guide th { background: var(--bg); }
.article-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.2em; }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.84rem; color: var(--muted); margin: 16px 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line); }

/* ---------- Notices ---------- */
.notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #92400e;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  margin-top: 48px;
  padding: 40px 0 24px;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.footer-brand { font-weight: 800; font-size: 1.05rem; color: #ffffff; margin-bottom: 8px; }
.footer-col h4 {
  color: #ffffff;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.footer-col p { color: #94a3b8; margin: 0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { color: #cbd5e1; }
.footer-col a:hover { color: #ffffff; }
.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
}
.disclaimer-text { color: #94a3b8; font-size: 0.8rem; line-height: 1.6; }
.copyright { color: #64748b; font-size: 0.8rem; margin: 8px 0 0; }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =====================================================
   Breakpoint: 720px
   ===================================================== */
@media (min-width: 720px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.6rem; }

  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 4px;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .site-nav a {
    padding: 8px 12px;
    border-left: 0;
    border-radius: 8px;
  }
  .site-nav a.active { background: #eef2ff; border-left: 0; }

  .hero { padding: 56px 0 64px; }

  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }

  .cta-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 32px;
  }

  article.guide, .article-body { padding: 32px 36px; }
}

/* =====================================================
   Breakpoint: 1024px
   ===================================================== */
@media (min-width: 1024px) {
  .hero h1 { font-size: 2.6rem; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .table-wrap table { font-size: 0.92rem; }
}
