:root {
  --bg: #0b0f14;
  --bg-soft: #11161d;
  --text: #e6edf3;
  --muted: #9aa7b4;
  --accent: #4cc2ff;
  --accent-deep: #2f8fd8;
  --accent-soft: rgba(76, 194, 255, 0.16);
  --on-accent: #0b1016;
  --border: #1f2733;
  --nav-bg: rgba(11, 15, 20, 0.85);
  --radius: 12px;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-soft: #ffffff;
  --text: #0f172a;
  --muted: #55606e;
  --border: #e2e8f0;
  --nav-bg: rgba(246, 248, 250, 0.85);
}

[data-accent="blue"] {
  --accent: #4cc2ff;
  --accent-deep: #2f8fd8;
  --accent-soft: rgba(76, 194, 255, 0.16);
}

[data-accent="green"] {
  --accent: #3ddc97;
  --accent-deep: #22a06b;
  --accent-soft: rgba(61, 220, 151, 0.16);
}

[data-accent="purple"] {
  --accent: #a78bfa;
  --accent-deep: #7c5cd6;
  --accent-soft: rgba(167, 139, 250, 0.16);
}

[data-accent="orange"] {
  --accent: #fb923c;
  --accent-deep: #e0761e;
  --accent-soft: rgba(251, 146, 60, 0.16);
}

[data-accent="pink"] {
  --accent: #f472b6;
  --accent-deep: #d64a95;
  --accent-soft: rgba(244, 114, 182, 0.16);
}

[data-theme="light"] [data-accent="blue"] { --accent-soft: rgba(76, 194, 255, 0.22); }
[data-theme="light"] [data-accent="green"] { --accent-soft: rgba(61, 220, 151, 0.22); }
[data-theme="light"] [data-accent="purple"] { --accent-soft: rgba(167, 139, 250, 0.22); }
[data-theme="light"] [data-accent="orange"] { --accent-soft: rgba(251, 146, 60, 0.22); }
[data-theme="light"] [data-accent="pink"] { --accent-soft: rgba(244, 114, 182, 0.22); }

/* Self-hosted variable font (Inter) */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 100 900;
  src: url("fonts/InterVariable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Inter Variable";
  font-style: italic;
  font-display: optional;
  font-weight: 100 900;
  src: url("fonts/InterVariable-Italic.woff2") format("woff2-variations");
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* Nav */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}

.dropdown-caret {
  font-size: 0.7em;
  opacity: 0.7;
  margin-left: 2px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 170px;
  padding: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 30;
}

.nav-dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.dropdown-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.dropdown-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Skip link: invisible until keyboard-focused, then pinned top-left. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 8px;
}

.nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

/* CLS: the nav used to be injected by script.js after first paint, pushing
   all content down (0.07-0.5 CLS). Fixed structurally by loading scripts with
   `defer` in <head> (build.js canonical head block) so the nav exists before
   the first paint. The share-bar below is injected at the same time but sits
   mid-document, so its space is still reserved for slow-connection paints. */

/* Same trick for the JS-injected share-bar on articles (marked data-article
   by tools/gen-seo.js): meta mb 24 + bar 60 + bar mb 24 = 108px. Margin-top
   collapses with meta's 24px margin (max = 108) before injection, and the
   real bar reproduces the exact same 108px gap after -> zero shift. */
main.article-page[data-article] > .article-body { margin-top: 108px; }
main.article-page > .share-bar + .article-body { margin-top: 0; }

@media (max-width: 640px) {
.nav {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
  }
  .search-wrap {
    order: 3;
    max-width: none;
    width: 100%;
  }
  .links {
    order: 4;
    width: 100%;
    justify-content: flex-start;
  }
  .hero {
    padding: 72px 20px 48px;
  }
  .section,
  .page-hero,
  .article-grid {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  line-height: 1.05;
  display: inline-block;
}

.brand-name .brand-sub {
  display: block;
  font-size: 0.45em;
  font-weight: 600;
  text-align: right;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: -0.1em;
}

.links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Search */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder {
  color: var(--muted);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 20;
}

.search-result {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover {
  background: var(--accent-soft);
}

.search-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.search-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.search-empty {
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
}

.contact-form label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
}

.contact-form .btn {
  align-self: flex-start;
  margin-top: 14px;
  border: none;
  cursor: pointer;
}

.contact-form .btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form-status {
  font-size: 0.9rem;
  margin-top: 8px;
}

.contact-direct {
  margin-top: 4px;
  font-size: 0.9rem;
}

/* Tags page */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.tag-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.tag-results {
  grid-column: 1 / -1;
}

.tag-results-heading {
  font-size: 1.2rem;
  margin: 24px 0 8px;
}

/* Latest list */
.latest-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.latest-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: color 0.15s;
}

