/* ==========================================================================
   TranscodeX — Base, layout & site chrome
   Requires design-tokens.css
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--tx-bg);
  color: var(--tx-ink);
  font-family: var(--tx-font);
  font-size: var(--tx-fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--tx-font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--tx-ink);
}

h1 { font-size: var(--tx-fs-h1); }
h2 { font-size: var(--tx-fs-h2); }
h3 { font-size: var(--tx-fs-h3); line-height: 1.2; }

p { margin: 0 0 1em; }

a { color: var(--tx-primary-deep); text-decoration: none; }
a:hover { color: var(--tx-primary); }

img, svg, video { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: 1.2em; }

strong { font-weight: 800; }

::selection { background: var(--tx-highlight); color: var(--tx-ink); }

:focus-visible {
  outline: 3px solid var(--tx-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Decorative background ------------------------------------------------- */

.tx-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px 520px at 10% -6%, rgba(155, 123, 255, 0.22), transparent 62%),
    radial-gradient(640px 480px at 96% 4%, rgba(91, 157, 249, 0.18), transparent 60%),
    radial-gradient(620px 520px at 50% 108%, rgba(63, 201, 148, 0.14), transparent 62%),
    var(--tx-bg);
}

.tx-bg::before,
.tx-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
}

.tx-bg::before {
  width: 260px;
  height: 260px;
  left: -80px;
  top: 34%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 158, 122, 0.5), transparent 70%);
}

.tx-bg::after {
  width: 320px;
  height: 320px;
  right: -110px;
  bottom: 8%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 207, 77, 0.4), transparent 70%);
}

/* Layout ---------------------------------------------------------------- */

.tx-container {
  width: 100%;
  max-width: var(--tx-max);
  margin: 0 auto;
  padding: 0 24px;
}

.tx-site { display: flex; flex-direction: column; min-height: 100vh; }
.tx-main { flex: 1; }
.tx-main--page { padding: 32px 0 88px; }

.tx-hidden { display: none !important; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Type helpers ---------------------------------------------------------- */

.tx-display {
  font-family: var(--tx-font-display);
  font-size: var(--tx-fs-display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 0.35em;
}

.tx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--tx-font);
  font-size: var(--tx-fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tx-primary-deep);
  background: var(--tx-surface-lilac);
  border: 1px solid rgba(109, 74, 255, 0.18);
  border-radius: var(--tx-radius-pill);
  padding: 7px 15px;
  margin: 0 0 20px;
}

.tx-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--tx-ink-2);
  max-width: 58ch;
}

/* Header ---------------------------------------------------------------- */

.tx-header {
  position: sticky;
  top: 14px;
  z-index: 100;
  padding-top: 14px;
}

.tx-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 9px 10px 9px 20px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-pill);
  box-shadow: var(--tx-shadow-soft);
}

.tx-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--tx-font-display);
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--tx-ink);
  letter-spacing: -0.01em;
}

.tx-brand:hover { color: var(--tx-ink); }

.tx-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--tx-grad-brand);
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(109, 74, 255, 0.6);
  flex: none;
}

.tx-brand-mark svg { width: 22px; height: 22px; }

.custom-logo-link img,
.transcodex-logo-link img { max-height: 40px; width: auto; }

.tx-nav { display: flex; align-items: center; gap: 6px; }

.tx-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tx-menu a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--tx-radius-pill);
  color: var(--tx-ink-2);
  font-size: var(--tx-fs-sm);
  font-weight: 700;
  transition: background var(--tx-t) var(--tx-ease-out), color var(--tx-t) var(--tx-ease-out), transform var(--tx-t) var(--tx-ease);
}

.tx-menu a:hover {
  background: var(--tx-surface-lilac);
  color: var(--tx-primary-deep);
  transform: translateY(-1px);
}

.tx-menu .current-menu-item > a,
.tx-menu .current_page_item > a {
  background: var(--tx-surface-2);
  color: var(--tx-ink);
}

.tx-header-cta { margin-left: 8px; }

/* Mobile nav ------------------------------------------------------------ */

.tx-nav-toggle {
  display: none;
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  border-radius: 14px;
  width: 46px;
  height: 46px;
  color: var(--tx-ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform var(--tx-t) var(--tx-ease), background var(--tx-t);
}

.tx-nav-toggle:hover { background: var(--tx-surface-2); transform: scale(1.05); }

.tx-nav-panel {
  display: none;
  margin-top: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-lg);
  box-shadow: var(--tx-shadow-soft);
}

