/* =========================================================
   Local LLM Leap — theme layer on top of TemplateMo 590
   Dark "terminal glow" look: violet + cyan, glass cards.
   ========================================================= */

:root {
  --bg: #0a0e1c;
  --bg-2: #10162a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(139, 108, 255, 0.22);
  --text: #eef1ff;
  --muted: #a9b1d6;
  --violet: #8b6cff;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --amber: #fbbf24;
  --pink: #f472b6;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --grad: linear-gradient(135deg, var(--violet) 0%, var(--cyan) 100%);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(139, 108, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(34, 211, 238, 0.10), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -0.02em; }
p, li { color: var(--muted); }
strong { color: var(--text); }
a { color: var(--cyan); }
a:hover { color: var(--violet); }
code, .mono { font-family: var(--mono); }

.text-gradient {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

::selection { background: var(--violet); color: #fff; }

/* ---------- Navbar ---------- */
.navbar { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sticky-wrapper.is-sticky .navbar {
  background-color: rgba(10, 14, 28, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.navbar-brand, .navbar-brand:hover { color: var(--text); font-size: 26px; }
.navbar-brand .brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; margin-right: 8px; border-radius: 10px;
  background: var(--grad); color: #0a0e1c; font-size: 20px;
  vertical-align: middle;
}
.navbar-nav .nav-link { color: var(--muted); }
.navbar-nav .nav-link.active, .navbar-nav .nav-link:hover { color: var(--text); }
.navbar-expand-lg .navbar-nav .nav-link.active {
  background: rgba(139, 108, 255, 0.18);
}
.navbar-icon { background: var(--surface-strong); color: var(--text); }
.navbar-icon:hover { background: var(--violet); color: #fff; }

/* ---------- Hero ---------- */
.hero-section {
  position: relative;
  overflow: hidden;
  min-height: min(88vh, 860px);
  padding-top: 140px;
  padding-bottom: 120px;
  background-image: url("../images/neural-grid.svg"), linear-gradient(160deg, #120d2e 0%, #1d1554 50%, #0b3a4a 100%);
  background-size: cover;
  background-position: center;
}
.hero-section::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 160px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero-section .container { position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 100px;
  padding: 6px 16px;
  margin-bottom: 24px;
  background: rgba(34, 211, 238, 0.06);
}
.hero-title { font-size: clamp(38px, 6vw, 72px); line-height: 1.05; }
.hero-sub { font-size: clamp(16px, 2vw, 21px); color: #c9cff0; max-width: 760px; margin: 20px auto 0; }
.typed-line {
  font-family: var(--mono);
  color: var(--lime);
  min-height: 1.6em;
  margin-top: 28px;
  font-size: clamp(14px, 1.8vw, 18px);
}
.typed-line .caret {
  display: inline-block; width: 10px; height: 1.1em; margin-left: 2px;
  background: var(--lime); vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-orb {
  position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; z-index: 1;
  animation: drift 14s ease-in-out infinite alternate;
}
.hero-orb.one { width: 320px; height: 320px; background: #6d4aff; top: 10%; left: -80px; }
.hero-orb.two { width: 260px; height: 260px; background: #0891b2; bottom: 5%; right: -60px; animation-delay: -6s; }
@keyframes drift { to { transform: translate(60px, -40px) scale(1.15); } }

/* ---------- Buttons ---------- */
.custom-btn {
  background: var(--grad);
  color: #0a0e1c;
  border: 0;
  font-family: var(--title-font-family);
  padding: 12px 26px;
  box-shadow: 0 8px 30px rgba(139, 108, 255, 0.35);
}
.custom-btn:hover { color: #0a0e1c; transform: translateY(-2px); box-shadow: 0 12px 40px rgba(34, 211, 238, 0.4); }
.custom-border-btn {
  background: transparent; color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: none;
}
.custom-border-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); border-color: var(--cyan); }

/* ---------- Stats strip ---------- */
.stats-section { margin-top: -70px; position: relative; z-index: 3; }
.stat-card {
  background: rgba(16, 22, 42, 0.85);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 24px;
  height: 100%;
  backdrop-filter: blur(10px);
}
.stat-card .stat-from { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.stat-card .stat-num { font-family: var(--mono); font-size: 40px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: 15px; margin: 6px 0 0; }

/* ---------- Glass cards ---------- */
.glass-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 28px;
  height: 100%;
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 108, 255, 0.55);
  box-shadow: 0 18px 50px rgba(139, 108, 255, 0.18);
}
.glass-card .card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  background: rgba(139, 108, 255, 0.15); color: var(--violet); margin-bottom: 18px;
}
.glass-card.cyan .card-icon { background: rgba(34, 211, 238, 0.13); color: var(--cyan); }
.glass-card.lime .card-icon { background: rgba(163, 230, 53, 0.12); color: var(--lime); }
.glass-card h5 { margin-bottom: 10px; }
.glass-card p { font-size: 16px; }
.glass-card a.stretched { color: inherit; text-decoration: none; }

/* ---------- Section headings ---------- */
.section-kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 10px; display: block;
}
.section-lead { max-width: 720px; margin: 0 auto 10px; }

/* ---------- Era tabs (index) ---------- */
.nav-tabs { border-bottom: 1px solid rgba(255, 255, 255, 0.08); flex-wrap: wrap; }
.nav-tabs .nav-link {
  color: var(--muted); background: transparent; font-family: var(--mono); font-size: 18px;
}
.nav-tabs .nav-link.active, .nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus {
  color: var(--text); background: transparent; border-bottom: 2px solid var(--cyan);
}
.tab-content { background: transparent; }

.model-chip {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  padding: 3px 10px; border-radius: 100px; margin: 0 6px 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.15); color: var(--muted);
}
.model-chip.tier-phone { border-color: rgba(244, 114, 182, .5); color: var(--pink); }
.model-chip.tier-laptop { border-color: rgba(34, 211, 238, .5); color: var(--cyan); }
.model-chip.tier-gpu { border-color: rgba(163, 230, 53, .5); color: var(--lime); }
.score-line { font-family: var(--mono); font-size: 14px; color: var(--amber); margin-top: 12px; }

/* ---------- Timeline (template component, re-skinned) ---------- */
.timeline-section { background: var(--bg-2); }
.timeline-section .section-overlay { opacity: .35; }
.vertical-scrollable-timeline li .icon-holder { background: var(--bg-2); border-color: var(--violet); color: var(--cyan); }
.vertical-scrollable-timeline li.active .icon-holder { background: var(--grad); color: #0a0e1c; }
.vertical-scrollable-timeline .list-progress .inner { background: var(--grad); }
.vertical-scrollable-timeline li p { color: #c9cff0; }
.timeline-year { font-family: var(--mono); color: var(--cyan); font-size: 15px; display: block; margin-bottom: 6px; }

/* ---------- FAQ accordion ---------- */
.accordion-item { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.08) !important; border-radius: 16px !important; margin-bottom: 14px; overflow: hidden; }
.accordion-button { background: transparent; color: var(--text); font-family: var(--title-font-family); font-size: 19px; box-shadow: none !important; }
.accordion-button:not(.collapsed) { background: rgba(139, 108, 255, 0.12); color: var(--text); }
.accordion-button::after { filter: invert(1); }
.accordion-body { color: var(--muted); font-size: 16px; }
.faq-section { background: transparent; }

/* ---------- Inner page header ---------- */
.site-header {
  position: relative; overflow: hidden;
  background-image: url("../images/neural-grid.svg"), linear-gradient(160deg, #120d2e 0%, #1d1554 55%, #0b3a4a 100%);
  background-size: cover;
  padding-top: 170px; padding-bottom: 90px;
}
.site-header h1 { font-size: clamp(34px, 5vw, 56px); }
.site-header p { color: #c9cff0; max-width: 680px; }
.breadcrumb-item a { color: var(--cyan); }
.breadcrumb-item.active, .breadcrumb-item+.breadcrumb-item::before { color: #c9cff0; }

/* ---------- Leader table (timeline.html) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.filter-btn {
  font-family: var(--mono); font-size: 14px; padding: 8px 18px; border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: transparent; color: var(--muted); transition: all .25s;
}
.filter-btn:hover { color: var(--text); border-color: var(--cyan); }
.filter-btn.active { background: var(--grad); color: #0a0e1c; border-color: transparent; }

.leader-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 22px; align-items: start;
  padding: 22px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}
.leader-q { font-family: var(--mono); font-size: 18px; color: var(--cyan); padding-top: 4px; }
.leader-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.leader-pick { background: var(--surface); border-radius: 12px; padding: 12px 14px; border-left: 3px solid var(--violet); }
.leader-pick small { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.leader-pick span { color: var(--text); font-weight: 600; font-size: 15px; }
.leader-pick.phone { border-left-color: var(--pink); }
.leader-pick.laptop { border-left-color: var(--cyan); }
.leader-pick.gpu { border-left-color: var(--lime); }
.leader-pick.dim { opacity: .25; }
.leader-note { grid-column: 2; font-size: 15px; margin: 4px 0 0; }

/* ---------- Model catalogue (models.html) ---------- */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-strong); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px; padding: 6px 8px 6px 20px; max-width: 560px; margin: 0 auto 22px;
}
.search-box i { color: var(--muted); }
.search-box input {
  flex: 1; background: transparent; border: 0; outline: 0; color: var(--text);
  font-size: 16px; padding: 8px 0; min-width: 0;
}
.search-box input::placeholder { color: #6b7399; }
.model-card .model-date { font-family: var(--mono); font-size: 13px; color: var(--cyan); }
.model-card .model-maker { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.model-card .model-meta { font-family: var(--mono); font-size: 13px; color: #8e97c4; margin-top: 10px; }
.model-card { display: flex; flex-direction: column; }
.empty-state { text-align: center; padding: 40px; display: none; }

/* ---------- Charts ---------- */
.chart-card { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 20px; padding: 26px; }
.chart-card h4 { font-size: 22px; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-axis { stroke: rgba(255, 255, 255, 0.15); }
.chart-grid { stroke: rgba(255, 255, 255, 0.06); }
.chart-tick { fill: #7c86b5; font-family: var(--mono); font-size: 11px; }
.chart-line { fill: none; stroke: url(#lineGrad); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaGrad); }
.chart-dot { fill: var(--bg); stroke: var(--cyan); stroke-width: 2.5; cursor: pointer; transition: r .2s; }
.chart-dot:hover, .chart-dot.on { r: 8; fill: var(--cyan); }
.chart-ref { stroke: var(--amber); stroke-dasharray: 5 6; stroke-width: 1.5; }
.chart-ref-label { fill: var(--amber); font-family: var(--mono); font-size: 11px; }
.chart-label { fill: #d6dbff; font-size: 11px; font-family: var(--body-font-family); }
.chart-tooltip {
  position: absolute; pointer-events: none; background: #161d38; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--text); white-space: nowrap;
  transform: translate(-50%, -120%); opacity: 0; transition: opacity .15s;
}
.chart-tooltip b { font-family: var(--mono); color: var(--cyan); }
.chart-note { font-size: 14px; margin-top: 12px; }

.bars-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.bars-legend span { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.bars-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bar-group { margin-bottom: 18px; }
.bar-group h6 { font-size: 15px; margin-bottom: 8px; color: var(--text); }
.bar-row { display: grid; grid-template-columns: 1fr 52px; gap: 10px; align-items: center; margin-bottom: 5px; }
.bar-track { height: 12px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 6px; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.bar-val { font-family: var(--mono); font-size: 13px; color: var(--text); text-align: right; }

/* ---------- Coding leaderboard ---------- */
.lb-what { text-align: center; font-size: 15px; max-width: 640px; margin: -14px auto 22px; }
.lb-row { display: grid; grid-template-columns: 34px minmax(150px, 1.1fr) 2fr 52px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.lb-rank { font-family: var(--mono); color: var(--cyan); text-align: center; font-size: 15px; }
.lb-name { color: var(--text); font-weight: 600; font-size: 15px; line-height: 1.25; }
.lb-name em { display: block; font-style: normal; font-weight: 400; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lb-track { height: 14px; background: rgba(255, 255, 255, 0.05); border-radius: 7px; overflow: hidden; }
.lb-fill { display: block; height: 100%; width: 0; border-radius: 7px; background: var(--grad); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.lb-val { font-family: var(--mono); color: var(--text); text-align: right; font-size: 14px; }
.lb-row.cloud .lb-fill { background: repeating-linear-gradient(135deg, rgba(251, 191, 36, .75) 0 6px, rgba(251, 191, 36, .45) 6px 12px); }
.lb-row.cloud .lb-rank, .lb-row.cloud .lb-name em { color: var(--amber); }
@media screen and (max-width: 575px) {
  .lb-row { grid-template-columns: 26px 1fr 48px; }
  .lb-track { grid-column: 2 / 4; grid-row: 2; }
}

/* ---------- Spec table (latest.html / benchmarks.html) ---------- */
.spec-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.spec-table th, .spec-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); color: var(--muted); vertical-align: top; }
.spec-table th { color: var(--text); font-family: var(--title-font-family); font-weight: 600; background: rgba(139, 108, 255, 0.08); }
.spec-table td:first-child { color: var(--text); }
.spec-table .win { color: var(--lime); font-weight: 600; }
.table-scroll { overflow-x: auto; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.08); }

.callout {
  border-left: 3px solid var(--amber); background: rgba(251, 191, 36, 0.06);
  padding: 16px 20px; border-radius: 0 12px 12px 0; font-size: 15px;
}
.callout p { margin: 0; font-size: 15px; }

.vs-badge {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--grad); color: #0a0e1c; font-family: var(--mono); font-weight: 700; font-size: 20px;
}

/* ---------- Sources list ---------- */
.source-list { list-style: none; padding: 0; counter-reset: src; }
.source-list li { counter-increment: src; padding: 10px 0 10px 44px; position: relative; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 15px; }
.source-list li::before {
  content: counter(src); position: absolute; left: 0; top: 10px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 12px; background: rgba(139, 108, 255, 0.15); color: var(--violet);
}
.source-list a { word-break: break-word; }

/* ---------- Social links ---------- */
.social-links { display: flex; gap: 12px; flex-wrap: wrap; padding: 0; list-style: none; }
.social-links a {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: var(--surface-strong); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.1); transition: all .25s;
}
.social-links a:hover { background: var(--grad); color: #0a0e1c; transform: translateY(-3px); }

/* ---------- Footer ---------- */
.site-footer { background: #070a15; border-top: 1px solid rgba(255, 255, 255, 0.06); border-bottom: 4px solid transparent; border-image: var(--grad) 1; overflow: hidden; }
.site-footer::after { border-width: 0 0 140px 140px; border-color: transparent transparent rgba(139, 108, 255, 0.18) transparent; }
.site-footer-title { color: var(--text); }
.site-footer-link { color: var(--muted); }
.site-footer-link:hover { color: var(--cyan); }
.copyright-text { color: #6b7399; font-size: 14px; }

/* ---------- Back to top ---------- */
#backToTop {
  position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 14px; border: 0;
  background: var(--grad); color: #0a0e1c; font-size: 22px; z-index: 50;
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: all .3s;
}
#backToTop.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .1s; }
.reveal.delay-2 { transition-delay: .2s; }
.reveal.delay-3 { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-orb, .typed-line .caret { animation: none; }
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 991px) {
  .navbar, .sticky-wrapper.is-sticky .navbar { background-color: rgba(10, 14, 28, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .navbar-collapse { background: rgba(10, 14, 28, 0.97); border-radius: 16px; padding: 10px; margin-top: 10px; }
  .leader-picks { grid-template-columns: 1fr; }
  .stats-section { margin-top: -40px; }
}
@media screen and (max-width: 575px) {
  .hero-section .input-group-text { display: none; }
  .hero-section input[type="search"] { padding-left: 18px; font-size: 16px; }
  .hero-section button[type="submit"] { flex: 0 0 auto; width: auto; padding: 0 18px; font-size: 15px; }
  .hero-section { padding-top: 120px; min-height: auto; }
  .leader-row { grid-template-columns: 1fr; gap: 10px; }
  .leader-note { grid-column: 1; }
  .glass-card, .chart-card { padding: 20px; }
  .stat-card .stat-num { font-size: 32px; }
  .section-padding { padding-top: 70px; padding-bottom: 70px; }
}
