/* =========================================================
   TextBases Theme System V1
   Applies design tokens globally.
   ========================================================= */

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

html {
  background: var(--tb-bg);
  color: var(--tb-text);
  font-family: var(--tb-font-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--tb-bg-gradient);
  color: var(--tb-text);
  font-family: var(--tb-font-main);
  overflow-x: hidden;
}

::selection {
  color: var(--tb-bg);
  background: var(--tb-accent);
}

a {
  color: var(--tb-accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: color var(--tb-transition), border-color var(--tb-transition), background var(--tb-transition);
}

a:hover {
  color: #7dd3fc;
}

p,
li {
  color: rgba(203, 213, 225, 0.86);
  line-height: 1.75;
}

h1,
h2,
h3,
h4 {
  color: var(--tb-text);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.35rem, 7vw, 5.7rem);
}

h2 {
  font-size: clamp(1.55rem, 4vw, 2.45rem);
}

h3 {
  font-size: clamp(1.08rem, 2.4vw, 1.32rem);
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

pre,
code {
  font-family: var(--tb-font-mono);
}

.tb-page {
  width: min(100%, var(--tb-container));
  max-width: var(--tb-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--tb-page-pad);
  padding-right: var(--tb-page-pad);
}

.tb-section {
  margin-top: var(--tb-section-gap);
}

.tb-hero {
  padding-top: clamp(42px, 7vw, 86px);
  padding-bottom: clamp(24px, 5vw, 54px);
}

.tb-lead {
  max-width: 790px;
  font-size: clamp(1.04rem, 2vw, 1.24rem);
  color: rgba(203, 213, 225, 0.84);
}

.tb-badge,
.tb-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--tb-border);
  background: var(--tb-accent-soft);
  color: #bae6fd;
  border-radius: var(--tb-radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
}

.tb-badge {
  padding: 8px 12px;
  margin-bottom: 16px;
}

.tb-pill {
  padding: 7px 11px;
}

.tb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tb-breadcrumb,
.tb-back-home {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--tb-muted);
  font-size: 0.92rem;
}

.tb-breadcrumb {
  margin-top: 22px;
}

.tb-back-home {
  width: fit-content;
  margin-top: 12px;
}

@media (max-width: 760px) {
  :root {
    --tb-page-pad: 16px;
    --tb-card-pad: 18px;
  }

  .tb-page {
    width: 100%;
    max-width: 100%;
  }

  .tb-hero {
    padding-top: 34px;
  }
}