.latest-item:last-child {
  border-bottom: none;
}

.latest-item:hover {
  color: var(--accent);
}

.latest-title {
  font-weight: 600;
}

.latest-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  vertical-align: middle;
}

.latest-meta {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.latest-count.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.latest-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 14px;
}

.latest-filters .tag-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* Theme controls */
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}
.lang-btn {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--border); }
.lang-btn:hover { color: var(--text); background: var(--bg); }
.lang-btn.active { background: var(--accent); color: var(--on-accent); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.icon-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.palette-wrap {
  position: relative;
}

.palette {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.palette[hidden] {
  display: none;
}

.dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.15s;
}

.dot:hover {
  transform: scale(1.15);
}

.dot.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-soft);
}

/* Hero */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 110px 32px 64px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.0rem);
  line-height: 1.2;
  letter-spacing: -0.4px;
}

/* Tamil words are long agglutinative tokens with no break points –
   keep them inside narrow viewports instead of forcing a zoom-out.
   `anywhere` (not `break-word`) so it also shrinks min-content size
   inside flex/grid items, which default to min-width:auto. */
h1, h2, h3, h4, .article-page .title {
  overflow-wrap: anywhere;
  min-width: 0;
}
html[lang="ta"] .hero h1 {
  font-size: clamp(1.5rem, 6.2vw, 2.6rem);
}

.accent {
  color: var(--accent);
}

.tagline {
  margin: 20px auto 32px;
  max-width: 520px;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-sub {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--muted);
}

