/* ============================================================
   Top Funds Landing — page styles
   ============================================================ */

/* HERO BAND */
.hero {
  border-bottom: 1px solid var(--b1);
  background:
    radial-gradient(700px 360px at 18% -40%, rgba(201,152,42,0.16), transparent 60%);
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 36px 22px 32px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px;
}
.hero h1 {
  margin: 0 0 12px; max-width: 640px;
  font-family: var(--display); font-weight: 600; font-size: 38px;
  line-height: 1.08; letter-spacing: -0.025em; color: var(--t1);
  text-wrap: balance;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--a) 10%, var(--a2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  margin: 0; max-width: 520px; font-size: 15px; color: var(--t2); line-height: 1.55;
}
.hero-stats { display: flex; gap: 30px; flex: none; padding-bottom: 4px; }
.hero-stat .v {
  font-family: var(--display); font-weight: 600; font-size: 30px; color: var(--t1);
  letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px;
}
.hero-stat .l {
  margin-top: 3px; font-size: 12px; color: var(--t2);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* LAYOUT GRID */
.layout {
  max-width: var(--maxw); margin: 0 auto; padding: 22px;
  display: grid; grid-template-columns: 220px minmax(0,1fr) 260px;
  gap: 22px; align-items: start;
}

/* SIDEBAR */
.sidebar { position: sticky; top: calc(var(--header-h) + 14px); }
.sidebar-scroll {
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto; padding-right: 4px;
}
.cat-group { margin-bottom: 18px; }
.cat-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; width: 100%; background: none; border: none;
  font-family: var(--display); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--t2);
}
.cat-group-head .chev { transition: transform .2s; color: var(--t3); }
.cat-group.collapsed .chev { transform: rotate(-90deg); }
.cat-group.collapsed .cat-list { display: none; }
.cat-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.cat-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--r8); cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 13px; color: var(--t2);
  transition: background .14s, color .14s, border-color .14s;
}
.cat-item:hover { background: var(--bg3); color: var(--t1); }
.cat-item.active {
  background: var(--b1); border-left-color: var(--a); color: var(--t1); font-weight: 500;
}
.cat-badge {
  font-family: var(--mono); font-size: 10px; color: var(--t3);
  background: rgba(201,152,42,0.07); padding: 2px 6px; border-radius: 999px;
  flex: none;
}
.cat-item.active .cat-badge { color: var(--t2); }

/* MAIN */
.main { min-width: 0; }
.cat-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  margin-bottom: 18px;
}
.cat-header h2 {
  margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 28px;
  letter-spacing: -0.02em; color: var(--t1);
}
.cat-header .sub { margin: 0; font-size: 13.5px; color: var(--t2); max-width: 560px; }

/* segmented period selector */
.segmented {
  display: inline-flex; background: var(--bg3); border: 1px solid var(--b1);
  border-radius: 999px; padding: 3px; flex: none; position: relative;
}
.seg-btn {
  position: relative; z-index: 1; border: none; background: none;
  padding: 7px 15px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--t2); letter-spacing: 0.03em; transition: color .2s;
  white-space: nowrap;
}
.seg-btn.active { color: var(--bg); }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; z-index: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--a), var(--a2));
  box-shadow: 0 2px 10px rgba(201,152,42,0.4);
  transition: left .22s cubic-bezier(.4,.1,.2,1), width .22s cubic-bezier(.4,.1,.2,1);
}

