/* ============================================
   EdgeChain Holdings — Design System & Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --primary: #1B2A6B;
  --primary-dark: #111C4E;
  --accent: #C9A84C;
  --white: #FFFFFF;
  --gray-50: #F7F8FC;
  --gray-100: #EAECF4;
  --gray-600: #555E7A;
  --gray-900: #111827;
  --success: #16A34A;
  --danger: #DC2626;
  --nav-height: 72px;
  --max-width: 1280px;
  --section-padding: 80px;
  --section-padding-mobile: 48px;
  --card-radius: 4px;
  --card-gap: 24px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-600);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--gray-900); line-height: 1.2; }
h1 { font-size: 40px; font-weight: 700; }
h2 { font-size: 30px; font-weight: 600; }
h3 { font-size: 20px; font-weight: 600; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Typography --- */
.display-heading { font-size: 56px; font-weight: 700; line-height: 1.1; }
.section-label { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 12px; }
.caption { font-size: 13px; font-weight: 500; color: var(--gray-600); }
.mono { font-family: 'Inter', monospace; font-weight: 600; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; font-size: 14px; font-weight: 600;
  border-radius: var(--card-radius); border: 2px solid transparent;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
  font-family: inherit; line-height: 1.4;
}
.btn-primary {
  background: var(--primary); color: var(--white); border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark); border-color: var(--accent); color: var(--white);
  transform: scale(1.02); box-shadow: 0 4px 12px rgba(27,42,107,0.3);
}
.btn-accent {
  background: var(--accent); color: var(--white); border-color: var(--accent);
}
.btn-accent:hover {
  background: #b8943f; border-color: #b8943f; color: var(--white);
  transform: scale(1.02); box-shadow: 0 4px 12px rgba(201,168,76,0.3);
}
.btn-secondary {
  background: var(--white); color: var(--primary); border-color: var(--primary);
}
.btn-secondary:hover {
  background: var(--gray-50); transform: scale(1.02);
}
.btn-ghost {
  background: transparent; color: var(--white); border-color: rgba(255,255,255,0.4);
}
.btn-ghost:hover {
  border-color: var(--white); background: rgba(255,255,255,0.1);
  transform: scale(1.02);
}
.btn-sm { padding: 8px 20px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }

/* --- Cards --- */
.card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--card-radius); padding: var(--card-gap);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.card-no-hover { transform: none !important; box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important; }

.stat-card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--card-radius); padding: 28px var(--card-gap);
  text-align: center;
}
.stat-card .stat-number { font-size: 36px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.stat-card .stat-label { font-size: 14px; color: var(--gray-600); font-weight: 500; }

/* --- Badges --- */
.badge {
  display: inline-block; padding: 4px 12px; font-size: 11px; font-weight: 600;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-primary { background: rgba(27,42,107,0.1); color: var(--primary); }
.badge-accent { background: rgba(201,168,76,0.15); color: #9a7c2e; }
.badge-success { background: rgba(22,163,74,0.1); color: var(--success); }
.badge-danger { background: rgba(220,38,38,0.1); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height);
  background: var(--white); border-bottom: 1px solid var(--gray-100);
  z-index: 100; display: flex; align-items: center;
}
.nav .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-logo img, .nav-logo svg { height: 36px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--gray-600);
  position: relative; padding: 4px 0; transition: color 0.2s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px; background: var(--accent); transition: width 0.3s;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }
.nav-links .btn { padding: 8px 20px; }

/* Mega Menu */
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-menu {
  position: absolute; top: 100%; left: -16px; min-width: 240px;
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--card-radius); padding: 8px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all 0.2s; z-index: 101; margin-top: 8px;
}
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
  display: block; padding: 10px 20px; font-size: 14px; color: var(--gray-600);
}
.dropdown-menu a:hover { background: var(--gray-50); color: var(--primary); }
.dropdown-menu a::after { display: none; }

/* Mobile Nav */
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  font-size: 24px; color: var(--primary); padding: 4px;
}
.mobile-menu {
  display: none; position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0;
  background: var(--white); z-index: 99; padding: 24px;
  overflow-y: auto; flex-direction: column; gap: 0;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
  display: block; padding: 16px 0; font-size: 16px; font-weight: 500;
  color: var(--gray-900); border-bottom: 1px solid var(--gray-100);
}
.mobile-menu .btn { margin-top: 16px; text-align: center; }