.hero-sub a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-sub a:hover {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Ghost buttons inside calc/tool panels need contrast against the calc's --bg-soft background */
.calc .btn-ghost,
.tool-btn-row .btn-ghost {
  background: var(--bg);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.calc .btn-ghost:hover,
.tool-btn-row .btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
}

[data-theme="light"] .btn-ghost {
  border-color: #94a3b8;
}

[data-theme="light"] .calc .btn-ghost,
[data-theme="light"] .tool-btn-row .btn-ghost {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}

[data-theme="light"] .btn-ghost:hover {
  border-color: var(--accent);
  background: #ffffff;
}

/* Light-theme secondary controls – stronger border/shadow vs --border #e2e8f0 which is invisible on white */
[data-theme="light"] .preset-chip {
  border-color: #94a3b8;
  background: #ffffff;
}

[data-theme="light"] .kv-remove {
  border-color: #94a3b8;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

[data-theme="light"] .copy-btn {
  border-color: #94a3b8;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
  opacity: 0.92;
}

[data-theme="light"] .code-block:hover .copy-btn {
  opacity: 1;
}

/* Sections */
.section {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px;
}

.section h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.section p {
  color: var(--muted);
}

/* Category grid (home hub) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.cat-grid-primary {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {
  .cat-grid-primary {
    grid-template-columns: 1fr;
  }
}

.secondary-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
}

.secondary-topics span {
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}

.secondary-topics a {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.85rem;
  transition: border-color 0.15s, color 0.15s;
}

.secondary-topics a:hover {
  border-color: var(--accent);
  color: var(--text);
}

.cat-card {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-color: var(--cat-color, var(--border));
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  transition: transform 0.15s, border-color 0.2s;
}

.cat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--cat-color, var(--accent));
}

.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--cat-color, transparent), transparent 45%);
  opacity: 0.14;
  pointer-events: none;
}

.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--cat-color, var(--accent));
}

.cat-card .cat-icon {
  font-size: 1.6rem;
  color: var(--accent);
}

.cat-card h3 {
  margin: 12px 0 8px;
}

.cat-card p {
  font-size: 0.95rem;
  color: var(--muted);
}

.cat-card .cat-count {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--cat-color, var(--accent));
}

/* Category / article pages */
.page-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 32px 32px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.breadcrumb a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.page-hero p {
  color: var(--muted);
  max-width: 560px;
}

/* Article cards */
.article-grid {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 32px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.article {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article h3 {
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.35;
}

.article h3 a {
  color: var(--text);
}

.article h3 a:hover {
  color: var(--accent);
}

.article p {
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

a.tag {
  cursor: pointer;
  text-decoration: none;
}

a.tag:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.article .date {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Related articles */
.related-section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related-heading {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.related-list {
  display: flex;
  flex-direction: column;
}

.related-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: color 0.15s;
}

.related-item:last-child {
  border-bottom: none;
}

.related-item:hover {
  color: var(--accent);
}

.related-title {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.related-meta {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Share bar */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.share-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.1s;
}

.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.share-btn:active {
  transform: scale(0.94);
}

.share-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}

/* FAQ section */
.faq-section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.faq-heading {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.15s;
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
}

.faq-item p {
  padding: 0 16px 14px;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

/* Author box */
.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 40px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.author-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
}

.author-info p {
  margin: 4px 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.author-name {
  font-weight: 700;
  font-size: 1rem;
}

.author-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.author-link:hover {
  text-decoration: underline;
}

/* Footer social links */
.social-links {
  margin-top: 10px;
}

/* Article nav */

/* Article page */
.article-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px;
}

.article-page .title {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.article-page .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.article-page .meta .tag {
  font-size: 0.75rem;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: help;
}

.caution-callout {
  /* inline flow, not flex: the content is raw text + <code> and flex would
     split it into anonymous items that cannot wrap/shrink (TA overflow) */
  display: block;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 18px 0;
}

.caution-callout strong {
  color: #fb923c;
}

.caution-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.35);
  margin-bottom: 6px;
}

.pre-caution-wrap {
  margin: 18px 0;
}

.pre-caution-wrap .caution-badge {
  margin-bottom: 8px;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.article-body h2 {
  font-size: 1.4rem;
  margin: 40px 0 12px;
  letter-spacing: -0.3px;
}

.article-body h3 {
  font-size: 1.15rem;
  margin: 28px 0 10px;
}

.article-body p {
  margin: 14px 0;
}

.article-body strong {
  color: var(--text);
}

.article-body ul,
.article-body ol {
  margin: 14px 0;
  padding-left: 24px;
}

.article-body li {
  margin: 8px 0;
}

.article-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 18px 0;
}

.code-block {
  position: relative;
  margin: 18px 0;
}

.code-block pre {
  margin: 0;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

@media (max-width: 640px) {
  .copy-btn {
    opacity: 1;
  }
}

.article-body code {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}

.article-body p code,
.article-body li code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}

/* Long content (Tamil words, ASCII tokens) must not widen the page –
   let wide tables scroll instead of forcing a horizontal zoom-out. */
.article-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 18px;
  margin: 18px 0;
  color: var(--muted);
  font-style: italic;
}

/* Lab screenshots */
.article-body figure {
  margin: 22px 0;
}
.article-body figure img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
}
.article-body figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

.article-nav {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
}

/* Continue reading – prev/next within the same series */
.article-flow {
  margin: 36px 0 8px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.flow-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 12px;
}

.flow-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.flow-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}

.flow-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.flow-link.flow-next {
  grid-column: 2;
  text-align: right;
}

.flow-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.flow-title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

@media (max-width: 560px) {
  .flow-row {
    grid-template-columns: 1fr;
  }
  .flow-link.flow-next {
    grid-column: auto;
    text-align: left;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 {
  margin-bottom: 8px;
  color: var(--text);
}

.card p {
  font-size: 0.95rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links a svg {
  vertical-align: -2px;
  margin-right: 4px;
}

.footer-note {
  font-size: 0.8rem;
  margin-bottom: 8px;
}

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transform-origin: left;
  transform: scaleX(0);
  z-index: 1000;
  transition: transform 0.12s linear;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* Category colors */
.meta .cat-pill {
  border: none;
}

/* Hot Topic */
.hot-topic-section {
  padding: 24px 32px 8px;
  max-width: 760px;
  margin: 0 auto;
}
.hot-topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 20px;
}
.hot-topic-head h2 {
  font-size: 1.8rem;
  margin: 0;
}
.hot-topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  white-space: nowrap;
}
.hot-topic-card {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.hot-topic-card:hover {
  transform: translateY(-3px);
  border-color: var(--cat-color, var(--accent));
}
.hot-topic-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--cat-color, var(--accent));
}
.hot-topic-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--cat-color, transparent), transparent 45%);
  opacity: 0.12;
  pointer-events: none;
}
.hot-cat {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--cat-color, var(--accent));
  margin-bottom: 14px;
}
.hot-topic-card h3 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--text);
}
.hot-topic-card p {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 18px;
}
.hot-topic-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cat-color, var(--accent));
}
.hot-topic-cta::after {
  content: "→";
  transition: transform 0.2s;
}
.hot-topic-card:hover .hot-topic-cta {
  transform: translateX(3px);
}
.hot-topic-meta {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.hot-topic-loading {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Featured Experiment / What I'm Working On */
.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-head {
  text-align: center;
  margin-bottom: 24px;
}

.section-head h2 {
  margin-bottom: 8px;
}

.section-head p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}

.featured-experiment {
  padding-bottom: 32px;
}

.experiment-card {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 32px;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.experiment-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.experiment-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
}

.experiment-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.experiment-card h3 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 12px;
}