.tx-nav-panel.tx-open { display: block; animation: txDropIn var(--tx-t) var(--tx-ease-out); }

.tx-nav-panel .tx-menu { flex-direction: column; align-items: stretch; gap: 4px; }

.tx-nav-panel .tx-menu a { padding: 14px 16px; font-size: 1.05rem; }

.tx-nav-cta { margin-top: 12px; }

@keyframes txDropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Buttons --------------------------------------------------------------- */

.tx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--tx-radius-pill);
  font-family: var(--tx-font);
  font-size: var(--tx-fs-sm);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--tx-t) var(--tx-ease), box-shadow var(--tx-t) var(--tx-ease-out),
              background var(--tx-t) var(--tx-ease-out), color var(--tx-t), border-color var(--tx-t);
}

.tx-btn svg { width: 18px; height: 18px; flex: none; }

.tx-btn--primary {
  background: var(--tx-grad-brand);
  color: #fff;
  box-shadow: var(--tx-shadow-pop), 0 14px 26px -14px rgba(109, 74, 255, 0.75);
}

.tx-btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(83, 51, 214, 0.28), 0 20px 34px -14px rgba(109, 74, 255, 0.8);
}

.tx-btn--primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(83, 51, 214, 0.28);
}

.tx-btn--mint {
  background: var(--tx-grad-mint);
  color: #fff;
  box-shadow: var(--tx-shadow-pop-mint), 0 14px 26px -14px rgba(47, 168, 118, 0.7);
}

.tx-btn--mint:hover { color: #fff; transform: translateY(-2px); }
.tx-btn--mint:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(47, 168, 118, 0.3); }

.tx-btn--ghost {
  background: var(--tx-surface);
  color: var(--tx-ink);
  border-color: var(--tx-line-strong);
  box-shadow: 0 3px 0 rgba(43, 37, 64, 0.08);
}

.tx-btn--ghost:hover {
  color: var(--tx-ink);
  border-color: var(--tx-primary-2);
  background: var(--tx-surface);
  transform: translateY(-2px);
}

.tx-btn--ghost:active { transform: translateY(1px); box-shadow: none; }

.tx-btn--soft {
  background: var(--tx-surface-lilac);
  color: var(--tx-primary-deep);
}

.tx-btn--soft:hover { color: var(--tx-primary-deep); background: #e9e0ff; transform: translateY(-2px); }

.tx-btn:disabled,
.tx-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* Pills / tags ---------------------------------------------------------- */

.tx-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--tx-radius-pill);
  background: var(--tx-surface-2);
  border: 1px solid var(--tx-line);
  font-size: var(--tx-fs-xs);
  font-weight: 800;
  color: var(--tx-ink-2);
}

/* Hero ------------------------------------------------------------------ */

.tx-hero {
  position: relative;
  padding: 64px 0 24px;
  text-align: center;
}

.tx-hero .tx-display {
  max-width: 17ch;
  margin-left: auto;
  margin-right: auto;
}

.tx-hero-sub {
  max-width: 56ch;
  margin: 0 auto 32px;
  color: var(--tx-ink-2);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

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

.tx-hero-actions .tx-btn { font-size: 1.02rem; padding: 15px 30px; }

.tx-hero-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tx-hero-badges li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: var(--tx-radius-pill);
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  box-shadow: 0 2px 0 rgba(43, 37, 64, 0.05);
  font-size: var(--tx-fs-xs);
  font-weight: 800;
  color: var(--tx-ink-2);
}

.tx-hero-badges svg { width: 15px; height: 15px; color: var(--tx-accent); }

/* Hero artwork ---------------------------------------------------------- */

.tx-hero-art {
  position: relative;
  width: min(420px, 78vw);
  margin: 0 auto 8px;
  pointer-events: none;
}

.tx-mascot {
  display: block;
  width: 100%;
  height: auto;
}

.tx-hero-art .tx-mascot {
  animation: txFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 26px 34px rgba(83, 51, 214, 0.28));
}

