/* Alphaneo — Editorial Premium Fintech */
:root {
  --paper: #f6f3ec;
  --paper-2: #efebe2;
  --paper-3: #e7e2d5;
  --ink: #1a1915;
  --ink-2: #3d3a32;
  --ink-3: #6b665a;
  --ink-4: #9b9584;
  --rule: #d9d2c2;
  --rule-2: #c7bfac;
  --teal: #2d6a6a;
  --teal-2: #1f4a4a;
  --amber: #b8743a;
  --sage: #6b8562;
  --coral: #c85a4a;
  --gold: #c9a84a;
  --hi: rgba(45,106,106,0.08);

  --f-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --f-sans: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --paper: #17160f;
  --paper-2: #1e1d15;
  --paper-3: #26241a;
  --ink: #f0ecdf;
  --ink-2: #c9c3b1;
  --ink-3: #8e897a;
  --ink-4: #615d52;
  --rule: #2f2d22;
  --rule-2: #413e2e;
  --teal: #7ab3b3;
  --teal-2: #a2c9c9;
  --amber: #e0a870;
  --sage: #9dbf92;
  --coral: #e68a7a;
  --gold: #e2c674;
  --hi: rgba(122,179,179,0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); font-family: var(--f-sans); font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }

.serif { font-family: var(--f-serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.pos { color: var(--sage); }
.neg { color: var(--coral); }

button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; color: inherit; }

.rule { border-top: 1px solid var(--rule); }
.rule-b { border-bottom: 1px solid var(--rule); }

/* Top nav */
.topnav { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 40; height: 52px; }
.topnav .brand { display: flex; align-items: center; gap: 10px; padding: 0 22px; border-right: 1px solid var(--rule); }
.topnav .brand-mark { width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 50%; position: relative; }
.topnav .brand-mark::before { content: ""; position: absolute; inset: 3px; background: var(--ink); border-radius: 50%; transform: translateX(-4px); }
.topnav .brand-name { font-family: var(--f-serif); font-size: 18px; letter-spacing: -0.01em; }
.topnav .nav { display: flex; }
.topnav .nav a { padding: 0 18px; display: flex; align-items: center; color: var(--ink-3); font-size: 12px; letter-spacing: 0.02em; border-right: 1px solid var(--rule); position: relative; }
.topnav .nav a.active { color: var(--ink); }
.topnav .nav a.active::after { content:""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 2px; background: var(--ink); }
.topnav .spacer { flex: 1; }
.topnav .right { display: flex; align-items: center; gap: 0; }
.topnav .right > * { padding: 0 14px; height: 100%; display:flex; align-items: center; border-left: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); }
.topnav .search { gap: 8px; width: 260px; }
.topnav .search input { background: transparent; border: 0; outline: 0; flex: 1; font-size: 12px; color: var(--ink); }
.topnav .kbd { font-family: var(--f-mono); font-size: 10px; color: var(--ink-4); border: 1px solid var(--rule); padding: 1px 5px; border-radius: 3px; }
.topnav .clock { font-family: var(--f-mono); font-size: 11px; }
.topnav .account { gap: 8px; cursor: pointer; }
.topnav .avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; }

/* Marquee ticker */
.marquee { overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--paper-2); height: 30px; display: flex; align-items: center; }
.marquee-track { display: flex; gap: 36px; animation: scroll 80s linear infinite; white-space: nowrap; padding-left: 36px; }
.marquee-item { display: inline-flex; gap: 10px; align-items: baseline; font-family: var(--f-mono); font-size: 11px; }
.marquee-item .t { color: var(--ink); font-weight: 600; }
.marquee-item .p { color: var(--ink-2); }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Section header */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 32px 32px 20px; }
.section-head .title { font-family: var(--f-serif); font-size: 32px; line-height: 1.05; letter-spacing: -0.015em; }
.section-head .kicker { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.section-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 6px; max-width: 560px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 12px; letter-spacing: 0.02em; transition: all 0.15s; white-space: nowrap; }
.btn:hover { background: var(--paper); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 9px 16px; font-size: 12px; }
.btn.xs { padding: 3px 8px; font-size: 10px; letter-spacing: 0.04em; }
.btn.teal { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.btn.teal:hover { background: var(--paper); color: var(--teal); }
.btn.soft { background: var(--paper-2); border-color: var(--rule); color: var(--ink); }
.btn.soft:hover { border-color: var(--ink); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.btn.primary:hover { background: transparent; color: var(--teal); }
.btn.active-pill { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.field-input { background: var(--paper-2); border: 1px solid var(--rule); color: var(--ink); font-size: 13px; padding: 8px 12px; outline: none; font-family: inherit; }
.field-input:focus { border-color: var(--teal); }
select.field-input { cursor: pointer; }

/* Tag / Pill */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 10px; letter-spacing: 0.04em; border: 1px solid var(--rule-2); color: var(--ink-2); text-transform: uppercase; border-radius: 2px; white-space: nowrap; }
.pill.filled { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.teal { background: var(--teal); color: var(--paper); border-color: var(--teal); text-transform: none; letter-spacing: 0; font-size: 11px; padding: 3px 9px; }
.pill.amber { background: var(--amber); color: var(--paper); border-color: var(--amber); }
.pill.dot::before { content: "•"; color: var(--sage); }
.pill.dot.hot::before { color: var(--amber); }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--sage); box-shadow: 0 0 0 3px rgba(107,133,98,0.18); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--coral); }