.experiment-card p {
  font-size: 1.02rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.experiment-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}

.experiment-cta::after {
  content: "→";
  transition: transform 0.2s;
}

.experiment-card:hover .experiment-cta {
  transform: translateX(3px);
}

.experiment-meta {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

.experiment-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
  font-size: 0.9rem;
}

/* VelsTech Lab – boxed card, not full-width band */
.lab-section {
  max-width: 760px;
  margin: 48px auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.lab-section .section-head {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.lab-section .eyebrow {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 780px) {
  .lab-section {
    margin: 32px 16px;
    padding: 24px 20px;
  }
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.lab-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  transition: transform 0.15s, border-color 0.2s;
}

.lab-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.lab-icon {
  font-size: 1.5rem;
}

.lab-card h3 {
  margin: 12px 0 8px;
  font-size: 1.05rem;
}

.lab-card p {
  font-size: 0.92rem;
  color: var(--muted);
}

.lab-cta {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* About – VelsTech Tested */
.about-tested {
  margin-top: 16px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 0.95rem;
}

.tested-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
}

/* ===== Tools ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.tool-card {
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  transition: transform 0.15s, border-color 0.2s;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.tool-card-icon {
  font-size: 1.6rem;
  color: var(--accent);
}

.tool-card h3 {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 1.05rem;
}

.tool-card p {
  font-size: 0.95rem;
  color: var(--muted);
}

.tool-card-cta {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

/* Calculator layout */
.calc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.calc-subgrid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--accent);
}

.calc-results {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.result-verdict {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.55;
}

.verdict-ok {
  background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.4);
}

.verdict-warn {
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.4);
}

.verdict-no {
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.4);
}

.result-rows {
  display: flex;
  flex-direction: column;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.result-row span {
  color: var(--muted);
}

.result-row strong {
  color: var(--text);
  text-align: right;
}

.result-row.total {
  border-bottom: none;
  font-size: 1.05rem;
}

.result-row.total strong {
  color: var(--accent);
}

.tool-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.calc-method {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.calc-method summary {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.calc-method summary::-webkit-details-marker { display: none; }
.calc-method summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  transition: transform 0.15s;
}
.calc-method[open] summary::before { transform: rotate(90deg); }
.calc-method summary:hover { color: var(--accent); }

.calc-method-body {
  padding: 0 16px 16px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
  border-top: 1px solid var(--border);
}

.calc-method-body h4 {
  font-size: 0.95rem;
  margin: 16px 0 6px;
  color: var(--text);
}

.calc-method-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 8px 0;
  line-height: 1.5;
}

.calc-method-body p {
  margin: 8px 0;
  color: var(--muted);
}

/* In-article tool callout */
.tool-callout {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-soft);
}

.tool-callout .tool-callout-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.tool-callout p {
  margin: 4px 0 10px;
  font-size: 0.95rem;
  color: var(--muted);
}

