/* =====================================================================
   The Python Code: site design system (v2)
   Loaded after every other stylesheet, so it defines the final look.
   ===================================================================== */
:root {
  --ink: #0f172a;
  --text: #1e293b;
  --body: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --soft: #f1f5f9;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --brand: #2f6db5;
  --brand-600: #245a97;
  --brand-50: #eef5fd;
  --brand-100: #dbe9fa;
  --accent: #ffd43b;
  --accent-ink: #3d3000;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 24px 48px -20px rgba(15, 23, 42, .28);
  --nav-h: 66px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
}

/* ---------------------------------------------------------------- base */
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  font-family: var(--font) !important;
  font-weight: 400 !important;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
span, li::marker { font-family: inherit !important; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font) !important;
  font-weight: 700 !important;
  color: var(--ink);
  letter-spacing: -.018em;
  line-height: 1.25;
}
p { line-height: 1.7; margin: 0 0 1.1em; }
a { color: var(--brand); text-decoration: none; transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, transform .15s; }
a:hover, a:focus { color: var(--brand-600); }
.text-info { color: var(--brand) !important; }
.text-secondary { color: var(--muted) !important; }
::selection { background: var(--brand-100); color: var(--ink); text-shadow: none; }
img { max-width: 100%; height: auto; }
hr { border-color: var(--line); opacity: 1; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }

/* the old full-width image header is no longer used */
header.masthead { display: none !important; }

/* ------------------------------------------------------------- buttons */
.btn {
  font-family: var(--font);
  font-weight: 600 !important;
  font-size: 15px;
  letter-spacing: 0 !important;
  text-transform: none;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: none;
}
.btn-sm { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.btn-primary, .btn-primary-main {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary-main:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent) !important;
}
.btn-outline-primary { color: var(--brand); border-color: var(--line); background: #fff; }
.btn-outline-primary:hover { color: var(--brand-600); background: var(--brand-50); border-color: var(--brand-100); }
.btn-outline-secondary { color: var(--text); border-color: var(--line); background: #fff; }
.btn-outline-secondary:hover { color: var(--ink); background: var(--soft); border-color: var(--line); }
.btn-secondary { background: var(--soft); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--line); color: var(--ink); border-color: var(--line); }

/* --------------------------------------------------------------- forms */
.form-control, .form-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus {
  border-color: color-mix(in srgb, var(--brand) 55%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}
.input-group-text { border: 1px solid var(--line); background: #fff; color: var(--faint); border-radius: 10px; }
::placeholder { color: var(--faint); }

/* --------------------------------------------------------------- navbar */
#mainNav.tpc-nav {
  position: fixed !important;
  top: 0 !important;
  transform: none !important;
  height: var(--nav-h);
  padding: 0;
  background: rgba(255, 255, 255, .86) !important;
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft) !important;
  font-family: var(--font);
  z-index: 1040;
}
#mainNav.tpc-nav .navbar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0; margin-right: 28px;
  color: var(--ink) !important;
  font-weight: 800 !important; font-size: 18px; letter-spacing: -.02em;
}
#mainNav.tpc-nav .navbar-brand img { width: 32px; height: 32px; }
#mainNav.tpc-nav .navbar-nav > li.nav-item > a,
#mainNav.tpc-nav .nav-link {
  color: var(--body) !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  padding: 8px 12px !important;
  border-radius: 10px;
  background-color: transparent;
}
#mainNav.tpc-nav .nav-link:hover, #mainNav.tpc-nav .nav-link:focus { color: var(--ink) !important; background-color: var(--soft) !important; }
#mainNav.tpc-nav .dropdown-toggle,
#mainNav.tpc-nav.is-fixed .navbar-nav > li.nav-item > a.dropdown-toggle {
  position: relative;
  padding-right: 28px !important;
  /* Clear legacy white/black caret sprites in both the normal and fixed nav states. */
  background: transparent !important;
}
/* Use a CSS-drawn caret instead of a background image: it stays visible in
   every theme and cannot be clipped or lost to legacy navbar styles. */