.tx-float-tag {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--tx-radius-pill);
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  box-shadow: var(--tx-shadow-soft);
  font-size: var(--tx-fs-xs);
  font-weight: 800;
  color: var(--tx-ink);
  white-space: nowrap;
  animation: txFloat 5s ease-in-out infinite;
}

.tx-float-tag--1 { top: 8%; left: -12%; animation-delay: -0.4s; color: var(--tx-primary-deep); }
.tx-float-tag--2 { top: 30%; right: -14%; animation-delay: -1.6s; color: #1f7a55; }
.tx-float-tag--3 { bottom: 26%; left: -16%; animation-delay: -2.4s; color: #b46a12; }
.tx-float-tag--4 { bottom: 6%; right: -10%; animation-delay: -3.1s; color: var(--tx-ink-2); }

.tx-sparkle {
  position: absolute;
  color: var(--tx-highlight);
  animation: txTwinkle 3.4s ease-in-out infinite;
}

.tx-sparkle--a { top: -4%; right: 8%; width: 34px; animation-delay: -0.8s; }
.tx-sparkle--b { bottom: 12%; left: 4%; width: 24px; color: var(--tx-pink); animation-delay: -1.8s; }

@keyframes txFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes txTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.18) rotate(12deg); opacity: 1; }
}

/* Pipeline journey ------------------------------------------------------ */

.tx-pipeline { margin: 56px auto 0; max-width: 940px; }

.tx-pipeline-track {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
}

.tx-arrow {
  align-self: center;
  color: var(--tx-primary-2);
  flex: none;
}

.tx-pipe-card {
  flex: 1;
  max-width: 260px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 26px 18px;
  border-radius: var(--tx-radius-lg);
  border: 1px solid var(--tx-line);
  background: var(--tx-surface);
  box-shadow: var(--tx-shadow-soft);
  transition: transform var(--tx-t) var(--tx-ease), box-shadow var(--tx-t) var(--tx-ease-out);
}

.tx-pipe-card:hover { transform: translateY(-5px); box-shadow: var(--tx-shadow-lift); }

.tx-pipe-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  background: var(--tx-surface-lilac);
  color: var(--tx-primary-deep);
}

.tx-pipe-label { font-family: var(--tx-font-display); font-weight: 800; font-size: 1.02rem; color: var(--tx-ink); }
.tx-pipe-sub { color: var(--tx-ink-3); font-size: var(--tx-fs-xs); margin: 0; }

.tx-pipe-core {
  background: var(--tx-grad-brand);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--tx-shadow-pop), 0 26px 40px -22px rgba(109, 74, 255, 0.8);
  animation: txPulse 3.6s ease-in-out infinite;
}

.tx-pipe-core .tx-pipe-label { color: #fff; }
.tx-pipe-core .tx-pipe-sub { color: rgba(255, 255, 255, 0.85); }
.tx-pipe-core .tx-pipe-icon { background: rgba(255, 255, 255, 0.2); color: #fff; }

.tx-pipe-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tx-surface-mint);
  color: var(--tx-success);
}

@keyframes txPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Sections -------------------------------------------------------------- */

.tx-section { padding: 72px 0; }
.tx-section--tint {
  background: linear-gradient(180deg, transparent, var(--tx-bg-tint) 12%, var(--tx-bg-tint) 88%, transparent);
}

.tx-section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.tx-section-head h2 { margin-bottom: 12px; }
.tx-section-head p { color: var(--tx-ink-2); font-size: 1.05rem; margin: 0; }

/* Feature cards --------------------------------------------------------- */

.tx-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.tx-card {
  position: relative;
  border-radius: var(--tx-radius-lg);
  border: 1px solid var(--tx-line);
  background: var(--tx-surface);
  box-shadow: var(--tx-shadow-soft);
  padding: 30px 28px;
  transition: transform var(--tx-t) var(--tx-ease), box-shadow var(--tx-t) var(--tx-ease-out), border-color var(--tx-t);
}

.tx-card:hover { transform: translateY(-6px); box-shadow: var(--tx-shadow-lift); border-color: var(--tx-line-strong); }

.tx-grid-3 > .tx-card:nth-child(3n + 1) { background: var(--tx-surface-lilac); }
.tx-grid-3 > .tx-card:nth-child(3n + 2) { background: var(--tx-surface-mint); }
.tx-grid-3 > .tx-card:nth-child(3n + 3) { background: var(--tx-surface-butter); }