/* Table */
table { border-collapse: collapse; width: 100%; }
thead th { text-align: left; font-weight: 500; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; }
thead th.num-h { text-align: right; }
tbody td { padding: 14px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; font-size: 13px; }
tbody tr { cursor: pointer; transition: background 0.12s; }
tbody tr:hover { background: var(--hi); }
tbody tr.active { background: var(--hi); }
td.num-c { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Card */
.card { background: var(--paper); border: 1px solid var(--rule); }
.card .card-h { padding: 14px 16px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; }
.card .card-h .k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.card .card-b { padding: 16px; }

.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dotted var(--rule); font-size: 12px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-3); }
.kv .v { font-family: var(--f-mono); color: var(--ink); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* Progress bar */
.progress { height: 3px; background: var(--paper-3); position: relative; overflow: hidden; }
.progress > span { position: absolute; inset: 0 auto 0 0; background: var(--teal); }

/* Animations */
.flash-up { animation: flashUp 0.6s; }
.flash-down { animation: flashDown 0.6s; }
@keyframes flashUp { from { background: rgba(107,133,98,0.25); } to { background: transparent; } }
@keyframes flashDown { from { background: rgba(200,90,74,0.25); } to { background: transparent; } }

.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(26,25,21,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 1; }

/* Tender slide-in panel */
.tender-backdrop { position: fixed; inset: 0; background: rgba(26,25,21,0.45); z-index: 99; display: flex; justify-content: flex-end; animation: fadeIn 0.2s both; }
.tender-panel { background: var(--paper); width: 620px; max-width: 92vw; height: 100vh; display: flex; flex-direction: column; border-left: 1px solid var(--rule); animation: slideInRight 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; box-shadow: -24px 0 60px rgba(0,0,0,0.25); }
@keyframes slideInRight { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal { background: var(--paper); border: 1px solid var(--ink); width: 520px; max-width: calc(100vw - 32px); max-height: 90vh; overflow: auto; }
[data-theme="dark"] .modal { border-color: var(--rule-2); }

/* Tweaks panel */
.tweaks { position: fixed; right: 16px; bottom: 16px; width: 280px; background: var(--paper); border: 1px solid var(--ink); z-index: 200; font-size: 12px; }
.tweaks header { padding: 10px 14px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.tweaks header .t { font-family: var(--f-serif); font-size: 16px; }
.tweaks .row { padding: 12px 14px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tweaks .row:last-child { border-bottom: 0; }
.tweaks .label { color: var(--ink-3); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.tweaks .seg { display: flex; border: 1px solid var(--rule); }
.tweaks .seg button { padding: 4px 8px; font-size: 11px; border-right: 1px solid var(--rule); color: var(--ink-3); }
.tweaks .seg button:last-child { border-right: 0; }
.tweaks .seg button.on { background: var(--ink); color: var(--paper); }

/* Mobile */
.mobile-frame { width: 390px; margin: 0 auto; background: var(--paper); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); min-height: 100vh; }

/* Layout main */
.app { min-height: 100vh; background: var(--paper); }

/* Radar chart text */
.radar-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--ink-3); font-family: var(--f-sans); }
.radar-value { font-size: 11px; fill: var(--ink); font-family: var(--f-mono); }

/* Sparkline */
.spark { shape-rendering: geometricPrecision; }

/* Focus */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Density compact */
[data-density="compact"] tbody td { padding: 8px 12px; }
[data-density="compact"] .section-head { padding: 20px 32px 12px; }

/* Pulse dot for live/running states */
.pulse-dot { animation: pulseDot 1.2s ease-in-out infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.grow { flex: 1; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-4); }
.small { font-size: 11px; }
.xs { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.big-num { font-family: var(--f-mono); font-size: 32px; line-height: 1; letter-spacing: -0.02em; }
.med-num { font-family: var(--f-mono); font-size: 22px; line-height: 1; letter-spacing: -0.01em; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--rule); }
.tabs button { padding: 12px 18px; font-size: 12px; letter-spacing: 0.02em; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button:hover { color: var(--ink); }

/* Slider */
input[type="range"].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; background: var(--rule); outline: none; }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; background: var(--ink); border-radius: 50%; cursor: pointer; border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--ink); }
input[type="range"].slider::-moz-range-thumb { width: 16px; height: 16px; background: var(--ink); border-radius: 50%; cursor: pointer; border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--ink); }

