/* ===========================================================
   bank2excel — Blog stylesheet
   Editorial paper-and-ink aesthetic, matching the landing.
   =========================================================== */

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

:root {
  --paper:        #f4f1ea;
  --paper-deep:   #ece8dc;
  --card:         #ffffff;
  --ink:          #161412;
  --ink-soft:     #3a3630;
  --muted:        #807a6c;
  --line:         #d9d3c4;
  --line-soft:    #e8e3d4;
  --accent:       #2d6a4a;
  --accent-deep:  #1f4a33;
  --accent-soft:  #d8e6dd;
  --accent-tint:  #eef4f0;
  --shadow-sm:    0 1px 0 rgba(20,18,15,.04);
  --shadow-md:    0 1px 2px rgba(20,18,15,.04), 0 6px 18px -10px rgba(20,18,15,.16);
  --shadow-lg:    0 1px 2px rgba(20,18,15,.04), 0 16px 40px -18px rgba(45,106,74,.28);
  --sans:         -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --serif:        ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  --mono:         ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --content-width: 760px;
  --page-width:   1120px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: var(--accent-deep); }
a:hover { color: var(--accent); }

/* ---- NAV ---- */
.blog-nav {
  position: sticky; top: 0; z-index: 100;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-logo {
  font-size: 1.05rem; font-weight: 700;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-logo .nav-logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent); color: var(--paper);
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.nav-logo .kz { color: var(--muted); font-weight: 500; }
.nav-links {
  display: flex; gap: 22px; list-style: none;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.04em; text-transform: lowercase;
}
.nav-links a {
  color: var(--ink-soft); text-decoration: none;
  padding: 6px 0; border-bottom: 1.5px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-links a:hover { color: var(--accent-deep); }
.nav-links a.active { color: var(--accent-deep); border-bottom-color: var(--accent); }
.nav-hamburger {
  display: none;
  background: none; border: 0; padding: 8px;
  cursor: pointer; flex-direction: column; gap: 4px;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 720px) {
  .blog-nav { padding: 12px 18px; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line-soft);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--line-soft); }
  .nav-links a { display: block; padding: 14px 24px; }
  .nav-hamburger { display: inline-flex; }
}

/* ---- BREADCRUMBS ---- */
.breadcrumbs {
  max-width: var(--content-width);
  margin: 0 auto; padding: 28px 24px 0;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: 0.02em;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-deep); }
.breadcrumbs .sep { margin: 0 8px; color: var(--line); }

/* ---- BLOG HERO (index) ---- */
.blog-hero {
  max-width: var(--page-width);
  margin: 0 auto; padding: 64px 24px 36px;
  text-align: left;
}
.blog-hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.06;
  color: var(--ink);
}
.blog-hero h1 .gradient-text {
  background: linear-gradient(95deg, var(--accent-deep) 0%, var(--accent) 60%, #5a8d6c 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.blog-hero .subtitle {
  margin-top: 14px;
  font-size: 16px; color: var(--ink-soft); max-width: 60ch;
}

/* ---- ARTICLE GRID (index) ---- */
.articles-grid {
  max-width: var(--page-width);
  margin: 0 auto; padding: 16px 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.article-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 20px 22px 22px;
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s, border-color .2s;
  min-height: 200px;
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.card-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.04em; text-transform: lowercase; color: var(--muted);
  margin-bottom: 12px;
}
.card-tag {
  background: var(--accent-tint);
  color: var(--accent-deep);
  border: 1px solid var(--accent-soft);
  padding: 3px 8px; border-radius: 999px;
  text-transform: lowercase;
}
.article-card h2,
.article-card h3 {
  font-family: var(--serif);
  font-size: 20px; font-weight: 600; line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.article-card .excerpt {
  margin-top: 10px;
  font-size: 14.5px; color: var(--ink-soft); flex: 1;
}
.card-footer {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.read-more {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-deep);
}
.read-more svg { width: 14px; height: 14px; }
.reading-time { color: var(--muted); }

/* ---- ARTICLE PAGE ---- */
article {
  max-width: var(--content-width);
  margin: 0 auto; padding: 24px 24px 48px;
}
.article-header {
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 28px;
}
.article-header .tag {
  display: inline-block;
  background: var(--accent-tint);
  color: var(--accent-deep);
  border: 1px solid var(--accent-soft);
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: lowercase;
  margin-bottom: 16px;
}
.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4.6vw, 44px);
  font-weight: 600; line-height: 1.12; letter-spacing: -0.02em;
  color: var(--ink);
}
.article-meta {
  margin-top: 14px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.article-meta .dot {
  display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: var(--line); margin: 0 4px;
}

.article-content { font-size: 16.5px; color: var(--ink-soft); }
.article-content p { margin-bottom: 1.1em; }
.article-content p:last-child { margin-bottom: 0; }
.article-content strong, .article-content b { color: var(--ink); font-weight: 600; }
.article-content a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article-content a:hover { color: var(--accent); }

.article-content h2 {
  font-family: var(--serif); color: var(--ink);
  font-size: 26px; font-weight: 600; line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 36px 0 14px;
  padding-top: 4px;
}
.article-content h3 {
  font-family: var(--serif); color: var(--ink);
  font-size: 20px; font-weight: 600; line-height: 1.25;
  margin: 24px 0 8px;
}
.article-content ul, .article-content ol { margin: 0 0 1.1em 1.4em; }
.article-content li { margin-bottom: 0.4em; }

.article-content code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--paper-deep); color: var(--ink);
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line-soft);
}