#mainNav.tpc-nav .dropdown-toggle::after {
  display: inline-block !important;
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -5.5px 0 0;
  border: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  vertical-align: initial;
}
#mainNav.tpc-nav .dropdown-toggle:hover { background-color: var(--soft) !important; }
#mainNav.tpc-nav .dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  margin-top: 0 !important;
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  min-width: 240px;
}
#mainNav.tpc-nav .dropdown:hover > .dropdown-menu { display: block; }
#mainNav.tpc-nav .dropdown-item {
  border-radius: 9px; padding: 8px 12px; font-size: 14.5px; color: var(--text); font-weight: 500;
}
#mainNav.tpc-nav .dropdown-item i { color: var(--faint); width: 20px; }
#mainNav.tpc-nav .dropdown-item:hover, #mainNav.tpc-nav .dropdown-item:focus { background: var(--brand-50) !important; color: var(--brand-600) !important; }
#mainNav.tpc-nav .dropdown-item:hover i { color: var(--brand); }
#mainNav.tpc-nav .dropdown-divider { border-color: var(--line-soft); margin: 6px 4px; }
#mainNav.tpc-nav .tpc-nav-cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: #fff !important; font-weight: 600; font-size: 14px;
}
#mainNav.tpc-nav .tpc-nav-cta:hover { background: #1e293b; transform: translateY(-1px); }
#mainNav.tpc-nav .tpc-nav-cta i { color: var(--accent); }
#mainNav.tpc-nav .tpc-nav-search {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted);
}
#mainNav.tpc-nav .tpc-nav-search:hover { background: var(--soft); color: var(--ink); }
#mainNav.tpc-nav .navbar-toggler {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); font-size: 15px;
  box-shadow: none;
}
@media (max-width: 991.98px) {
  #mainNav.tpc-nav { height: auto; min-height: var(--nav-h); }
  #mainNav.tpc-nav > .container-xl { min-height: var(--nav-h); }
  #mainNav.tpc-nav .navbar-collapse {
    background: #fff; margin: 0 -12px; padding: 8px 12px 16px; border-top: 1px solid var(--line-soft);
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  #mainNav.tpc-nav .dropdown-menu { box-shadow: none; border: 0; padding: 0 0 0 12px; max-height: none; }
  #mainNav.tpc-nav .tpc-nav-actions { padding-top: 8px; }
}

/* ------------------------------------------------------------- layout */
.tpc-main { padding-top: 32px; padding-bottom: 24px; }
.tpc-sidebar { font-size: 15px; }
.tpc-sidebar-inner { height: 100%; }
.tpc-side-sticky { position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 991.98px) { .tpc-side-sticky { position: static; } }

/* --------------------------------------------------------------- cards */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: #d9e2ee; }
.card .card-img-top { border-radius: 0; }

/* article cards used on listing pages */
.tpc-card {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.tpc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tpc-card-img { display: block; aspect-ratio: 1.91 / 1; overflow: hidden; background: var(--soft); }
.tpc-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tpc-card:hover .tpc-card-img img { transform: scale(1.035); }
.tpc-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tpc-card-title { font-size: 1.12rem; margin: 0; line-height: 1.35; }
.tpc-card-title a { color: var(--ink); }
.tpc-card-title a:hover { color: var(--brand); }
.tpc-card-text {
  color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tpc-draft { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 2px 8px; }

/* topic chips */
.tpc-chip, .tag {
  display: inline-flex !important; align-items: center;
  padding: 3px 10px !important; margin: 0 6px 6px 0 !important;
  border-radius: 999px !important;
  background: var(--brand-50) !important;
  border: 1px solid var(--brand-100);
  color: var(--brand-600) !important;
  font-size: 12.5px !important; font-weight: 600 !important; line-height: 1.6;
  box-shadow: none !important; transform: none !important;
}
.tag a, .tpc-chip a { color: var(--brand-600) !important; }
.tpc-chip:hover, .tag:hover { background: var(--brand-100) !important; color: var(--brand-600) !important; }

/* page titles */
.tpc-page-title { text-align: center; margin: 8px auto 28px; max-width: 760px; }
.tpc-page-title h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800 !important; margin: 0 0 8px; }
.tpc-page-title p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.tpc-eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-50); border-radius: 999px; padding: 4px 12px; margin-bottom: 12px;
}

/* ------------------------------------------------------------ search bar */
.tpc-search { max-width: 640px; margin: 0 auto; }
.tpc-search .form-control { width: 100% !important; border-radius: 999px; padding: 12px 20px 12px 46px; font-size: 15.5px; height: 50px; }
.tpc-search .tpc-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--faint); z-index: 5; }
.tpc-search .btn { border-radius: 999px; padding: 0 22px; height: 42px; position: absolute; right: 4px; top: 4px; z-index: 5; }