/* sort/filter bar */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--b1);
}
.toolbar .label { font-size: 12px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.06em; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--b1); color: var(--t2);
  border-radius: var(--r8); padding: 6px 11px; font-size: 12.5px; font-weight: 500;
  transition: border-color .14s, color .14s, background .14s;
}
.chip:hover { border-color: var(--b2); color: var(--t1); }
.chip.active { background: var(--b1); border-color: var(--b3); color: var(--t1); }
.chip svg { width: 13px; height: 13px; opacity: .8; }
.toolbar .spacer { flex: 1; }
.view-toggle { display: inline-flex; background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r8); padding: 3px; }
.view-toggle button {
  border: none; background: none; color: var(--t2); padding: 6px 12px;
  border-radius: 6px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.view-toggle button.active { background: var(--b1); color: var(--t1); }

/* TABLE */
.fund-table-wrap { overflow-x: auto; }
.fund-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.fund-table thead th {
  text-align: right; padding: 0 10px 12px; font-size: 11px; font-weight: 600;
  color: var(--t3); text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap; cursor: pointer; user-select: none;
}
.fund-table thead th.l { text-align: left; }
.fund-table thead th.c { text-align: center; }
.fund-table thead th .arrow-i { opacity: 0; margin-left: 3px; }
.fund-table thead th.sorted { color: var(--t1); }
.fund-table thead th.sorted .arrow-i { opacity: 1; }

.fund-row {
  height: 76px; cursor: pointer;
  border-top: 1px solid var(--b1);
  transition: background .16s, transform .16s;
}
.fund-row:hover { background: var(--bg3); transform: scale(1.005); }
.fund-row td { padding: 0 10px; vertical-align: middle; }
.fund-row td.num { text-align: right; }

.rank-cell { width: 44px; text-align: center !important; }
.rank {
  font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--t3);
  display: inline-flex; align-items: center; justify-content: center;
}
.rank.r1 { color: var(--gold); }
.rank.r2 { color: #cbd5e1; }
.rank.r3 { color: #d08c52; }
.rank .trophy { margin-right: 2px; }

.fund-name .n1 { font-size: 14px; font-weight: 600; color: var(--t1); line-height: 1.25; }
.fund-name .n2 {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 3px;
  font-size: 11px; color: var(--t3);
}
.fund-name .plan-badge {
  background: rgba(201,152,42,0.08); border: 1px solid var(--b1);
  padding: 1px 6px; border-radius: 5px; font-size: 10px; color: var(--t2); font-weight: 500;
}
.fund-name .n3 { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 11px; color: var(--t2); }

.ret { font-family: var(--mono); font-size: 13px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ret .ar { font-size: 10px; }
.ret-cell.hot {
  background: var(--b1);
  border-left: 1px solid var(--b1); border-right: 1px solid var(--b1);
}
.ret-cell.hot .ret { font-size: 15px; font-weight: 700; }
.muted-dash { color: var(--t3); }

.aum, .ter { font-family: var(--mono); font-size: 12.5px; color: var(--t2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.go-cell { width: 40px; text-align: center !important; }
.go {
  width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center;
  color: var(--t3); transition: color .16s, transform .16s, background .16s;
}
.fund-row:hover .go { color: var(--a); transform: translateX(3px); background: var(--b1); }

.compare-check { width: 34px; text-align: center !important; }
.compare-mode .compare-check { display: table-cell; }
.compare-check input { width: 16px; height: 16px; accent-color: var(--a); cursor: pointer; }

/* card view (also mobile) */
.fund-cards { display: none; flex-direction: column; gap: 12px; }
.fund-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 14px;
  padding: 14px; border-radius: var(--r12); background: var(--card);
  border: 1px solid var(--b1); cursor: pointer; align-items: center;
  transition: border-color .16s, transform .16s;
}
.fund-card:hover { border-color: var(--b2); transform: translateY(-2px); }
.fund-card .fc-rank { font-family: var(--display); font-weight: 700; font-size: 18px; }
.fund-card .fc-body { min-width: 0; }
.fund-card .fc-name { font-size: 14px; font-weight: 600; color: var(--t1); }
.fund-card .fc-meta { font-size: 11.5px; color: var(--t3); margin-top: 2px; }
.fund-card .fc-ret { text-align: right; }
.fund-card .fc-ret .v { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.fund-card .fc-ret .l { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; }
.fund-card .fc-foot {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--b1); padding-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--t2);
}

/* show more */
.show-more-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--b1); flex-wrap: wrap;
}
.show-more-bar .sm-count { font-family: var(--mono); font-size: 12px; color: var(--t3); }
.show-more-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--b2); color: var(--t1);
  border-radius: var(--r8); padding: 9px 18px; font-size: 13px; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.show-more-btn:hover { border-color: var(--b3); background: var(--b1); }
.show-more-btn svg { transition: transform .2s; }
.show-more-btn.expanded svg { transform: rotate(180deg); }
.show-more-bar.done { display: none; }