.tx-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tx-surface);
  color: var(--tx-primary-deep);
  box-shadow: 0 4px 0 rgba(43, 37, 64, 0.08);
  margin-bottom: 18px;
}

.tx-card h3 { margin-bottom: 8px; }
.tx-card p { color: var(--tx-ink-2); margin: 0; font-size: var(--tx-fs-sm); }

/* Steps ----------------------------------------------------------------- */

.tx-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  counter-reset: step;
}

.tx-step {
  position: relative;
  border-radius: var(--tx-radius-lg);
  border: 1px solid var(--tx-line);
  background: var(--tx-surface);
  box-shadow: var(--tx-shadow-soft);
  padding: 34px 24px 26px;
  transition: transform var(--tx-t) var(--tx-ease);
}

.tx-step:hover { transform: translateY(-5px); }

.tx-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -16px;
  left: 24px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tx-grad-sun);
  color: #6b4700;
  font-family: var(--tx-font-display);
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 0 rgba(180, 106, 18, 0.28);
}

.tx-step-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tx-surface-lilac);
  color: var(--tx-primary-deep);
  margin-bottom: 16px;
}

.tx-step h3 { font-size: 1.06rem; margin-bottom: 6px; }
.tx-step p { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); margin: 0; }

/* CTA band -------------------------------------------------------------- */

.tx-cta-band {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 72px 32px;
  border-radius: var(--tx-radius-xl);
  border: 1px solid var(--tx-line);
  background:
    radial-gradient(620px 320px at 50% -30%, rgba(155, 123, 255, 0.35), transparent 70%),
    radial-gradient(400px 260px at 88% 120%, rgba(63, 201, 148, 0.28), transparent 70%),
    var(--tx-surface);
  box-shadow: var(--tx-shadow-soft);
}

.tx-cta-band h2 { margin-bottom: 12px; }
.tx-cta-band p { color: var(--tx-ink-2); margin: 0 auto 28px; max-width: 46ch; }

/* Page hero (inner pages) ----------------------------------------------- */

.tx-page-hero { text-align: center; padding: 40px 0 8px; }
.tx-page-hero h1 { margin-bottom: 10px; }
.tx-page-hero p { color: var(--tx-ink-2); max-width: 62ch; margin: 0 auto; font-size: 1.08rem; }

/* Typographic content --------------------------------------------------- */

.tx-content { max-width: 780px; margin: 0 auto; }
.tx-content h2 { margin-top: 1.6em; }
.tx-content h3 { margin-top: 1.4em; }
.tx-content p, .tx-content li { color: var(--tx-ink-2); }
.tx-content > p:first-of-type { font-size: 1.12rem; color: var(--tx-ink); }
.tx-content a { text-decoration: underline; text-decoration-color: var(--tx-primary-2); text-underline-offset: 3px; }
.tx-content code {
  font-family: var(--tx-mono);
  background: var(--tx-surface-2);
  border: 1px solid var(--tx-line);
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 0.88em;
}
.tx-content img { border-radius: var(--tx-radius-md); }
.tx-content figure { margin: 1.6em 0; }
.tx-content blockquote {
  border-left: 5px solid var(--tx-primary-2);
  background: var(--tx-surface-lilac);
  border-radius: 0 var(--tx-radius-md) var(--tx-radius-md) 0;
  margin: 1.6em 0;
  padding: 16px 22px;
  color: var(--tx-ink);
}
.tx-content table { width: 100%; border-collapse: collapse; }
.tx-content th, .tx-content td { border: 1px solid var(--tx-line); padding: 10px 12px; text-align: left; }
.tx-table-scroll { overflow-x: auto; }

/* Blog ------------------------------------------------------------------ */

.tx-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tx-card--link {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--tx-surface);
}

.tx-post-grid > .tx-card { background: var(--tx-surface); }

.tx-card-thumb { display: block; overflow: hidden; }
.tx-card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform var(--tx-t-slow) var(--tx-ease-out);
}
.tx-card--link:hover .tx-card-thumb img { transform: scale(1.05); }

.tx-card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tx-card-title { font-size: 1.22rem; margin: 0; line-height: 1.2; }
.tx-card-title a { color: var(--tx-ink); }
.tx-card-title a:hover { color: var(--tx-primary-deep); }
.tx-card-meta {
  color: var(--tx-ink-3);
  font-size: var(--tx-fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}
.tx-card-excerpt { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); margin: 0; }
.tx-card-more { margin-top: auto; font-weight: 800; color: var(--tx-primary-deep); }