.tool-callout .btn {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Tool list editors (Docker compose, env vars, ports…) */
.kv-list {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.kv-row .input {
  flex: 1;
}

.kv-remove {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.kv-remove:hover {
  border-color: var(--accent);
  color: var(--text);
}

.add-btn {
  justify-self: start;
  margin-top: 2px;
}

.gen-out {
  margin: 18px 0 0;
}

.gen-out pre {
  margin: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.preset-chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.preset-chip:hover,
.preset-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Permission editor (chmod) */
.perm-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
}

.perm-group legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 6px;
}

.perm-bit {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.perm-bit input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Textarea-based tools (JSON, regex, etc.) */
.tool-textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}

.tool-textarea:focus {
  border-color: var(--accent);
}

.tool-textarea.error {
  border-color: rgba(244, 114, 182, 0.5);
}

.tool-out {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.tool-out .json-key { color: var(--accent); }
.tool-out .json-string { color: #3ddc97; }
.tool-out .json-number { color: #fb923c; }
.tool-out .json-bool { color: #f472b6; }
.tool-out .json-null { color: #a78bfa; }

.match-hl { background: rgba(76, 194, 255, 0.3); border-radius: 2px; }
.match-grp { background: rgba(167, 139, 250, 0.25); border-radius: 2px; }

.tool-radio-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.tool-radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.tool-radio-row input { accent-color: var(--accent); }

.tool-info {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Color converter */
.color-swatch {
  width: 100%;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.color-input {
  width: 64px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-row .input {
  flex: 1;
  min-width: 0;
}

/* Diff checker */
.diff-out {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

.diff-line {
  display: block;
  padding: 0 12px;
}

.diff-add { background: rgba(61, 220, 151, 0.14); }
.diff-del { background: rgba(244, 114, 182, 0.14); }
.diff-unchanged { color: var(--muted); }
.diff-meta { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

/* Newsletter */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--accent);
}

.newsletter-list {
  margin: 14px 0 8px 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.newsletter-list li {
  margin: 4px 0;
}

.newsletter-note {
  font-size: 0.88rem;
  margin-top: 10px;
}

/* ===== Polish ===== */

/* Anchor links clear the sticky nav */
section[id],
article[id],
[id^="featured"],
[id="topics"],
[id="lab"],
[id="tools"],
[id="latest"],
[id="about"] {
  scroll-margin-top: 88px;
}
html {
  scroll-padding-top: 88px;
}

/* Keyboard focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Back-to-top */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s, color 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Mobile: tighter code/pre so wide tables don't scroll as much */
@media (max-width: 640px) {
  .article-body pre,
  .calc-method-body pre {
    font-size: 0.78rem;
    padding: 12px;
  }
  .tool-out,
  .diff-out {
    font-size: 0.78rem;
  }
}

/* Layout utilities replacing inline style hacks */
.full {
  grid-column: 1 / -1;
}
.stack-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.stack-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-28 { margin-top: 28px; }
.mb-10 { margin-bottom: 10px; }
.mt-18-center { margin: 18px auto 0; text-align: center; }
.pt-0 { padding-top: 0; }
.article.planned {
  opacity: 0.9;
  border-style: dashed;
}
.tool-callout .btn + .btn {
  margin-left: 8px;
}
.lab-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.method-list {
  margin: 14px 0 14px 24px;
  line-height: 1.7;
  color: var(--text);
}
.break-all {
  word-break: break-all;
}
.mono-list {
  font-family: var(--mono, monospace);
}
.status-done {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.4);
}
.status-planned {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.4);
}
.meta-date {
  font-size: 0.75rem;
  color: var(--muted);
}
.subheading {
  font-size: 1rem;
  margin: 16px 0 8px;
}
.muted-note {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Print */
@media print {
  .nav,
  .footer,
  .progress-bar,
  .back-to-top,
  .vt-bubble,
  .vt-panel,
  .article-flow,
  .article-nav,
  .tool-callout,
  .copy-btn,
  .search-wrap,
  .controls {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  a {
    color: #000 !important;
    text-decoration: underline;
  }
  .article-body pre,
  .calc-method-body pre,
  .tool-out,
  .diff-out,
  .code-block pre {
    background: #f6f6f6 !important;
    border-color: #ddd !important;
    color: #111 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .article-body code {
    background: #f0f0f0 !important;
    border-color: #ddd !important;
    color: #111 !important;
  }
}

/* ===== Mobile overrides (must stay after base rules to win the cascade) ===== */
@media (max-width: 640px) {
  .hero {
    padding: 72px 20px 48px;
  }
  .section,
  .page-hero,
  .article-grid,
  .article-page {
    padding-left: 20px;
    padding-right: 20px;
  }
  /* Tools on mobile */
  .calc {
    padding: 16px;
    margin: 16px 0;
  }
  .calc-grid,
  .calc-subgrid {
    gap: 10px;
  }
  .calc-subgrid {
    padding: 10px;
  }
  .result-row strong {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .result-verdict {
    font-size: 0.9rem;
  }
  .tool-radio-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .kv-row .input {
    min-width: 0;
  }
  .tool-textarea {
    min-height: 140px;
  }
  .preset-row {
    gap: 6px;
  }
}

/* Linux command cheat sheet */
.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 16px 0 28px;
}

.cheat-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 0.9rem;
}

.cheat-item code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.cheat-item span {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Hash generator – long digests need to wrap */
.hash-val {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.75rem;
  word-break: break-all;
  text-align: right;
  max-width: 60%;
  line-height: 1.4;
}

/* Topic hub (learning progression) */
.hub {
  max-width: 1100px;
  margin: 28px auto 0;
  padding: 0 32px 64px;
}

.hub-tier {
  margin-bottom: 34px;
}

.hub-tier-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.hub-tier-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--accent);
  white-space: nowrap;
}

/* TA/HI labels are long agglutinative words – nowrap overflows phones */
html[lang="ta"] .hub-tier-label,
html[lang="hi"] .hub-tier-label {
  white-space: normal;
}

.hub-tier-title {
  font-size: 1.3rem;
  letter-spacing: -0.3px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.hub-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}

.hub-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hub-card h4 {
  font-size: 1rem;
  margin-bottom: 5px;
  line-height: 1.35;
}

.hub-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.hub-card .hub-meta {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

.hub-card.soon {
  opacity: 0.55;
  border-style: dashed;
  cursor: default;
}

.hub-card.soon:hover {
  border-color: var(--border);
  transform: none;
}

/* Buying guides hub */
.buy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0 24px;
}

.buy-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}

.buy-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.buy-card h3 {
  font-size: 1.05rem;
  line-height: 1.35;
}

.buy-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.buy-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.buy-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}

/* Spec comparison table (article) */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.spec-table th,
.spec-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.spec-table th {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.spec-table td:first-child {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.spec-table tbody tr:last-child td {
  border-bottom: none;
}


/* Onboarding / learning path */
.path-intro {
  font-size: 1.05rem;
  margin: 10px 0 26px;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.path-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.path-card h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.path-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.path-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0;
}

.path-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s;
}

.path-step:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.path-step .step-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.8rem;
  min-width: 20px;
}

.path-card .path-more {
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
}

.path-card .path-more a {
  color: var(--accent);
  text-decoration: none;
}

.path-card .path-more a:hover {
  text-decoration: underline;
}

.start-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 0;
}

/* Tool category nav + headings */
.tool-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.tool-cat-nav a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.tool-cat-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tool-cat-heading {
  font-size: 1.3rem;
  margin: 34px 0 14px;
  scroll-margin-top: 90px;
  letter-spacing: -0.3px;
}

/* Article-bottom CTA stack (newsletter + gear) */
.cta-stack {
  margin: 34px 0 0;
  display: grid;
  gap: 16px;
}

.cta-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  background: var(--bg-soft);
  min-width: 0;
  overflow-wrap: anywhere;
}

.cta-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: -0.2px;
}

.cta-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.cta-card .newsletter-form {
  margin: 12px 0 0;
}

.cta-card .form-status {
  font-size: 0.88rem;
  margin: 8px 0 0;
}

.cta-gear-links {
  margin: 6px 0 8px;
  font-size: 0.98rem;
  line-height: 1.8;
}

.cta-gear-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-deep);
}

.cta-gear-links a:hover {
  border-bottom-style: solid;
}

.cta-gear-note {
  font-size: 0.8rem !important;
  color: var(--muted);
  opacity: 0.85;
}
.search-result.is-active { background: var(--accent-soft); }

/* Pillar: Local AI complete path */
.pillar-card {
  margin: 34px 0 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 16px;
  background: var(--bg-soft);
}

.pillar-head {
  margin-bottom: 12px;
}

.pillar-title {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.pillar-desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.pillar-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
}

.pillar-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}

.pillar-step:hover {
  border-color: var(--accent);
}

.pillar-step.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
  cursor: default;
}

.pillar-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  font-size: 0.72rem;
  font-weight: 700;
}

.pillar-step.is-active .pillar-num {
  background: var(--accent);
  color: #06121f;
}

.pillar-sep {
  color: var(--muted);
  opacity: 0.6;
  font-size: 0.8rem;
  padding: 0 1px;
}

@media (max-width: 560px) {
  .pillar-path { gap: 6px; }
  .pillar-sep { display: none; }
}
