:root {
  --blue: #1a56db;
  --blue-dark: #123a9a;
  --yellow: #f59e0b;
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --line: #e2e8f0;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --font: "Outfit", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(26, 86, 219, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(245, 158, 11, 0.12), transparent 55%),
    linear-gradient(180deg, #eef3fb 0%, var(--bg) 28%, #fff 100%);
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; height: auto; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff; padding: .5rem 1rem; z-index: 9999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: box-shadow .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.site-header .navbar { padding: .7rem 0; }
.site-header .nav-link { color: rgba(255,255,255,.82) !important; font-weight: 500; }
.site-header .nav-link.active,
.site-header .nav-link:hover { color: #fff !important; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff !important; font-weight: 700; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  color: #fff; font-weight: 800;
  box-shadow: 0 8px 20px rgba(26,86,219,.35);
}
.brand-text { letter-spacing: -.02em; }
.btn-search {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff;
}
.navbar-toggler { border-color: rgba(255,255,255,.25); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.hero {
  position: relative; overflow: hidden;
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  color: #fff;
  padding: 4rem 0 3rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, rgba(10, 22, 54, .92) 0%, rgba(18, 58, 154, .78) 48%, rgba(15, 23, 42, .88) 100%),
    url('../img/hero-pattern.svg') center/cover;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; gap: 2rem;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
}
.hero-eyebrow {
  display: inline-block; margin-bottom: .75rem;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--yellow); font-size: .85rem;
}
.hero-title {
  font-size: clamp(2.1rem, 4.5vw, 3.6rem);
  line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin-bottom: 1rem;
}
.hero-lead { color: rgba(255,255,255,.82); font-size: 1.1rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn-primary {
  --bs-btn-bg: var(--blue); --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: var(--blue-dark); --bs-btn-hover-border-color: var(--blue-dark);
}
.hero-feature {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px; overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.hero-feature-link { color: inherit; display: block; }
.hero-feature-media { aspect-ratio: 16/10; overflow: hidden; background: rgba(0,0,0,.25); }
.hero-feature-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.hero-feature:hover .hero-feature-media img { transform: scale(1.04); }
.hero-feature-body { padding: 1.25rem 1.35rem 1.5rem; }
.hero-feature-body h2 { font-size: 1.25rem; margin: .5rem 0; color: #fff; }
.hero-feature-body p { color: rgba(255,255,255,.75); margin: 0; }

.badge-cat {
  display: inline-flex; align-items: center;
  background: rgba(26,86,219,.1); color: var(--blue);
  font-size: .75rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px;
}
.hero .badge-cat { background: rgba(245,158,11,.18); color: #fcd34d; }

.section { padding: 4rem 0; }
.section-alt { background: rgba(255,255,255,.55); border-block: 1px solid var(--line); }
.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: 1rem;
  margin-bottom: 1.75rem; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-weight: 750; letter-spacing: -.02em; }
.section-head p { margin: .35rem 0 0; color: var(--muted); width: 100%; }
.section-link { font-weight: 600; }

.post-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.35rem;
}
.post-grid.related { grid-template-columns: repeat(2, 1fr); }
.post-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card-media { display: block; aspect-ratio: 16/10; overflow: hidden; background: #dbe4f5; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 1.1rem 1.15rem 1.25rem; }
.post-card-body h3 { font-size: 1.05rem; margin: .55rem 0 .4rem; line-height: 1.35; }
.post-card-body h3 a { color: var(--ink); }
.post-card-body p { color: var(--muted); font-size: .92rem; margin: 0; }
.post-meta { display: flex; gap: .75rem; align-items: center; color: var(--muted); font-size: .8rem; }

.thumb-fallback {
  width: 100%; height: 100%; min-height: 160px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1a56db, #0f172a);
  color: #fff; font-size: 2.5rem; font-weight: 800;
}

.stack-list { display: grid; gap: .85rem; }
.stack-item {
  display: block; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); transition: border-color .2s ease, transform .2s ease;
}
.stack-item:hover { border-color: #bfdbfe; transform: translateX(4px); color: var(--ink); }
.stack-meta { display: block; color: var(--muted); font-size: .8rem; margin-bottom: .25rem; }

.popular-list { display: grid; gap: .75rem; }
.popular-item {
  display: flex; gap: 1rem; align-items: start; padding: .9rem 0;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.popular-item:last-child { border-bottom: 0; }
.popular-rank {
  font-weight: 800; font-size: 1.25rem; color: var(--yellow); line-height: 1; min-width: 2rem;
}
.popular-item small { display: block; color: var(--muted); margin-top: .2rem; }
.popular-list.compact .popular-item { padding: .65rem 0; }

.side-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.side-panel h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.sticky-side { position: sticky; top: 90px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-cloud a {
  background: #eff6ff; color: var(--blue); border-radius: 999px;
  padding: .35rem .7rem; font-size: .85rem; font-weight: 600;
}
.newsletter { border-top: 1px solid var(--line); padding-top: 1rem; }
.newsletter p { color: var(--muted); font-size: .92rem; }

.page-hero { padding: 2.5rem 0 1rem; }
.page-hero h1 { font-weight: 800; letter-spacing: -.02em; }
.lead-muted { color: var(--muted); max-width: 40rem; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); }
.breadcrumb a { color: var(--muted); }

.article-hero h1 { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-top: .75rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .85rem 1.25rem; color: var(--muted); margin-top: 1rem; }
.container.narrow { max-width: 860px; }
.article-thumb { margin: 0 0 1.75rem; border-radius: 20px; overflow: hidden; }
.article-thumb img { width: 100%; display: block; }
.article-content {
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.8; color: #1e293b;
}
.article-content h2, .article-content h3 { font-family: var(--font); margin-top: 1.75rem; }
.article-content img { border-radius: 12px; }
.article-content pre {
  background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 12px; overflow: auto;
}
.article-content blockquote {
  border-left: 4px solid var(--yellow); margin: 1.5rem 0; padding: .25rem 0 .25rem 1rem;
  color: var(--muted); font-style: italic;
}
.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0 1rem; }
.article-tags a {
  background: #fff7ed; color: #b45309; padding: .35rem .7rem; border-radius: 999px; font-weight: 600; font-size: .85rem;
}
.share-row { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0; }
.share-row a {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: #eff6ff; color: var(--blue);
}
.adjacent-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0;
}
.adj {
  display: block; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
}
.adj.next { text-align: right; }
.adj small { color: var(--muted); display: block; margin-bottom: .25rem; }
.related-block, .comments-block { margin-top: 2.5rem; }
.comment-item { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-pending { opacity: .85; background: #fffbeb; border-radius: 12px; padding: 1rem; border: 1px dashed #f59e0b; margin-bottom: .75rem; }
.comment-form {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.comment-login-hint {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .85rem 1rem; background: #f8fafc; border-radius: 12px; border: 1px solid var(--line);
}
.search-page-form { max-width: 640px; margin-top: 1rem; }
.search-modal { border: 0; border-radius: 18px; }
.live-results a {
  display: block; padding: .75rem 0; border-bottom: 1px solid var(--line); color: var(--ink);
}
.live-results a small { display: block; color: var(--muted); }

.site-footer {
  margin-top: 3rem; background: #0b1224; color: rgba(255,255,255,.78); padding: 3.5rem 0 1.5rem;
}
.footer-brand { font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: .75rem; }
.footer-desc { max-width: 28rem; }
.footer-title { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer-links a { color: rgba(255,255,255,.75); }
.footer-links a:hover { color: #fff; }
.social-row { display: flex; gap: .65rem; }
.social-row a {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(255,255,255,.08); color: #fff;
}
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.08);
  font-size: .9rem; color: rgba(255,255,255,.55);
}

.back-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50;
  width: 44px; height: 44px; border: 0; border-radius: 14px;
  background: var(--blue); color: #fff; display: none; place-items: center;
  box-shadow: 0 12px 30px rgba(26,86,219,.35);
}
.back-top.show { display: grid; }

.reveal {
  opacity: 0; transform: translateY(18px);
  animation: rise .7s ease forwards;
}
.reveal.delay-1 { animation-delay: .12s; }
.reveal.delay-2 { animation-delay: .2s; }
.reveal.delay-3 { animation-delay: .28s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 991px) {
  .hero-inner { grid-template-columns: 1fr; }
  .post-grid, .post-grid.related { grid-template-columns: 1fr 1fr; }
  .sticky-side { position: static; }
}
@media (max-width: 640px) {
  .post-grid, .post-grid.related, .adjacent-nav { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 3rem; }
}

.btn-reader-login {
  background: var(--yellow); color: #111; border: 0; font-weight: 700;
  border-radius: 12px; padding: .45rem .9rem;
}
.btn-reader-login:hover { background: #d97706; color: #111; }
.reader-chip {
  display: inline-flex !important; align-items: center; gap: .45rem;
  background: rgba(255,255,255,.08); border-radius: 999px; padding: .35rem .7rem !important;
}
.reader-login-card {
  max-width: 460px; margin: 0 auto; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 1.75rem; box-shadow: var(--shadow);
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  width: 100%; padding: .85rem 1rem; border-radius: 12px; font-weight: 650;
  background: #fff; border: 1px solid #dadce0; color: #3c4043; text-decoration: none;
}
.btn-google:hover { background: #f8faff; color: #1a73e8; border-color: #c6dafc; }
.tutorial-google .tutorial-step {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 1.25rem 1.4rem; margin-bottom: 1rem;
}
.tutorial-google h2 { font-size: 1.2rem; margin-bottom: .75rem; }
.tutorial-google pre {
  background: #0f172a; color: #e2e8f0; padding: .9rem 1rem; border-radius: 12px;
  overflow: auto; font-size: .9rem;
}
.tutorial-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

