/* Serene Trading Strategy - Editorial & Quantitative Financial Theme */
:root {
  --bg-primary: #0b111a;
  --bg-secondary: #111926;
  --bg-card: #162133;
  --bg-card-hover: #1d2b42;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --border-subtle: rgba(148, 163, 184, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-emerald: #059669;
  --accent-emerald-glow: rgba(5, 150, 105, 0.1);
  --accent-amber: #d97706;
  --border-subtle: rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 17, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .navbar {
  background-color: rgba(255, 255, 255, 0.88);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-emerald), #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--accent-emerald);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--accent-emerald);
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-card);
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top right, var(--accent-emerald-glow), transparent 55%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background-color: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 780px;
  margin-bottom: 1.15rem;
}

.hero p {
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 660px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.75rem;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item span {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-item small {
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* Sections */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.section-header h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* Filter Pills & Search */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
  align-items: center;
  justify-content: space-between;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill.active, .pill:hover {
  background: var(--accent-emerald);
  color: #fff;
  border-color: var(--accent-emerald);
}

.search-input {
  padding: 0.48rem 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.88rem;
  min-width: 240px;
}

/* Grid & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--bg-card-hover);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  background: var(--accent-emerald-glow);
  color: var(--accent-emerald);
}

.card h3 {
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 0.65rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

/* Video Embed Wrapper */
.video-box {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: #000;
}

.video-box iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Article Page Layout */
.article-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-header h1 {
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  line-height: 1.2;
  margin: 0.85rem 0 1rem;
}

.article-body h2 {
  font-size: 1.45rem;
  margin: 2.25rem 0 0.85rem;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
  font-size: 1.03rem;
}

.article-body ul {
  margin: 0 0 1.4rem 1.4rem;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 0.5rem;
}

.screener-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.92rem;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.screener-table th, .screener-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.screener-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.screener-table td code {
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  font-weight: 600;
}

.callout {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-emerald);
  padding: 1.15rem 1.35rem;
  border-radius: 0 8px 8px 0;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Footer & Disclaimer */
.footer {
  padding: 3rem 0;
  background: var(--bg-secondary);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.disclaimer-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.1rem 1.3rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
}