.article-content blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  color: var(--ink-soft);
  border-radius: 0 8px 8px 0;
}

.steps-list {
  margin: 16px 0 24px 0;
  list-style: none; counter-reset: step;
  padding: 0;
}
.steps-list li {
  counter-increment: step;
  padding: 10px 14px 10px 46px;
  border-left: 2px solid var(--line-soft);
  position: relative;
  margin-bottom: 6px;
}
.steps-list li::before {
  content: counter(step);
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--paper);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.info-box {
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.info-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-deep);
  margin-bottom: 6px;
}
.highlight-box {
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
  color: var(--ink);
}

.table-wrap { overflow-x: auto; margin: 18px 0 22px; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14.5px;
}
.comparison-table th, .comparison-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.comparison-table th {
  background: var(--paper-deep);
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.03em; text-transform: lowercase;
  color: var(--ink);
  font-weight: 600;
}
.comparison-table tr:last-child td { border-bottom: 0; }
.comparison-table tr:hover td { background: var(--accent-tint); }

/* ---- CTA SECTION ---- */
.article-cta {
  max-width: var(--content-width);
  margin: 0 auto 56px; padding: 0 24px;
}
.cta-box {
  background: var(--accent-deep);
  background-image: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
  color: var(--paper);
  padding: 32px 28px;
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta-box h3 {
  font-family: var(--serif);
  font-size: 28px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 8px; line-height: 1.2;
  color: var(--paper);
}
.cta-box .gradient-text {
  background: linear-gradient(90deg, #ffe6b0 0%, #fff5dc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cta-box p {
  margin-bottom: 18px;
  color: rgba(244, 241, 234, 0.85);
  font-size: 15px;
}
.cta-box .btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--paper);
  color: var(--accent-deep);
  border-radius: 999px;
  font-weight: 600; text-decoration: none;
  font-size: 15px;
  transition: transform .15s, box-shadow .2s;
}
.cta-box .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.3);
  color: var(--accent-deep);
}

/* ---- RELATED ARTICLES ---- */
.related-section {
  max-width: var(--page-width);
  margin: 0 auto 56px; padding: 0 24px;
}
.related-section > h2 {
  font-family: var(--serif);
  font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 18px;
  color: var(--ink);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.related-grid .article-card { padding: 18px; min-height: 0; }
.related-grid .article-card h3 { font-size: 17px; }

/* ---- FOOTER ---- */
.blog-footer {
  border-top: 1px solid var(--line-soft);
  padding: 28px 24px 36px;
  background: var(--paper-deep);
}
.footer-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: 0.02em;
}
.footer-copy { color: var(--ink-soft); }
.footer-links {
  list-style: none; display: flex; flex-wrap: wrap; gap: 18px;
}
.footer-links a {
  color: var(--ink-soft); text-decoration: none;
}
.footer-links a:hover { color: var(--accent-deep); }
.footer-projects {
  font-family: var(--sans);
  margin-top: 10px;
  padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.footer-projects a { color: var(--accent-deep); text-decoration: underline; }

/* ---- FADE-IN ---- */
.fade-in {
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
