:root {
  --ink: #071321;
  --navy: #0b1d30;
  --blue: #159cf5;
  --blue-2: #55b9fa;
  --steel: #647b91;
  --mist: #eaf2f8;
  --white: #fff;
  --line: rgba(7, 19, 33, .12);
  --radius: 24px;
  --shadow: 0 24px 70px rgba(8, 28, 48, .12);
}

* { box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f8fbfd; font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.shell { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 1000; padding: 10px 16px; border-radius: 8px; background: var(--white); }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(248, 251, 253, .94); backdrop-filter: blur(18px); }
.nav-wrap { width: min(1220px, calc(100% - 48px)); height: 88px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: .95rem; letter-spacing: .11em; }
.brand strong { font-weight: 900; }
.brand img { width: 46px; height: 46px; object-fit: contain; flex: 0 0 auto; }
nav { display: flex; align-items: center; gap: 24px; font-size: .94rem; font-weight: 700; }
nav a { transition: color .2s ease; }
nav a:hover, nav a[aria-current="page"] { color: #087cc6; }
.nav-cta { padding: 13px 21px; color: var(--white) !important; background: var(--ink); border-radius: 999px; }
.menu-toggle { display: none; width: 48px; height: 48px; border: 0; border-radius: 12px; background: var(--ink); }
.menu-toggle span { display: block; width: 22px; height: 2px; margin: 5px auto; background: var(--white); }
.back-link { font-weight: 800; color: #087cc6; }
.article-header-links { display: flex; align-items: center; gap: 22px; }

.blog-hero { padding: 98px 0 90px; overflow: hidden; color: var(--white); background: radial-gradient(circle at 85% 10%, rgba(21, 156, 245, .28), transparent 30%), linear-gradient(135deg, #071321, #0b243b); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .7fr); gap: 72px; align-items: center; }
.eyebrow, .section-label { margin: 0 0 16px; color: var(--blue-2); font-size: .79rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow span { display: inline-block; width: 26px; height: 2px; margin: 0 10px 4px 0; background: currentColor; }
h1, h2, h3 { margin-top: 0; letter-spacing: -.035em; line-height: 1.13; }
.blog-hero h1 { max-width: 820px; margin-bottom: 24px; font-size: clamp(2.45rem, 6vw, 5.15rem); }
.hero-lead { max-width: 720px; margin: 0; color: #c8d7e5; font-size: 1.17rem; line-height: 1.75; }
.hero-panel { display: grid; gap: 12px; padding: 28px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); background: rgba(255,255,255,.06); box-shadow: var(--shadow); }
.hero-panel span { padding: 14px 16px; border-radius: 13px; background: rgba(255,255,255,.07); font-weight: 750; }

.blog-browser { padding-block: 86px 110px; }
.browser-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.browser-heading h2 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3.2rem); }
.search { min-width: 280px; display: flex; align-items: center; gap: 12px; padding: 0 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: 0 8px 30px rgba(8, 28, 48, .06); }
.search input { width: 100%; padding: 13px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.search:focus-within { outline: 3px solid rgba(21,156,245,.2); border-color: var(--blue); }
.category-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.category-button { padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--white); cursor: pointer; font-size: .9rem; font-weight: 800; }
.category-button:hover, .category-button.active { color: var(--white); border-color: var(--ink); background: var(--ink); }
.results-status { min-height: 1.6em; margin: 0 0 22px; color: var(--steel); font-size: .9rem; }

.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.post-card { min-width: 0; overflow: hidden; display: grid; grid-template-columns: minmax(150px, .65fr) minmax(0, 1.35fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 16px 50px rgba(8, 28, 48, .07); transition: transform .25s ease, box-shadow .25s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card.featured { grid-column: 1 / -1; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); }
.card-visual { position: relative; min-height: 220px; overflow: hidden; display: flex; align-items: end; padding: 22px; color: var(--white); background: radial-gradient(circle at 25% 18%, rgba(85,185,250,.9), transparent 24%), linear-gradient(145deg, #0b1d30, #0d6ca6); }
.card-visual[data-category="Machine Learning"] { background: radial-gradient(circle at 76% 24%, rgba(85,185,250,.8), transparent 24%), linear-gradient(145deg, #102a44, #315c7d); }
.card-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-visual.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(7,19,33,.7)); pointer-events: none; }
.card-visual span { position: relative; z-index: 1; padding: 8px 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(7,19,33,.65); font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.post-card:hover .card-visual img { transform: scale(1.035); }
.card-content { min-width: 0; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 13px; color: var(--steel); font-size: .82rem; font-weight: 700; }
.card-content h3 { margin-bottom: 14px; font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
.card-content h3 a:hover { color: #087cc6; }
.card-content > p { margin: 0 0 20px; color: #405367; font-size: 1rem; line-height: 1.72; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.tag-list span { padding: 5px 9px; color: #31506c; border-radius: 7px; background: var(--mist); font-size: .75rem; font-weight: 750; }
.read-more { margin-top: auto; color: #087cc6; font-weight: 900; }
.read-more span { display: inline-block; transition: transform .2s ease; }
.read-more:hover span { transform: translateX(4px); }
.loading-card, .empty-state { grid-column: 1 / -1; padding: 54px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--white); }

.article-shell { width: min(820px, calc(100% - 48px)); min-height: 70vh; margin-inline: auto; padding: 76px 0 110px; }
.article-loading { padding: 80px 0; text-align: center; color: var(--steel); }
.article-intro { padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.article-category { display: inline-block; margin-bottom: 20px; padding: 8px 12px; color: #086fae; border-radius: 999px; background: #dff2ff; font-size: .79rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.article-intro h1 { margin-bottom: 21px; font-size: clamp(2.35rem, 7vw, 4.5rem); }
.article-excerpt { margin: 0 0 23px; color: #405367; font-size: 1.18rem; line-height: 1.72; }
.article-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--steel); font-size: .88rem; font-weight: 700; }
.markdown-body { padding-top: 38px; color: #172b3e; font-size: 1.075rem; line-height: 1.82; }
.markdown-body h2 { margin: 2.15em 0 .7em; color: var(--ink); font-size: clamp(1.75rem, 4vw, 2.35rem); }
.markdown-body h3 { margin: 1.85em 0 .6em; color: var(--ink); font-size: 1.4rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin: 0 0 1.25em; }
.markdown-body li + li { margin-top: .45em; }
.markdown-body a { color: #087cc6; text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .16em; }
.markdown-body blockquote { margin: 1.7em 0; padding: 4px 0 4px 23px; color: #38526a; border-left: 4px solid var(--blue); }
.markdown-body code { padding: .14em .35em; border-radius: 5px; background: var(--mist); font-size: .88em; }
.markdown-body pre { overflow-x: auto; margin: 1.7em 0; padding: 22px; color: #eaf6ff; border-radius: 16px; background: var(--ink); font-size: .88rem; line-height: 1.65; }
.markdown-body pre code { padding: 0; background: transparent; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 18px; }
.markdown-body figure.article-image { margin: 2.1em 0; }
.markdown-body figure.article-image > img,
.markdown-body figure.article-image > a { display: block; }
.markdown-body figure.article-image > a img { width: 100%; }
.markdown-body figcaption { margin-top: 10px; color: var(--steel); font-size: .86rem; line-height: 1.55; text-align: center; }
.markdown-body table { width: 100%; display: block; overflow-x: auto; margin: 1.7em 0; border-collapse: collapse; }
.markdown-body th, .markdown-body td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.markdown-body th { background: var(--mist); }
.markdown-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }
.post-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 64px; padding-top: 30px; border-top: 1px solid var(--line); }
.post-nav-link { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 10px 32px rgba(8, 28, 48, .06); transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; touch-action: manipulation; }
.post-nav-link.previous { grid-column: 1; }
.post-nav-link.next { grid-column: 2; text-align: right; }
.post-nav-direction { display: block; margin-bottom: 7px; color: #087cc6; font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.post-nav-link strong { display: block; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.4; }

@media (hover: hover) and (pointer: fine) {
  .post-nav-link:hover { transform: translateY(-3px); border-color: rgba(21, 156, 245, .55); box-shadow: 0 16px 42px rgba(8, 28, 48, .1); }
}
.article-cta { margin-top: 70px; padding: 40px; color: var(--white); border-radius: var(--radius); background: linear-gradient(145deg, #071321, #103555); }
.article-cta h2 { margin-bottom: 14px; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.article-cta > p:not(.section-label) { color: #c8d7e5; }
.button { display: inline-block; margin-top: 10px; padding: 13px 20px; color: var(--ink); border-radius: 999px; background: var(--white); font-weight: 900; }
.article-error { padding: 70px 0; text-align: center; }
.article-error .button { color: var(--white); background: var(--ink); }

footer { color: #c8d7e5; background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 50px; padding-block: 64px 46px; }
.footer-grid h3 { margin-bottom: 16px; color: var(--white); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; }
.footer-grid a:not(.brand), .footer-grid p { display: block; margin: 0 0 9px; color: #9fb2c4; font-size: .9rem; }
.footer-grid a:hover { color: var(--white); }
.footer-brand { margin-bottom: 18px; color: var(--white); }
.footer-bottom { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(255,255,255,.1); color: #8fa4b8; font-size: .82rem; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  nav { position: fixed; inset: 88px 0 auto; display: none; padding: 25px 24px 30px; flex-direction: column; align-items: stretch; gap: 8px; background: #f8fbfd; border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px rgba(8,28,48,.12); }
  nav.open { display: flex; }
  nav a { padding: 11px 4px; }
  .nav-cta { margin-top: 6px; text-align: center; }
  body.nav-open { overflow: hidden; }
  .hero-grid { grid-template-columns: 1fr; gap: 45px; }
  .hero-panel { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: 1fr; }
  .post-card, .post-card.featured { grid-column: auto; grid-template-columns: minmax(155px, .65fr) minmax(0, 1.35fr); }
  .post-navigation { position: static; width: 100%; display: flex; flex-direction: column; gap: 12px; }
  .post-nav-link, .post-nav-link:hover { position: static; width: 100%; transform: none; box-shadow: none; }
  .post-nav-link.previous, .post-nav-link.next { grid-column: auto; text-align: left; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  html { font-size: 17px; }
  .shell, .nav-wrap, .article-shell { width: min(100% - 32px, 1160px); }
  .nav-wrap { height: 76px; }
  nav { top: 76px; }
  .blog-hero { padding: 68px 0; }
  .blog-hero h1 { font-size: clamp(2.3rem, 13vw, 3.45rem); }
  .hero-panel { grid-template-columns: 1fr; }
  .blog-browser { padding-block: 64px 80px; }
  .browser-heading { align-items: stretch; flex-direction: column; }
  .search { min-width: 0; width: 100%; }
  .post-card, .post-card.featured { grid-template-columns: 1fr; }
  .card-visual { min-height: 150px; }
  .card-content { padding: 23px; }
  .article-shell { padding: 55px 0 80px; }
  .article-intro h1 { font-size: clamp(2.15rem, 12vw, 3.25rem); }
  .markdown-body { font-size: 1.03rem; line-height: 1.78; }
  .markdown-body figure.article-image { margin-inline: 0; }
  .article-cta { padding: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom { padding-block: 22px; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