.tx-post-layout { max-width: 100%; }
.tx-post-main { max-width: 780px; margin: 0 auto; }
.tx-post-thumb img { width: 100%; border-radius: var(--tx-radius-lg); }

.tx-comments { max-width: 780px; margin: 48px auto 0; }

.tx-reading-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 120;
  pointer-events: none;
}

.tx-reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0 4px 4px 0;
  background: var(--tx-grad-brand);
  transition: width 0.1s linear;
}

.tx-pagination { display: flex; justify-content: center; margin: 48px 0 8px; }
.tx-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.tx-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--tx-radius-pill);
  border: 1px solid var(--tx-line);
  background: var(--tx-surface);
  font-weight: 800;
  color: var(--tx-ink-2);
}
.tx-pagination .page-numbers:hover { border-color: var(--tx-primary-2); color: var(--tx-primary-deep); }
.tx-pagination .page-numbers.current { background: var(--tx-grad-brand); color: #fff; border-color: transparent; }

/* Callouts & compatibility --------------------------------------------- */

.tx-callout {
  border-radius: var(--tx-radius-lg);
  border: 1px solid var(--tx-line);
  background: var(--tx-surface);
  box-shadow: var(--tx-shadow-soft);
  padding: 22px 24px;
  margin: 18px 0;
  font-size: var(--tx-fs-sm);
  color: var(--tx-ink-2);
}
.tx-callout strong { color: var(--tx-ink); }
.tx-callout--info { background: var(--tx-surface-blue); border-color: #cfe4ff; }
.tx-callout--warn { background: var(--tx-surface-butter); border-color: #f6e2a4; }

.tx-compat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.tx-compat {
  padding: 18px 20px;
  border-radius: var(--tx-radius-lg);
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  box-shadow: var(--tx-shadow-soft);
}
.tx-compat-name { font-family: var(--tx-font-display); font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.tx-compat-detail { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); margin: 0; }

/* How it works ---------------------------------------------------------- */

.tx-how-panel { max-width: 1040px; }
.tx-how-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.tx-how-note { text-align: center; color: var(--tx-ink-3); font-size: var(--tx-fs-sm); margin-top: 20px; }

/* Alerts (shared) ------------------------------------------------------- */

.tx-alert {
  padding: 15px 18px;
  border-radius: var(--tx-radius-md);
  border: 1px solid var(--tx-line);
  font-size: var(--tx-fs-sm);
  font-weight: 600;
  margin-top: 18px;
}
.tx-alert--warn { background: var(--tx-surface-butter); border-color: #f6e2a4; color: #8a5a06; }

/* Footer ---------------------------------------------------------------- */

.tx-footer {
  margin-top: 40px;
  padding: 56px 0 36px;
  background: var(--tx-surface-2);
  border-top: 1px solid var(--tx-line);
}

.tx-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.tx-footer-brand {
  font-family: var(--tx-font-display);
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.tx-footer-about { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); margin: 0; max-width: 34ch; }

.tx-footer h4 {
  font-family: var(--tx-font);
  font-size: var(--tx-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tx-ink-3);
  margin: 0 0 14px;
}

.tx-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.tx-footer a { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); font-weight: 600; }
.tx-footer a:hover { color: var(--tx-primary-deep); }

.tx-footer-bottom {
  border-top: 1px solid var(--tx-line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--tx-ink-3);
  font-size: var(--tx-fs-xs);
  font-weight: 600;
}

.tx-stat-value {
  font-family: var(--tx-font-display);
  font-size: 1.3rem;
  font-weight: 800;
  margin: 4px 0;
}

.tx-stat-value--ok { color: var(--tx-success-ink); }
.tx-stat-value--muted { color: var(--tx-ink-3); }

/* 404 ------------------------------------------------------------------- */

.tx-error { text-align: center; padding: 56px 0 72px; }

.tx-error-art {
  width: 150px;
  margin: 0 auto 4px;
  animation: txFloat 6s ease-in-out infinite;
  pointer-events: none;
}

.tx-error .tx-actions { justify-content: center; }

.tx-error-code {
  font-family: var(--tx-font-display);
  font-size: clamp(5rem, 16vw, 11rem);
  line-height: 1;
  margin: 0 0 8px;
  background: var(--tx-grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Motion ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Article extras: share, author, comments, to-top ------------------------ */

.tx-post-share {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 34px 0 0;
  padding: 18px 22px;
  border-radius: var(--tx-radius-lg);
  background: var(--tx-surface-2);
  border: 1px solid var(--tx-line);
}

.tx-share-label {
  font-family: var(--tx-font-display);
  font-weight: 800;
  font-size: var(--tx-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tx-ink-2);
  margin: 0;
}

.tx-share-links { display: flex; gap: 10px; flex-wrap: wrap; }

.tx-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--tx-radius-pill);
  border: 1px solid var(--tx-line);
  background: var(--tx-surface);
  font-weight: 800;
  font-size: var(--tx-fs-sm);
  color: var(--tx-ink-2);
  text-decoration: none;
  transition: transform var(--tx-t) var(--tx-ease-out), background var(--tx-t) var(--tx-ease-out), color var(--tx-t) var(--tx-ease-out), border-color var(--tx-t) var(--tx-ease-out);
}
.tx-share svg { width: 17px; height: 17px; flex: none; }
.tx-share:hover { transform: translateY(-2px); border-color: transparent; color: #fff; }
.tx-share--facebook:hover { background: #1877f2; }
.tx-share--x:hover { background: #14171a; }
.tx-share--linkedin:hover { background: #0a66c2; }
.tx-share--whatsapp:hover { background: #25d366; }
.tx-share--mail:hover { background: var(--tx-primary); }

.tx-author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 28px 0 0;
  padding: 26px 28px;
  border-radius: var(--tx-radius-lg);
  background: var(--tx-surface-lilac);
  border: 1px solid #e2d6ff;
  box-shadow: var(--tx-shadow-soft);
}

.tx-author-avatar { flex: none; }
.tx-author-avatar img {
  width: 84px;
  height: 84px;
  border-radius: var(--tx-radius-pill);
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--tx-shadow-pop);
}

.tx-author-role {
  margin: 0 0 2px;
  font-size: var(--tx-fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tx-primary-deep);
}

.tx-author-name {
  font-family: var(--tx-font-display);
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--tx-ink);
  margin: 0 0 6px;
}

.tx-author-bio { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); margin: 0 0 10px; }

.tx-author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: var(--tx-fs-sm);
  color: var(--tx-primary-deep);
  text-decoration: none;
}
.tx-author-link:hover { text-decoration: underline; }

/* Comments -------------------------------------------------------------- */

.tx-comment-title {
  font-family: var(--tx-font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--tx-ink);
  margin: 0 0 4px;
}

.tx-comments-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tx-comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--tx-radius-pill);
  background: var(--tx-grad-brand);
  color: #fff;
  font-size: var(--tx-fs-xs);
  font-weight: 800;
}

.tx-comment-list, .tx-comment-list .children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-comment-list > li > .children { margin: 12px 0 0 40px; }

.tx-comment-list > li {
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-lg);
  padding: 20px 22px;
  box-shadow: var(--tx-shadow-soft);
}