/* Bar chart row */
.barrow { display: grid; grid-template-columns: 80px 1fr 36px; align-items: center; gap: 12px; padding: 6px 0; }
.barrow .lbl { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.barrow .bar { height: 6px; background: var(--paper-3); position: relative; }
.barrow .bar > span { position: absolute; inset: 0 auto 0 0; background: var(--teal); }
.barrow .v { font-family: var(--f-mono); font-size: 11px; text-align: right; }

/* ===== Responsive ===== */

/* Table scroll wrapper */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 820px; }

@media (max-width: 960px) {
  /* Topnav: hide search + clock, let nav scroll */
  .topnav .search { display: none; }
  .topnav .clock  { display: none; }
  .topnav .nav    { overflow-x: auto; scrollbar-width: none; }
  .topnav .nav::-webkit-scrollbar { display: none; }

  /* Section head: tighter padding, stack title+controls */
  .section-head { padding: 20px 16px 14px; flex-wrap: wrap; gap: 12px; }

  /* Listing tabs: allow scroll */
  .listing-tabs { padding: 0 16px !important; overflow-x: auto; scrollbar-width: none; }
  .listing-tabs::-webkit-scrollbar { display: none; }

  /* Discover filters / admin subnav padding */
  [style*="padding: \"0 32px\""] { padding: 0 16px; }
}

@media (max-width: 768px) {
  /* Two-column grid → single column */
  .two-col-grid { grid-template-columns: 1fr !important; }

  /* Four-column stats strip → two columns */
  .stats-strip-4 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Detail header: stack logo/title block above actions */
  .detail-header-cols { grid-template-columns: 1fr !important; }
  .detail-header-cols > *:last-child { justify-content: flex-start !important; }

  /* Detail metrics strip: allow horizontal scroll */
  .detail-metrics-strip { overflow-x: auto; scrollbar-width: none; }
  .detail-metrics-strip::-webkit-scrollbar { display: none; }
  .detail-metrics-strip > * { min-width: 120px; }

  /* Detail tabs: allow horizontal scroll */
  .detail-tabs { overflow-x: auto; scrollbar-width: none; padding: 0 16px !important; }
  .detail-tabs::-webkit-scrollbar { display: none; }
  .detail-tabs button { white-space: nowrap; flex-shrink: 0; }

  /* Modal: full-width on mobile */
  .modal { width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important; }
  .modal-backdrop { padding: 8px; }

  /* Tender panel */
  .tender-panel { width: 100vw !important; max-width: 100vw !important; }

  /* General page padding */
  .fade-in > div { min-width: 0; }
}

@media (max-width: 640px) {
  /* Account chip: hide name/balance text at narrow widths — keep avatar + chevron */
  .topnav-account-text { display: none !important; }
  /* Tighten the account button padding so avatar sits centred */
  .topnav .account { padding: 0 12px !important; gap: 6px; }
}

@media (max-width: 480px) {
  /* Brand: tighter */
  .topnav .brand { padding: 0 12px; }
  .topnav .brand-name { font-size: 16px; }
  .topnav .nav a { padding: 0 12px; }
  .topnav .right > * { padding: 0 10px; }

  /* Section head title */
  .section-head .title { font-size: 24px; }

  /* Four-column stats → single column */
  .stats-strip-4 { grid-template-columns: 1fr 1fr !important; }

  /* VerificationCenter compliance table: let it scroll */
  .compliance-table { overflow-x: auto; }
  .compliance-table > div { min-width: 560px; }
}

/* ─── Public-site responsive (landing, about, legal, research) ─────────────── */

@media (max-width: 1024px) {
  /* Tighten outer padding on wide pages */
  .lp { padding-left: 28px !important; padding-right: 28px !important; }
  .manager-section .inner { padding-left: 28px !important; padding-right: 28px !important; }
  .quote-section { padding-left: 28px !important; padding-right: 28px !important; }
  .quote-section .inner { padding-left: 28px !important; padding-right: 28px !important; }
  .newsletter-band .nl-inner { padding-left: 28px !important; padding-right: 28px !important; }
  .legal-tabs-inner { padding: 0 28px !important; }
}