/* ----------------------------------------------------------- pagination */
.pagination { gap: 6px; flex-wrap: wrap; margin: 28px 0 8px; }
.pagination .page-link {
  border: 1px solid var(--line) !important; border-radius: 10px !important; color: var(--text);
  padding: 8px 14px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-sm);
}
.pagination .page-link:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100) !important; }
.pagination .page-item.disabled .page-link { background: var(--ink); color: #fff; border-color: var(--ink) !important; }
.pagination .page-link b { font-weight: 600; }

/* --------------------------------------------------------------- article */
.tpc-article-head { margin-bottom: 26px; }
.tpc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; margin-bottom: 14px; }
.tpc-crumbs a { color: var(--muted); }
.tpc-crumbs a:hover { color: var(--brand); }
.tpc-crumbs i { color: var(--faint); font-size: 10px; }
.tpc-article-title { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800 !important; letter-spacing: -.028em; line-height: 1.18; margin: 0 0 14px; }
.tpc-article-lead { font-size: 1.12rem; color: var(--muted); line-height: 1.6; margin: 0 0 20px; }
.tpc-article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  font-size: 14px; color: var(--muted); padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.tpc-article-meta a { color: var(--text); font-weight: 600; }
.tpc-article-meta a:hover { color: var(--brand); }
.tpc-authors { display: flex; align-items: center; gap: 10px; }
.tpc-avatars { display: flex; }
.tpc-avatars img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); margin-left: -8px; }
.tpc-avatars img:first-child { margin-left: 0; }
.tpc-article-meta .tpc-dot { color: var(--faint); }
.tpc-article-meta i { color: var(--faint); margin-right: 4px; }
.tpc-sponsored { color: #92400e; background: #fef3c7; border-radius: 6px; padding: 1px 8px; font-weight: 600; font-size: 12.5px; }
.tpc-article-cover { margin-top: 22px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.tpc-article-cover img { width: 100%; display: block; }

/* article body typography: works on the HTML stored in the database */
.article-body { font-size: 17px; line-height: 1.78; color: var(--body); overflow-wrap: break-word; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.25em; line-height: 1.78; }
.article-body h2 { font-size: 1.62rem; margin: 2.2em 0 .7em; padding-top: .2em; }
.article-body h3 { font-size: 1.3rem; margin: 1.9em 0 .6em; }
.article-body h4 { font-size: 1.1rem; margin: 1.6em 0 .5em; }
.article-body h2 + p, .article-body h3 + p { margin-top: 0; }
.article-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.article-body a:hover { text-decoration-color: currentColor; }
.article-body ul, .article-body ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.article-body li { margin: .35em 0; line-height: 1.7; }
.article-body li::marker { color: var(--faint); }
.article-body img { border-radius: 12px; margin: 10px 0; border: 1px solid var(--line-soft); }
.article-body figure { margin: 1.6em 0; }
.article-body figcaption, .article-body .caption { font-size: 14px; color: var(--muted); text-align: center; font-style: normal; }
.article-body blockquote {
  margin: 1.6em 0; padding: 14px 20px; border-left: 4px solid var(--brand); background: var(--brand-50);
  border-radius: 0 12px 12px 0; color: var(--text); font-style: normal;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5em 0; font-size: 15px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.article-body th { background: var(--bg-2); font-weight: 600; color: var(--ink); }
.article-body tr:last-child td { border-bottom: 0; }
.article-body hr { margin: 2.5em 0; }
.article-body iframe, .article-body video { max-width: 100%; border-radius: 12px; }
.tpc-disclosure { font-size: 14px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 14px; }

/* actions under the article */
.tpc-article-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 8px; }
.tpc-article-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.tpc-share { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 30px 0; color: var(--muted); font-size: 14px; }
.tpc-share a {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--text); background: #fff;
}
.tpc-share a:hover { color: #fff; background: var(--ink); border-color: var(--ink); transform: translateY(-2px); }

/* related articles */
.tpc-section-title { font-size: 1.35rem; margin: 40px 0 16px; }
.tpc-related { display: grid; gap: 14px; }
.tpc-related-item {
  display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: inherit;
  box-shadow: var(--shadow-sm);
}
.tpc-related-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.tpc-related-item img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 10px; }
.tpc-related-item h4 { font-size: 1.05rem; margin: 0 0 4px; }
.tpc-related-item p { font-size: 14px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 576px) { .tpc-related-item { grid-template-columns: 110px 1fr; gap: 12px; } .tpc-related-item p { display: none; } }

/* comments */
.tpc-comments { margin-top: 44px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.tpc-comments h3 { font-size: 1.3rem; margin: 0 0 14px; }
.tpc-comments .media-list { padding: 0; list-style: none; }
.tpc-comments li.media { background: #fff; border: 1px solid var(--line) !important; border-radius: 12px; padding: 14px; margin-bottom: 10px; gap: 12px; }
.tpc-comments li.media img { width: 40px !important; height: 40px !important; border-radius: 50% !important; }
.tpc-comments .reply-button { font-size: 13px; padding: 4px 10px; }
.tpc-comments .tpc-check-label { font-size: 14px; color: var(--body); margin-left: 6px; cursor: pointer; }
.tpc-comments input[type=checkbox] { accent-color: var(--brand); vertical-align: -1px; }
.code-assistant-prompt p { font-size: 14px !important; color: var(--muted); font-family: var(--font) !important; }

/* ------------------------------------------------------------- sidebar */
.tpc-side-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.tpc-side-title { font-size: 12.5px; font-weight: 700 !important; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; }
.tpc-side-title a { color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 600; font-size: 13px; }
.tpc-side-title a:hover { color: var(--brand); }
.tpc-newsletter { background: linear-gradient(160deg, #0f1a33, #1b2b52); border: 0; color: #d8e1f3; text-align: center; }
.tpc-newsletter img { width: 44px; height: 44px; margin-bottom: 8px; }
.tpc-newsletter h4 { color: #fff; font-size: 1.1rem; margin: 0 0 4px; }
.tpc-newsletter p { font-size: 14px; color: #b7c3dd; margin: 0 0 14px; }
.tpc-newsletter .form-control { border: 0; }
.tpc-newsletter .btn { width: 100%; margin-top: 8px; background: var(--accent) !important; border-color: var(--accent) !important; color: var(--accent-ink) !important; }
.tpc-newsletter .btn:hover { filter: brightness(1.05); box-shadow: 0 8px 18px -8px rgba(255, 212, 59, .6) !important; }
.tpc-chip-list { display: flex; flex-wrap: wrap; }
.tpc-chip-list .tpc-chip { background: var(--soft) !important; border-color: var(--line) !important; color: var(--body) !important; font-weight: 500 !important; }
.tpc-chip-list .tpc-chip:hover { background: var(--brand-50) !important; color: var(--brand-600) !important; border-color: var(--brand-100) !important; }
.tpc-chip-list .tpc-chip.active { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
.tpc-link-list { list-style: none; padding: 0; margin: 0; counter-reset: tpc; }
.tpc-link-list li { border-top: 1px solid var(--line-soft); }
.tpc-link-list li:first-child { border-top: 0; }
.tpc-link-list a { display: flex; gap: 10px; padding: 9px 0; color: var(--text); font-size: 14.5px; font-weight: 500; line-height: 1.45; }
.tpc-link-list a:hover { color: var(--brand); }
.tpc-link-list.numbered a::before {
  counter-increment: tpc; content: counter(tpc); flex: none; width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-50); margin-top: 1px;
}
.tpc-banner img { border-radius: 12px; width: 100%; }
.tpc-banner { display: block; margin-bottom: 18px; }

/* --------------------------------------------------------------- footer */
.tpc-footer { background: #0b1220; color: #9fb0cc; margin-top: 64px; padding: 56px 0 28px; font-size: 14.5px; }
.tpc-footer a { color: #c5d2e8; }
.tpc-footer a:hover { color: #fff; }
.tpc-footer-brand { display: flex; align-items: center; gap: 10px; color: #fff !important; font-weight: 800; font-size: 18px; margin-bottom: 12px; }
.tpc-footer-brand img { width: 34px; height: 34px; }
.tpc-footer-about { max-width: 360px; line-height: 1.65; margin-bottom: 18px; }
.tpc-footer h5 { color: #fff; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 6px 0 14px; }
.tpc-footer ul { list-style: none; padding: 0; margin: 0; }
.tpc-footer li { margin: 0 0 9px; }
.tpc-social { display: flex; gap: 10px; }
.tpc-social a { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .06); color: #c5d2e8; font-size: 16px; }
.tpc-social a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.tpc-footer-news { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 22px; margin-bottom: 44px; }
.tpc-footer-news h4 { color: #fff; font-size: 1.2rem; margin: 0 0 4px; }
.tpc-footer-news p { margin: 0; color: #9fb0cc; }
.tpc-footer-news form { display: flex; gap: 10px; }
.tpc-footer-news .form-control { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }
.tpc-footer-news .form-control::placeholder { color: #8292ae; }
.tpc-footer-news .btn { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--accent-ink) !important; white-space: nowrap; }
.tpc-footer-news small, .tpc-footer-news small a { color: #6b7b98; font-size: 11.5px; }
.tpc-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 32px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; color: #6b7b98; font-size: 13.5px; }
@media (max-width: 767.98px) { .tpc-footer-news form { flex-direction: column; } }

/* -------------------------------------------------------------- homepage */
.tpc-hero { text-align: center; padding: 46px 0 34px; position: relative; }
.tpc-hero::before {
  content: ""; position: absolute; inset: -40px 0 0; z-index: -1; pointer-events: none;
  background: radial-gradient(600px 240px at 50% 0%, var(--brand-50), transparent 70%),
              radial-gradient(420px 200px at 85% 20%, #fff8d6, transparent 70%);
}
.tpc-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800 !important; letter-spacing: -.035em; line-height: 1.08; margin: 0 auto 14px; max-width: 820px; }
.tpc-hero h1 .tpc-hl { background: linear-gradient(90deg, var(--brand), #4c8fd6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tpc-hero p { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 26px; }
.tpc-hero .tpc-search { margin-bottom: 18px; }
.tpc-hero-topics { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 820px; margin: 0 auto; }
.tpc-hero-topics a { font-size: 13.5px; font-weight: 500; color: var(--body); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; box-shadow: var(--shadow-sm); }
.tpc-hero-topics a:hover { color: var(--brand-600); border-color: var(--brand-100); background: var(--brand-50); }

.tpc-home section h2, .tpc-home .section-header h2 { font-size: 1.55rem !important; padding: 0 !important; margin: 0 !important; }
.tpc-home section h2::after { display: none !important; }
.tpc-home .section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px !important; }
.tpc-home .section-header a { color: var(--brand) !important; font-weight: 600; font-size: 14.5px; text-decoration: none !important; }
.tpc-home section { border-radius: var(--radius) !important; }
.tpc-home .ebooks-section { background: var(--bg-2) !important; border: 1px solid var(--line-soft); box-shadow: none !important; padding: 28px !important; }
.tpc-home .ebooks-section h2 { text-align: left !important; margin-bottom: 20px !important; }
.tpc-home .ebook-card, .tpc-home .tutorial-card, .tpc-home .tool-card {
  border: 1px solid var(--line) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-sm) !important; background: #fff !important;
}
.tpc-home .ebook-card:hover, .tpc-home .tutorial-card:hover, .tpc-home .tool-card:hover { transform: translateY(-3px) !important; box-shadow: var(--shadow) !important; }
.tpc-home .tutorial-card::after { display: none; }
.tpc-home .tutorial-card .card-img-top { aspect-ratio: 1.91 / 1; height: auto !important; object-fit: cover; }
.tpc-home .tutorial-card:hover .card-img-top, .tpc-home .ebook-card:hover .ebook-img { transform: scale(1.03) !important; }
.tpc-home .tutorial-card .card-title a { color: var(--ink) !important; }
.tpc-home .tutorial-card:hover .card-title a { color: var(--brand) !important; }
.tpc-home .tutorial-card .card-text { color: var(--muted) !important; }
@media (min-width: 992px) {
  .tpc-home .tutorial-card.large-card .card-img-top { width: 100%; height: 100% !important; }
  .tpc-home .tutorial-card.large-card > a { width: 52%; flex: none; }
  .tpc-home .tutorial-card.large-card .card-body { width: 48%; padding: 28px !important; justify-content: center !important; }
  .tpc-home .tutorial-card.large-card .card-title { font-size: 1.6rem !important; }
}
.tpc-home .btn-buy { background: var(--brand) !important; border-radius: 10px !important; color: #fff !important; }
.tpc-home .btn-buy:hover { background: var(--brand-600) !important; }
.tpc-home .btn-view { border-radius: 10px !important; }
.tpc-home .price-row { background: var(--bg-2) !important; border-radius: 10px !important; }
.tpc-home .tool-card { background: #fff !important; text-align: left; }
.tpc-home .tool-card .d-flex { align-items: flex-start !important; text-align: left !important; }
.tpc-home .tool-icon {
  font-size: 1.2rem !important; width: 46px; height: 46px !important; display: grid !important; place-items: center;
  border-radius: 12px; background: var(--brand-50); color: var(--brand) !important; margin-bottom: 14px !important;
}
.tpc-home .tool-card:hover .tool-icon { transform: none !important; background: var(--brand); color: #fff !important; }
.tpc-home .tool-title { font-size: 1.05rem !important; margin-bottom: 6px !important; text-align: left !important; }
.tpc-home .tool-title a { color: var(--ink) !important; }
.tpc-home .tool-description { text-align: left !important; margin: 0; }
.tpc-home .tools-section h2 a { color: var(--brand) !important; }
.tpc-home .topic-card { background: #fff !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow-sm) !important; height: 58px !important; }
.tpc-home .topic-card:hover { background: var(--brand-50) !important; border-color: var(--brand-100) !important; transform: translateY(-2px); }
.tpc-home .topic-link { color: var(--ink) !important; font-weight: 600 !important; letter-spacing: 0 !important; font-size: 15px; }
.tpc-home .topic-card:hover .topic-link { color: var(--brand-600) !important; }
.tpc-home .view-count { color: var(--faint) !important; }
.tpc-home .card-author-info a, .card-author-info a { color: var(--text) !important; }

/* ----------------------------------------------------- misc components */
.alert { border-radius: 12px; border: 1px solid transparent; }
.modal-content { border-radius: var(--radius); border: 0; box-shadow: var(--shadow-lg); }
.list-group-item { border-color: var(--line-soft); }
.list-group-item:hover { background-color: var(--brand-50) !important; }
.badge { font-weight: 600; border-radius: 6px; }
.ebook-section { border-radius: var(--radius); overflow: hidden; }
.media-body { min-width: 0; }

/* code page title */
.tpc-code-title { font-size: clamp(1.5rem, 2.6vw, 1.95rem); margin: 6px 0 16px; }
.tpc-code-title a { color: var(--ink); }
.tpc-code-title a:hover { color: var(--brand); }

@media (max-width: 576px) {
  body { font-size: 16px; }
  .article-body { font-size: 16.5px; }
  .tpc-main { padding-top: 20px; }
}

/* inline search bar under the navbar */
.tpc-searchbar {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 1035;
  background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft); padding: 14px 0; box-shadow: var(--shadow);
  animation: tpc-drop .18s ease-out;
}
@keyframes tpc-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* sort tabs on the tutorials page */
.tpc-sort { display: flex; justify-content: center; gap: 6px; }
.tpc-sort a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.tpc-sort a:hover { color: var(--ink); background: var(--soft); }
.tpc-sort a.active { color: var(--ink); background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }

/* author profile */
.tpc-author { display: flex; gap: 24px; align-items: flex-start; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.tpc-author > img, .tpc-author > a > img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex: none; border: 4px solid #fff; box-shadow: var(--shadow); }
.tpc-author h1 { font-size: 1.8rem; margin: 0 0 6px; }
.tpc-author h3 { font-size: 1.25rem; margin: 0 0 8px; }
.tpc-author h3 a { color: var(--ink); text-decoration: none; }
.tpc-author + .tpc-author { margin-top: 16px; }
.tpc-author > a { flex: none; }
.tpc-author p { margin: 12px 0 0; color: var(--body); }
.tpc-author-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 14px; color: var(--muted); }
.tpc-author-meta a { color: var(--text); font-weight: 600; }
@media (max-width: 576px) { .tpc-author { flex-direction: column; } }

/* empty states and errors */
.error-template { text-align: center; padding: 56px 16px; }
.error-template h1, .error-template h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800 !important; margin-bottom: 10px; }
.error-template .error-details { color: var(--muted); font-size: 1.05rem; max-width: 520px; margin: 0 auto; }
.error-template .error-actions { margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.error-template .error-actions .btn { margin: 0; }

/* ------------------------------------------------------------ simple forms */
.tpc-form { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.tpc-form .form-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.tpc-form .alert { font-size: 14px !important; }
.tpc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--body); cursor: pointer; }
.tpc-check input { accent-color: var(--brand); width: 16px; height: 16px; }