.tx-comment-list .comment-body { display: flex; flex-direction: column; }

.tx-comment-list .comment-author { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tx-comment-list .comment-author .avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--tx-radius-pill);
  border: 3px solid var(--tx-surface-lilac);
}
.tx-comment-list .fn { font-family: var(--tx-font-display); font-weight: 800; color: var(--tx-ink); font-size: 1rem; }

.tx-comment-list .comment-metadata { font-size: var(--tx-fs-xs); color: var(--tx-ink-3); font-weight: 700; margin-left: 0; }
.tx-comment-list .comment-metadata a { color: var(--tx-ink-3); text-decoration: none; }
.tx-comment-list .comment-metadata a:hover { color: var(--tx-primary-deep); }

.tx-comment-list .comment-content { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); margin-top: 6px; }
.tx-comment-list .comment-content p { margin: 0 0 10px; }
.tx-comment-list .comment-content :last-child { margin-bottom: 0; }

.tx-comment-list .reply { margin-top: 12px; }
.tx-comment-list .reply a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--tx-fs-xs);
  font-weight: 800;
  color: var(--tx-primary-deep);
  text-decoration: none;
}
.tx-comment-list .reply a:hover { text-decoration: underline; }

.tx-comment-pagination { margin: 18px 0 0; }
.tx-comment-pagination .nav-links { display: flex; gap: 8px; }