/* --- Ticker Bar --- */
.ticker-bar {
  background: var(--primary-dark); color: var(--white); overflow: hidden;
  height: 44px; display: flex; align-items: center; position: relative;
}
.ticker-track {
  display: flex; gap: 48px; animation: tickerScroll 40s linear infinite;
  white-space: nowrap;
}
.ticker-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.ticker-item .ticker-symbol { color: var(--accent); }
.ticker-item .ticker-price { color: var(--white); }
.ticker-item .ticker-change { font-size: 12px; }
.ticker-item .ticker-change.up { color: var(--success); }
.ticker-item .ticker-change.down { color: var(--danger); }

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Hero --- */
.hero {
  background: var(--primary); color: var(--white);
  padding: 120px 0 80px; min-height: 620px;
  display: flex; align-items: center; position: relative;
  margin-top: var(--nav-height);
  background-size: cover; background-position: center;
}
.hero.hero-bg { background: linear-gradient(135deg, rgba(17,28,78,0.92) 0%, rgba(27,42,107,0.85) 100%), var(--hero-bg) center/cover no-repeat; }
.hero h1 { color: var(--white); font-size: 56px; max-width: 700px; margin-bottom: 20px; }
.hero p { font-size: 18px; color: rgba(255,255,255,0.8); max-width: 600px; line-height: 1.7; margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-small {
  padding: 100px 0 60px; min-height: auto; margin-top: var(--nav-height);
}
.hero-small h1 { font-size: 40px; margin-bottom: 12px; }
.hero-small p { font-size: 16px; margin-bottom: 0; }

/* --- Article Card with Image --- */
.article-card-img { padding: 0; overflow: hidden; }
.article-card-img .article-image {
  width: 100%; height: 200px; object-fit: cover;
  border-bottom: 1px solid var(--gray-100);
}
.article-card-img .article-body { padding: var(--card-gap); }

/* --- Image Feature Section --- */
.feature-image-section { display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: stretch; }
.feature-image-section .feature-content { padding: 64px 48px; display: flex; flex-direction: column; justify-content: center; }
.feature-image-section .feature-img { width: 100%; height: 100%; object-fit: cover; min-height: 400px; }

/* --- CTA Banner with bg --- */
.cta-banner.cta-bg {
  background: linear-gradient(135deg, rgba(17,28,78,0.9) 0%, rgba(27,42,107,0.85) 100%),
    var(--cta-bg) center/cover no-repeat;
}

/* --- Partner logos with better spacing --- */
.partners-section { overflow: hidden; }

@media (max-width: 768px) {
  .feature-image-section { grid-template-columns: 1fr; }
  .feature-image-section .feature-img { min-height: 250px; }
  .feature-image-section .feature-content { padding: 32px 24px; }
  .article-card-img .article-image { height: 160px; }
}

/* --- Sections --- */
.section { padding: var(--section-padding) 0; }
.section-gray { background: var(--gray-50); }
.section-navy { background: var(--primary); color: var(--white); }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy p { color: rgba(255,255,255,0.8); }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-header h2 { margin-bottom: 16px; }

/* --- Grid Layouts --- */
.grid { display: grid; gap: var(--card-gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* --- Tabs --- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-100); margin-bottom: 32px; overflow-x: auto; }
.tab-btn {
  padding: 12px 24px; font-size: 14px; font-weight: 500;
  color: var(--gray-600); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- Tables --- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-600);
  border-bottom: 2px solid var(--gray-100); background: var(--gray-50);
}
.data-table td {
  padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--gray-100);
}
.data-table tr:hover td { background: var(--gray-50); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 500;
  color: var(--gray-900); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--gray-100); border-radius: var(--card-radius);
  font-family: inherit; transition: border-color 0.2s; background: var(--white);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,42,107,0.1); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555E7A' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* --- Footer --- */
.footer { background: var(--primary-dark); color: rgba(255,255,255,0.7); padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand p { margin-top: 12px; font-size: 14px; line-height: 1.6; }
.footer-brand .footer-logo { height: 32px; margin-bottom: 8px; filter: brightness(0) invert(1); }
.footer-social { display: flex; gap: 16px; margin-top: 16px; }
.footer-social a { color: rgba(255,255,255,0.6); font-size: 18px; transition: color 0.2s; }
.footer-social a:hover { color: var(--accent); }
.footer h4 { color: var(--white); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { color: rgba(255,255,255,0.6); font-size: 14px; transition: color 0.2s; }
.footer ul a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding: 24px 0;
  font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.8;
}

/* --- Investor Gate Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--white); border-radius: 8px; padding: 48px;
  max-width: 720px; width: 90%; text-align: center;
}
.modal h2 { margin-bottom: 8px; }
.modal p { margin-bottom: 32px; color: var(--gray-600); }
.investor-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.investor-option {
  border: 2px solid var(--gray-100); border-radius: 8px; padding: 24px 16px;
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.investor-option:hover { border-color: var(--accent); background: var(--gray-50); }
.investor-option i { font-size: 28px; color: var(--primary); margin-bottom: 12px; display: block; }
.investor-option h4 { font-size: 14px; margin-bottom: 6px; }
.investor-option p { font-size: 12px; margin-bottom: 0; color: var(--gray-600); }

/* --- Partners Row --- */
.partners-row { display: flex; align-items: center; justify-content: center; gap: 48px; flex-wrap: wrap; }
.partner-logo {
  font-size: 16px; font-weight: 600; color: var(--gray-600);
  opacity: 0.4; transition: opacity 0.2s; white-space: nowrap;
}
.partner-logo:hover { opacity: 0.7; }

/* --- CTA Banner --- */
.cta-banner { padding: var(--section-padding) 0; text-align: center; }
.cta-banner h2 { color: var(--white); margin-bottom: 16px; }
.cta-banner p { color: rgba(255,255,255,0.8); margin-bottom: 32px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* --- Article Cards --- */
.article-card .article-category {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px; letter-spacing: 0.5px;
}
.article-card h3 { font-size: 18px; margin-bottom: 8px; }
.article-card .article-meta { font-size: 13px; color: var(--gray-600); margin-bottom: 8px; }
.article-card .article-excerpt { font-size: 14px; color: var(--gray-600); line-height: 1.6; margin-bottom: 16px; }
.article-card .read-more { font-size: 14px; font-weight: 600; color: var(--primary); }

/* --- Timeline --- */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--gray-100);
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: ''; position: absolute; left: -29px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--white);
}
.timeline-item h4 { font-size: 16px; margin-bottom: 4px; }
.timeline-item p { font-size: 14px; color: var(--gray-600); }
.timeline-item .timeline-date { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }

/* --- Team Grid --- */
.team-card { text-align: center; padding: 32px 24px; }
.team-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--gray-100); margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--gray-600); overflow: hidden;
}
.team-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.team-card h3 { font-size: 18px; margin-bottom: 4px; }
.team-card .team-title { font-size: 14px; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.team-card .team-bio { font-size: 13px; color: var(--gray-600); line-height: 1.6; margin-bottom: 12px; }
.team-card .team-social a { color: var(--gray-600); font-size: 16px; }
.team-card .team-social a:hover { color: var(--primary); }

/* Team Page — Department Sections */
.team-department { margin-bottom: 56px; }
.team-department:last-child { margin-bottom: 0; }
.team-department-header { text-align: center; margin-bottom: 32px; }
.team-department-header .section-label { margin-bottom: 8px; }
.team-department-header h3 { font-size: 22px; color: var(--gray-900); }

/* Leader card — larger featured variant */
.team-card.leader-card { padding: 40px 32px; }
.team-card.leader-card .team-avatar { width: 130px; height: 130px; margin-bottom: 20px; }
.team-card.leader-card h3 { font-size: 20px; }
.team-card.leader-card .team-title { font-size: 15px; }
.team-card.leader-card .team-bio { font-size: 14px; }

/* --- Fund Card --- */
.fund-card { padding: 24px; }
.fund-card .fund-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fund-card h3 { font-size: 17px; }
.fund-card .fund-ticker { font-family: 'Inter', monospace; font-weight: 600; font-size: 13px; color: var(--accent); }
.fund-card p { font-size: 14px; margin-bottom: 16px; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--primary-dark);
  color: var(--white); padding: 14px 24px; border-radius: var(--card-radius);
  font-size: 14px; z-index: 300; opacity: 0; transform: translateY(20px);
  transition: all 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* --- Utilities --- */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-6 { margin-bottom: 48px; }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --section-padding: 48px; }
  .display-heading, .hero h1 { font-size: 36px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; }
  .investor-options { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .stat-card .stat-number { font-size: 28px; }
  .partners-row { gap: 24px; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .section-header { margin-bottom: 32px; }
  .modal { padding: 32px 24px; }
  .tabs { gap: 0; }
  .tab-btn { padding: 10px 16px; font-size: 13px; }
  [style*="grid-template-columns: 1fr 1fr"][style*="min-height"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1fr 1fr"][style*="min-height"] { grid-template-columns: 1fr !important; }
}

/* --- Table Responsive Wrapper --- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- Loading Spinner --- */
.loading { text-align: center; padding: 40px; color: var(--gray-600); }
.loading::after {
  content: ''; display: block; width: 32px; height: 32px; margin: 12px auto 0;
  border: 3px solid var(--gray-100); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Chart Container --- */
.chart-container { position: relative; max-width: 100%; }
.chart-container canvas { width: 100% !important; }

/* --- Filter Bar --- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  padding: 6px 16px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--gray-100); border-radius: 20px;
  background: var(--white); color: var(--gray-600);
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* --- Search Input --- */
.search-bar {
  position: relative; margin-bottom: 24px; max-width: 400px;
}
.search-bar input {
  width: 100%; padding: 10px 14px 10px 40px;
  border: 1px solid var(--gray-100); border-radius: var(--card-radius);
  font-size: 14px; font-family: inherit;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.search-bar i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray-600); }

/* --- Risk Badges --- */
.risk-low { background: rgba(22,163,74,0.1); color: var(--success); }
.risk-medium { background: rgba(201,168,76,0.15); color: #9a7c2e; }
.risk-high { background: rgba(220,38,38,0.1); color: var(--danger); }

/* --- Scroll margin for nav offset --- */
section[id] { scroll-margin-top: calc(var(--nav-height) + 16px); }
