/* ================================
   FINWISE — Premium Finance Editorial
   ================================ */

:root {
  --ink: #0a0a0a;
  --ink-light: #3a3a3a;
  --ink-muted: #888;
  --paper: #faf8f4;
  --white: #ffffff;
  --gold: #c9a84c;
  --gold-light: #f0e6cc;
  --gold-dark: #9a7a2e;
  --green: #1a6b45;
  --green-light: #e8f4ef;
  --red: #c0392b;
  --border: #e8e4dc;
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.14);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 4px;
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===================== NAV ===================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,248,244,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 40px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-light);
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--gold-light);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  padding: 80px 24px 0;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: -100px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--gold-light) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: var(--green-light);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
  max-width: 700px;
  margin-bottom: 20px;
}

.hero-content h1 em {
  font-style: italic;
  color: var(--gold-dark);
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--ink-light);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 40px 0 0;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-dark);
  letter-spacing: -1px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  margin: 0 40px 0 0;
}

/* ===================== ADS ===================== */
.ad-container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
  text-align: center;
}

.ad-leaderboard { margin: 16px auto 0; }

.ad-label {
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ad-placeholder {
  background: var(--border);
  border: 1px dashed #ccc;
  color: var(--ink-muted);
  padding: 20px;
  font-size: 0.85rem;
  border-radius: var(--radius);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== SECTIONS ===================== */
.section-header {
  margin-bottom: 40px;
}

.section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  display: block;
  margin-bottom: 8px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
}

.section-sub {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ===================== FEATURED ===================== */
.featured {
  padding: 60px 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gold-light);
}

.article-card.featured-main {
  grid-row: 1 / 3;
}

.card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  min-height: 180px;
}

.article-card.featured-main .card-image { aspect-ratio: 4/3; }
.article-card.featured-main .card-image-placeholder { min-height: 280px; }

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--ink);
}

.article-card.featured-main .card-title { font-size: 1.5rem; }
.article-card:not(.featured-main) .card-title { font-size: 1.05rem; }

.card-excerpt {
  font-size: 0.875rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-read-time::before { content: "⏱ "; }

/* ===================== CATEGORIES ===================== */
.categories {
  background: var(--ink);
  padding: 80px 0;
  margin: 20px 0;
}

.categories .section-tag { color: var(--gold); }
.categories .section-header h2 { color: var(--white); }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: var(--transition);
  display: block;
}

.cat-card:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.cat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.cat-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.cat-card p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin-bottom: 16px;
}

.cat-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===================== LATEST ===================== */
.latest { padding: 60px 0; }

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.load-more-wrap { text-align: center; }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--white);
}

/* ===================== TOOLS ===================== */
.tools-section {
  background: var(--gold-light);
  padding: 80px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.tool-logo {
  font-size: 1.8rem;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--gold-dark);
  margin-bottom: 12px;
  height: 48px;
  display: flex;
  align-items: center;
}

.tool-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tool-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  border-bottom: 1px solid var(--green);
  transition: var(--transition);
}

.tool-link:hover { color: var(--gold-dark); border-color: var(--gold-dark); }

/* ===================== EMAIL ===================== */
.email-section { padding: 80px 0; }

.email-box {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.email-box::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.1;
}

.email-box h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.email-box p {
  color: rgba(255,255,255,0.65);
  margin-bottom: 32px;
  font-size: 1rem;
}

.email-form {
  display: flex;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto 16px;
}

.email-form input {
  flex: 1;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
}

.email-form button {
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  transition: var(--transition);
}

.email-form button:hover { background: var(--gold-dark); color: var(--white); }

.email-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
}

/* ===================== FOOTER ===================== */
.footer {
  background: #0a0a0a;
  padding: 60px 0 32px;
  color: rgba(255,255,255,0.6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo { margin-bottom: 16px; display: block; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; max-width: 300px; }
.disclaimer { font-size: 0.75rem; color: rgba(255,255,255,0.3); margin-top: 16px !important; }

.footer-links h4 {
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-links ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  font-size: 0.875rem;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

/* ===================== ARTICLE PAGE ===================== */
.article-hero {
  max-width: 800px;
  margin: 48px auto 0;
  padding: 0 24px;
}

.article-hero .card-tag { font-size: 0.8rem; }

.article-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin: 16px 0 20px;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.article-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-light);
  margin-bottom: 24px;
}

.article-content h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--ink);
  margin: 48px 0 16px;
  letter-spacing: -0.5px;
}

.article-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin: 32px 0 12px;
}

.article-content ul, .article-content ol {
  margin: 0 0 24px 24px;
  list-style: disc;
}

.article-content ol { list-style: decimal; }

.article-content li {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin-bottom: 8px;
}

.article-content strong { color: var(--ink); font-weight: 600; }

.article-content blockquote {
  border-left: 4px solid var(--gold);
  padding: 16px 24px;
  margin: 32px 0;
  background: var(--gold-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-content blockquote p {
  color: var(--ink);
  font-style: italic;
  font-size: 1.1rem;
  margin: 0;
}

.article-ad {
  margin: 40px 0;
  text-align: center;
}

.key-takeaway {
  background: var(--green-light);
  border: 1px solid #a8d5bc;
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
}

.key-takeaway h4 {
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .article-card.featured-main { grid-column: 1 / 3; grid-row: auto; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .hero { padding: 40px 24px 0; }
  .hero-stats { flex-direction: column; align-items: flex-start; gap: 20px; }
  .stat-divider { display: none; }
  .stat { padding: 0; }
  .featured-grid { grid-template-columns: 1fr; }
  .article-card.featured-main { grid-column: auto; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .latest-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .email-box { padding: 40px 24px; }
  .email-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content { animation: fadeUp 0.6s ease both; }
.hero-stats { animation: fadeUp 0.6s ease 0.2s both; }

.article-card, .cat-card, .tool-card {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s ease forwards;
}