.tx-comments-closed {
  text-align: center;
  color: var(--tx-ink-3);
  font-weight: 700;
  padding: 14px;
  border: 1px dashed var(--tx-line-strong);
  border-radius: var(--tx-radius-md);
}

.comment-form {
  margin-top: 22px;
  background: var(--tx-surface-2);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-lg);
  padding: 24px;
}

.comment-form label {
  display: block;
  font-weight: 800;
  font-size: var(--tx-fs-sm);
  color: var(--tx-ink-2);
  margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--tx-line-strong);
  border-radius: var(--tx-radius-md);
  background: var(--tx-surface);
  padding: 12px 14px;
  font: inherit;
  font-size: var(--tx-fs-sm);
  color: var(--tx-ink);
  box-sizing: border-box;
  transition: border-color var(--tx-t) var(--tx-ease-out), box-shadow var(--tx-t) var(--tx-ease-out);
}

.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--tx-primary-2); box-shadow: var(--tx-ring); }
.comment-form .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; }
.comment-form .comment-form-cookies-consent label { margin: 0; font-size: var(--tx-fs-sm); }

.tx-comment-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  border-radius: var(--tx-radius-pill);
  padding: 13px 28px;
  background: var(--tx-grad-brand);
  box-shadow: var(--tx-shadow-pop);
  color: #fff;
  font: inherit;
  font-family: var(--tx-font-display);
  font-weight: 800;
  font-size: var(--tx-fs-sm);
  transition: transform var(--tx-t) var(--tx-ease-out);
}
.tx-comment-submit:hover { transform: translateY(-2px); }

/* Move to top ----------------------------------------------------------- */

.tx-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 130;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--tx-radius-pill);
  background: var(--tx-grad-brand);
  color: #fff;
  box-shadow: var(--tx-shadow-lift);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--tx-t) var(--tx-ease-out), transform var(--tx-t) var(--tx-ease-out);
}
.tx-to-top svg { width: 24px; height: 24px; }
.tx-to-top.tx-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.tx-to-top:hover { transform: translateY(-3px); }

@media (max-width: 720px) {
  .tx-share { padding: 8px 12px; }
  .tx-share span { display: none; }
  .tx-author-box { flex-direction: column; align-items: center; text-align: center; }
  .tx-comment-list > li > .children { margin-left: 12px; }
  .tx-to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
}

/* About + legal ---------------------------------------------------------- */

.tx-about-banner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 44px 48px;
  border-radius: var(--tx-radius-xl);
  background: var(--tx-surface-lilac);
  border: 1px solid #e2d6ff;
  box-shadow: var(--tx-shadow-soft);
}
.tx-about-banner h2 { font-size: var(--tx-fs-h2); margin: 6px 0 12px; }
.tx-about-banner p { color: var(--tx-ink-2); }
.tx-about-art { text-align: center; }
.tx-about-art .tx-mascot { width: 190px; height: auto; animation: txFloat 6s ease-in-out infinite; pointer-events: none; }

.tx-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tx-value {
  padding: 22px 24px;
  border-radius: var(--tx-radius-lg);
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  box-shadow: var(--tx-shadow-soft);
}
.tx-value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--tx-radius-md);
  background: var(--tx-surface-mint);
  color: var(--tx-success-ink);
  margin-bottom: 12px;
}
.tx-value h3 { font-family: var(--tx-font-display); font-weight: 800; font-size: 1.12rem; margin: 0 0 6px; }
.tx-value p { color: var(--tx-ink-2); font-size: var(--tx-fs-sm); margin: 0; }