@media (max-width: 900px) {
  /* Nav: hide text links, keep logo + CTAs */
  .lp-nav .links { display: none !important; }
  .lp-nav { flex-wrap: nowrap; }

  /* Hero: single column, card hidden */
  .hero { grid-template-columns: 1fr !important; gap: 40px; }
  .hero h1 { font-size: clamp(42px, 8vw, 72px) !important; }
  .hero .lede { font-size: 18px !important; }
  .hero-card { display: none !important; }

  /* Section titles */
  .section-title { font-size: clamp(32px, 5vw, 48px) !important; }
  .quote-section .q { font-size: clamp(28px, 5vw, 40px) !important; }

  /* Scorecard demo: stack */
  .scorecard-demo { grid-template-columns: 1fr !important; gap: 48px; }

  /* Manager section: stack */
  .manager-section .inner { grid-template-columns: 1fr !important; gap: 40px; }

  /* How flow: horizontal scroll at tablet */
  .how-flow-wrap { overflow-x: auto; padding-bottom: 12px; }

  /* Approach grid (About page): stack */
  .approach-grid { grid-template-columns: 1fr !important; }

  /* Research memo grid: 1 col */
  .research-memo-grid { grid-template-columns: 1fr !important; }
  .memo-grid { grid-template-columns: 1fr !important; }

  /* Stats: 2 columns */
  .stats { grid-template-columns: repeat(2, 1fr) !important; }
  .stat:nth-child(2) { border-right: 0 !important; }
  .stat:nth-child(3) { border-top: 1px solid var(--rule); }
  .stat:nth-child(4) { border-top: 1px solid var(--rule); border-right: 0 !important; }
}

@media (max-width: 768px) {
  /* Outer padding */
  .lp { padding-left: 20px !important; padding-right: 20px !important; }
  .manager-section .inner { padding-left: 20px !important; padding-right: 20px !important; }
  .quote-section { padding-left: 20px !important; padding-right: 20px !important; }
  .quote-section .inner { padding-left: 20px !important; padding-right: 20px !important; }
  .newsletter-band .nl-inner { padding-left: 20px !important; padding-right: 20px !important; flex-direction: column !important; gap: 24px; }
  .newsletter-form { flex-direction: column !important; }
  .newsletter-form input { max-width: 100% !important; }

  /* Actions grid: 1 col */
  .actions-grid { grid-template-columns: 1fr !important; }

  /* Tiers: 1 col */
  .tiers { grid-template-columns: 1fr !important; }

  /* How grid: 2 col */
  .how { grid-template-columns: repeat(2, 1fr) !important; }

  /* Rounds table: horizontal scroll */
  .rounds-preview { overflow-x: auto; }
  .rounds-preview table { min-width: 560px; }

  /* Team grid (About): 1 col */
  .team-grid { grid-template-columns: 1fr !important; }

  /* Careers grid */
  .careers-grid { grid-template-columns: 1fr !important; }

  /* Section padding */
  .section { padding: 60px 0 !important; }
  .hero { padding: 28px 0 60px !important; }

  /* Legal tabs: scroll */
  .legal-tabs-inner { padding: 0 16px !important; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .legal-tabs-inner::-webkit-scrollbar { display: none; }

  /* Footer: stack */
  .lp-footer { grid-template-columns: 1fr !important; gap: 32px !important; }
}

@media (max-width: 480px) {
  /* Outer padding */
  .lp { padding-left: 16px !important; padding-right: 16px !important; }

  /* Section titles + hero */
  .hero h1 { font-size: clamp(36px, 10vw, 52px) !important; line-height: 1.05 !important; }
  .section-title { font-size: clamp(26px, 7vw, 36px) !important; }
  .hero .lede { font-size: 16px !important; }
  .hero .actions { flex-direction: column !important; }
  .hero .actions .btn { width: 100%; justify-content: center; }

  /* Stats: 2 col small */
  .stats { grid-template-columns: repeat(2, 1fr) !important; }
  .stat { padding: 20px 0 !important; }
  .stat .v { font-size: 32px !important; }

  /* How: 1 col */
  .how { grid-template-columns: 1fr !important; }

  /* Nav CTAs: stack or reduce */
  .lp-nav .cta { gap: 6px; }
  .lp-nav .cta .btn.ghost { display: none; }

  /* Deal type tiles */
  .manager-section .inner > div:last-child { display: none; }

  /* Research memo layout */
  .memo-layout { grid-template-columns: 1fr !important; }
  .memo-sidebar { display: none !important; }

  /* Modal */
  .auth-card { width: calc(100vw - 24px) !important; max-height: 90vh; }
  .auth-card.wide { width: calc(100vw - 24px) !important; }
}