/* rows revealing past the fold */
.fund-row.extra, .fund-card.extra { display: none; }
.fund-row.reveal, .fund-card.reveal { display: table-row; animation: revealRow .4s ease both; }
.fund-card.reveal { display: grid; }
@keyframes revealRow { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* footer note */
.foot-note {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--b1);
  font-size: 12px; color: var(--t3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* INSIGHTS PANEL */
.insights { position: sticky; top: calc(var(--header-h) + 14px); display: flex; flex-direction: column; gap: 16px; }
.ins-card { padding: 16px; }
.ins-card h3 {
  margin: 0 0 14px; font-family: var(--display); font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em; color: var(--t1); display: flex; align-items: center; gap: 8px;
}
.ins-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--b1); }
.ins-row:last-child { border-bottom: none; }
.ins-row .k { font-size: 12.5px; color: var(--t2); }
.ins-row .v { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--t1); font-variant-numeric: tabular-nums; }

.ins-cta {
  padding: 18px; border-radius: var(--r14); color: var(--bg); position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--a), var(--a2));
  box-shadow: var(--shadow-cta);
}
.ins-cta::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(220px 120px at 90% 0%, rgba(255,255,255,0.22), transparent 60%);
  pointer-events: none;
}
.ins-cta h3 { color: var(--bg); margin: 0 0 6px; font-family: var(--display); font-size: 15px; font-weight: 600; }
.ins-cta p { margin: 0 0 14px; font-size: 12.5px; color: rgba(5,17,31,0.80); line-height: 1.5; }
.ins-cta .cta-btn {
  width: 100%; border: none; background: var(--bg); color: #e4dfd0;
  border-radius: var(--r8); padding: 10px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.25);
  transition: background .16s; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.ins-cta .cta-btn:hover { background: #10294a; }
.ins-cta .cta-btn:disabled { opacity: .55; cursor: not-allowed; }

.method p { margin: 0 0 10px; font-size: 12px; color: var(--t2); line-height: 1.6; }
.method a { color: var(--a); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.method a:hover { color: var(--a2); }

/* compare bar (sticky bottom) */
.compare-bar {
  position: fixed; left: 50%; bottom: -90px; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 14px;
  background: rgba(8,25,41,0.92); backdrop-filter: blur(16px);
  border: 1px solid var(--b3); border-radius: 999px; padding: 10px 12px 10px 18px;
  box-shadow: var(--shadow-lift); transition: bottom .3s cubic-bezier(.2,.7,.3,1);
}
.compare-bar.show { bottom: 22px; }
.compare-bar .ct { font-size: 13px; color: var(--t2); }
.compare-bar .ct b { color: var(--t1); }
.compare-bar .pills { display: flex; gap: 6px; }
.compare-bar .pill {
  font-size: 11px; background: var(--b1); border: 1px solid var(--b2); color: var(--t1);
  padding: 4px 9px; border-radius: 999px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar-scroll {
    max-height: none; overflow-x: auto; overflow-y: hidden;
    display: flex; gap: 8px; padding-bottom: 8px;
  }
  .cat-group { margin-bottom: 0; flex: none; }
  .cat-group-head { display: none; }
  .cat-list { flex-direction: row; margin: 0; }
  .cat-item { border-left: none; border: 1px solid var(--b1); white-space: nowrap; border-radius: 999px; }
  .cat-item.active { border-color: var(--b3); }
  .insights { position: static; flex-direction: row; flex-wrap: wrap; }
  .insights > * { flex: 1 1 240px; }
}
@media (max-width: 860px) {
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 22px; }
  .hero h1 { font-size: 30px; }
  .hero-stats { gap: 22px; }
  .hero-stat .v { font-size: 24px; }
}
@media (max-width: 760px) {
  .header-center { display: none; }
  .search { width: 150px; }
  .fund-table-wrap { display: none !important; }
  .fund-cards { display: flex !important; }
  .cat-header { flex-direction: column; }
  .segmented { width: 100%; overflow-x: auto; }
  .insights > * { flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .wrap, .layout, .hero-inner, .header { padding-left: 14px; padding-right: 14px; }
  .hero h1 { font-size: 26px; }
}