.tx-legal { max-width: 860px; }
.tx-legal-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: var(--tx-fs-sm);
  font-weight: 700;
  color: var(--tx-ink-3);
  padding: 0 6px 18px;
}
.tx-legal-meta a { color: var(--tx-primary-deep); }
.tx-legal-card {
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-lg);
  box-shadow: var(--tx-shadow-soft);
  padding: 34px 38px;
  margin-bottom: 56px;
}
.tx-legal-card h2 { margin-top: 1.4em; }
.tx-legal-card h2:first-child { margin-top: 0; }
.tx-legal-card > h2 { padding-top: 0.9em; border-top: 1px dashed var(--tx-line-strong); }
.tx-legal-card > h2:first-of-type { border-top: 0; padding-top: 0; }
.tx-legal-card ul, .tx-legal-card ol { margin: 0.8em 0 1.2em; }
@media (max-width: 900px) {
  .tx-values { grid-template-columns: repeat(2, 1fr); }
  .tx-about-banner { grid-template-columns: 1fr; text-align: center; }
  .tx-hero-actions { justify-content: center; }
}
@media (max-width: 520px) {
  .tx-values { grid-template-columns: 1fr; }
  .tx-about-banner { padding: 30px 24px; }
  .tx-legal-card { padding: 24px 20px; }
}

/* How It Works redesign ----------------------------------------------------- */

.tx-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.tx-compare-card {
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-lg);
  box-shadow: var(--tx-shadow-soft);
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
}
.tx-compare-card--encoder { border-top: 6px solid var(--tx-primary); }
.tx-compare-card--compressor { border-top: 6px solid var(--tx-success); }
.tx-compare-card h3 { font-family: var(--tx-font-display); font-weight: 800; font-size: 1.35rem; margin: 0 0 4px; }
.tx-compare-role { color: var(--tx-ink-3); font-weight: 700; font-size: var(--tx-fs-sm); margin-bottom: 14px; }
.tx-compare-list { list-style: none; margin: 0 0 22px; padding: 0; flex: 1; }
.tx-compare-list li { padding-left: 26px; position: relative; color: var(--tx-ink-2); font-size: var(--tx-fs-sm); padding-bottom: 10px; }
.tx-compare-list li::before {
  content: "";
  position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--tx-surface-mint); border: 2px solid var(--tx-success);
}
.tx-compare-list li.tx-compare-no::before { background: var(--tx-surface-butter); border-color: #e5b53c; }

.tx-gloss {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.tx-gloss-item {
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-lg);
  box-shadow: var(--tx-shadow-soft);
  padding: 20px 24px;
}
.tx-gloss-term {
  display: inline-block;
  font-weight: 800;
  font-size: var(--tx-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tx-primary-deep);
  background: var(--tx-surface-lilac);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
}
.tx-gloss-item p { margin: 0; color: var(--tx-ink-2); font-size: var(--tx-fs-sm); }

.tx-tips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tx-tips li {
  position: relative;
  padding: 12px 0 12px 34px;
  color: var(--tx-ink-2);
  border-bottom: 1px dashed var(--tx-line);
  font-size: var(--tx-fs-sm);
}
.tx-tips li::before {
  content: "";
  position: absolute; left: 0; top: 17px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--tx-surface-mint); 
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E") center/60% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E") center/60% no-repeat;
}

.tx-faq { max-width: 860px; margin: 0 auto; }
.tx-faq details {
  background: var(--tx-surface);
  border: 1px solid var(--tx-line);
  border-radius: var(--tx-radius-md);
  box-shadow: var(--tx-shadow-soft);
  margin-bottom: 12px;
  overflow: hidden;
}
.tx-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 20px;
  font-weight: 800;
  font-family: var(--tx-font-display);
  color: var(--tx-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tx-faq summary::-webkit-details-marker { display: none; }
.tx-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--tx-surface-lilac);
  color: var(--tx-primary-deep);
  font-size: 1.2rem; font-weight: 700;
  transition: transform 0.2s ease;
}
.tx-faq details[open] summary::after { transform: rotate(45deg); }
.tx-faq details[open] summary { color: var(--tx-primary-deep); }
.tx-faq .tx-faq-answer { padding: 0 20px 18px; color: var(--tx-ink-2); font-size: var(--tx-fs-sm); }

@media (max-width: 900px) {
  .tx-compare-grid, .tx-gloss, .tx-tips { grid-template-columns: 1fr; }
}
.tx-factors { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .tx-factors { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tx-factors { grid-template-columns: 1fr; } }
.tx-text-link {
  color: var(--tx-primary-deep);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tx-text-link:hover { color: var(--tx-primary); }
.tx-levels-guide { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .tx-levels-guide { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tx-levels-guide { grid-template-columns: 1fr; } }
