:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --ink: #16182b;
  --muted: #5c607a;
  --line: #e4e6f0;
  --brand: #4f46e5;
  --brand-2: #8b5cf6;
  --chip: #eef0ff;
  --radius: 14px;
  --maxw: 1120px;
  font-size: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--ink);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center;
  font-size: .85rem; font-weight: 800;
}
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: var(--muted); font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav a.active { color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.15; letter-spacing: -0.03em; font-weight: 800;
  max-width: 820px; margin: 0 auto 16px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 28px; font-size: 1.08rem; }

.searchbar {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 18px;
  box-shadow: 0 6px 24px rgba(79,70,229,.08);
}
.searchbar svg { flex: none; color: var(--muted); }
.searchbar input {
  flex: 1; border: 0; outline: 0; font-size: 1rem; background: transparent; color: var(--ink);
}

/* ---------- Chips / filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  padding: 26px 0 8px;
}
.chip {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-weight: 600; font-size: .88rem;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
}

/* ---------- Cards ---------- */
.section { padding: 40px 0 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: 1.55rem; letter-spacing: -0.02em; }
.section-head a { font-weight: 600; font-size: .95rem; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(22,24,43,.08); }
.card-top { display: flex; align-items: center; gap: 12px; }
.tile {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; color: #fff;
}
.card h3 { font-size: 1.04rem; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: .92rem; flex: 1; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: .74rem; font-weight: 700; letter-spacing: .02em;
  background: var(--chip); color: var(--brand); border-radius: 6px; padding: 3px 8px;
}
.badge.price { background: #ecfdf3; color: #067647; }
.badge.price.paid { background: #fff1f0; color: #b42318; }
.card a.visit {
  font-weight: 700; font-size: .9rem; color: var(--brand);
  display: inline-flex; align-items: center; gap: 4px;
}

/* ---------- Article list ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.post-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.post-card .meta { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.post-card h3 a { color: var(--ink); font-size: 1.12rem; line-height: 1.35; display: block; }
.post-card h3 a:hover { color: var(--brand); text-decoration: none; }
.post-card p { color: var(--muted); font-size: .92rem; flex: 1; }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 28px auto; max-width: var(--maxw); padding: 0 20px; }
.ad-frame {
  border: 1px dashed var(--line); border-radius: 12px;
  background: var(--surface); min-height: 90px;
  display: grid; place-items: center; overflow: hidden;
}
.ad-label { font-size: .72rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; text-align: center; }

/* ---------- Article body ---------- */
.article { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
.article .meta { color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 12px; }
.article h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1.2; letter-spacing: -0.025em; margin-bottom: 20px; }
.article h2 { font-size: 1.35rem; margin: 34px 0 12px; letter-spacing: -0.02em; }
.article h3 { font-size: 1.12rem; margin: 26px 0 10px; }
.article p { margin-bottom: 16px; color: #2c2f45; }
.article ul, .article ol { margin: 0 0 16px 22px; color: #2c2f45; }
.article li { margin-bottom: 8px; }
.article .takeaway {
  background: var(--chip); border-left: 4px solid var(--brand);
  border-radius: 0 10px 10px 0; padding: 16px 18px; margin: 22px 0;
  font-size: .96rem;
}
.article table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: .92rem; }
.article th, .article td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article th { background: var(--surface); font-weight: 700; }
.article .in-ad { margin: 30px 0; padding: 0; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 22px; }

/* ---------- Simple page ---------- */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
.page-wrap h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 18px; }
.page-wrap h2 { font-size: 1.2rem; margin: 26px 0 10px; }
.page-wrap p { margin-bottom: 14px; color: #2c2f45; }
.page-wrap ul { margin: 0 0 16px 22px; }
.page-wrap li { margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 40px 0 28px; margin-top: 20px;
}
.footer-cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--muted); font-size: .9rem; margin-top: 10px; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-links h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.footer-links a { display: block; color: var(--ink); font-size: .92rem; margin-bottom: 8px; }
.footer-note { color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- Misc ---------- */
.no-results { text-align: center; color: var(--muted); padding: 40px 0; display: none; }
.empty-state { display: none; }

@media (max-width: 720px) {
  .main-nav { gap: 14px; font-size: .9rem; }
  .hero { padding: 44px 0 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 520px) {
  .main-nav a.hide-sm { display: none; }
}
