/* ============ Brand & Tokens — css/brand-tokens.css (.t- prefix) ============ */

/* ---------- shared: tooltip (pure CSS, from data-tip) ---------- */
#tokens [data-tip] { position: relative; }
#tokens [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: var(--fg-base);
  color: var(--bg-base-opaque);
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 5px 8px;
  border-radius: var(--radius-8);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 6;
}
#tokens [data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.t-caption { font-size: 11px; color: var(--fg-muted); }

/* ============ 1. Logo mark ============ */
.t-logo-row {
  display: flex; align-items: flex-end; gap: 28px;
}
.t-logo-cell {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--fg-base);
}
.t-logo-cell span { font-size: 11px; color: var(--fg-muted); }
.t-mark { display: block; flex-shrink: 0; }

/* ============ 2. Lockup ============ */
.t-lockup {
  display: block; color: var(--fg-base); max-width: 100%; height: auto;
}

/* ============ 3. App icon ============ */
.t-appicon-row { display: flex; align-items: flex-end; gap: 24px; }
.t-appicon-cell {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.t-appicon-cell span { font-size: 11px; color: var(--fg-muted); }
.t-appicon {
  display: block;
  border-radius: 22.2%;
  box-shadow: var(--shadow-drop), inset 0 0 0 1px var(--border-strong);
}

/* ============ 4. Brand colors ============ */
.t-brandchips {
  display: grid; grid-template-columns: repeat(4, auto);
  gap: 20px 24px; justify-content: center;
}
.t-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.t-chip-swatch {
  width: 56px; height: 56px;
  border-radius: var(--radius-16);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  margin-bottom: 8px;
  transition: transform .18s ease;
}
.t-chip:hover .t-chip-swatch { transform: translateY(-2px) scale(1.04); }
.t-chip-name { font-size: 12px; font-weight: 700; color: var(--fg-base); white-space: nowrap; }
.t-chip-hex { font-size: 11px; color: var(--fg-muted); }
@media (max-width: 980px) {
  .t-brandchips { grid-template-columns: repeat(2, auto); }
}

/* ============ 5. Colors (wide) ============ */
.t-colors {
  width: 100%; display: flex; flex-direction: column; gap: 18px;
}
.t-colors-group { display: flex; flex-direction: column; gap: 8px; }
.t-colors-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px;
}
@media (max-width: 640px) { .t-colors-2col { grid-template-columns: 1fr; } }
.t-group-label {
  font-size: 11px; font-weight: 600; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
/* neutral ramp — 13 contiguous swatches */
.t-ramp {
  display: flex; width: 100%; height: 44px;
  border-radius: var(--radius-8);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.t-ramp-sw { flex: 1; transition: transform .15s ease; }
.t-ramp-sw:first-child { border-radius: var(--radius-8) 0 0 var(--radius-8); }
.t-ramp-sw:last-child { border-radius: 0 var(--radius-8) var(--radius-8) 0; }
.t-ramp-sw:hover { transform: scaleY(1.16); border-radius: var(--radius-4); }
/* functional hue swatches */
.t-sw-row { display: flex; gap: 12px; flex-wrap: wrap; }
.t-sw { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.t-sw i {
  display: block; width: 40px; height: 40px;
  border-radius: var(--radius-10);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: transform .15s ease;
}
.t-sw i:hover { transform: translateY(-2px); }
.t-sw span { font-size: 10px; color: var(--fg-muted); }

/* ============ 6. Semantic tokens ============ */
.t-sem { width: 100%; }
.t-sem-tag {
  display: block;
  font-size: 10px; font-weight: 600; color: var(--fg-muted);
  letter-spacing: .03em;
  margin-bottom: 8px;
}
.t-sem-chat {
  background: var(--bg-chat);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-12);
  padding: 12px;
}
.t-sem-base {
  background: var(--bg-base);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-8);
  padding: 12px;
  box-shadow: var(--shadow-card);
}
.t-sem-base p { margin: 0 0 4px; font-size: 13px; line-height: 18px; }
.t-sem-fg1 { color: var(--fg-base); font-weight: 600; }
.t-sem-fg2 { color: var(--fg-subtle); }
.t-sem-fg3 { color: var(--fg-muted); font-size: 12px !important; }
.t-sem-subtle {
  margin-top: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-8);
  padding: 10px 10px 2px;
}
.t-sem-subtle .t-sem-tag { margin-bottom: 8px; }

/* ============ 7. Gradients (wide) ============ */
.t-grad-grid {
  width: 100%;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px 12px;
}
.t-grad { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.t-grad i {
  display: block; height: 64px;
  border-radius: var(--radius-12);
  box-shadow: inset 0 0 0 1px var(--border-base);
  transition: transform .18s ease, box-shadow .18s ease;
}
.t-grad:hover i { transform: translateY(-2px); box-shadow: var(--shadow-drop); }
.t-grad span {
  font-size: 11px; color: var(--fg-subtle);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .t-grad-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 8. Typography ============ */
.t-type { width: 100%; font-family: var(--font-sans); }
.t-type-display {
  display: flex; align-items: baseline; gap: 24px;
  padding-bottom: 16px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border-strong);
}
.t-aa { display: flex; flex-direction: column; gap: 4px; }
.t-aa em { font-style: normal; font-size: 10px; color: var(--fg-muted); }
.t-aa-1 { font-size: 32px; line-height: 40px; font-weight: var(--fw-black); color: var(--fg-base); }
.t-aa-2 { font-size: 18px; line-height: 26px; font-weight: var(--fw-bold); color: var(--fg-base); }
.t-aa-3 { font-size: 14px; line-height: 20px; font-weight: var(--fw-regular); color: var(--fg-base); }
.t-type-scale { display: flex; flex-direction: column; gap: 6px; }
.t-trow {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.t-trow em { font-style: normal; font-size: 11px; color: var(--fg-muted); white-space: nowrap; }
.t-trow span { color: var(--fg-base); white-space: nowrap; }
.t-th1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-black); }
.t-th2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-black); }
.t-th3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-bold); }
.t-tb1 { font-size: var(--fs-b1); line-height: var(--lh-b1); font-weight: var(--fw-regular); }
.t-tb2 { font-size: var(--fs-b2); line-height: var(--lh-b2); font-weight: var(--fw-regular); }
.t-tb3 { font-size: var(--fs-b3); line-height: var(--lh-b3); font-weight: var(--fw-regular); }
.t-tb4 { font-size: var(--fs-b4); line-height: var(--lh-b4); font-weight: var(--fw-regular); }

/* ============ 9. Radius ============ */
.t-rad-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.t-rad { position: relative; width: 176px; height: 176px; }
.t-rad-ring {
  position: absolute;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
}
.t-r24 { inset: 0;    border-radius: var(--radius-24); }
.t-r20 { inset: 14px; border-radius: var(--radius-20); }
.t-r16 { inset: 28px; border-radius: var(--radius-16); }
.t-r12 { inset: 42px; border-radius: var(--radius-12); }
.t-r8  { inset: 56px; border-radius: var(--radius-8);  }
.t-r4  { inset: 70px; border-radius: var(--radius-4);  }
.t-rad-dot {
  position: absolute; inset: 82px;
  border-radius: var(--radius-full);
  background: var(--fg-brand);
}

/* ============ 10. Spacing ============ */
.t-space {
  width: 100%; max-width: 220px;
  display: flex; flex-direction: column; gap: 16px;
}
.t-space-row { display: flex; align-items: center; gap: 14px; }
.t-space-row span {
  width: 20px; text-align: right;
  font-size: 11px; color: var(--fg-muted);
}
.t-space-row i {
  flex: 1; display: block;
  background: var(--fg-brand);
  border-radius: var(--radius-full);
  opacity: .9;
}

/* ============ 11. Shadows & Glass ============ */
.t-fx-grid {
  display: grid; grid-template-columns: repeat(2, auto);
  gap: 24px 32px; justify-content: center;
}
.t-fx { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.t-fx span { font-size: 11px; color: var(--fg-muted); }
.t-fx-tile {
  width: 80px; height: 56px;
  background: var(--bg-base-opaque);
  border: 1px solid var(--border-base); /* keeps tiles perceivable on dark */
  border-radius: var(--radius-12);
}
.t-fx-glass-wrap {
  position: relative; width: 80px; height: 56px;
  border-radius: var(--radius-12);
  overflow: hidden; /* clip the color blob inside the tile */
  border: 1px solid var(--border-strong);
}
.t-fx-glass-wrap i {
  position: absolute; inset: 12px 16px;
  background: var(--gradient-g5);
  border-radius: var(--radius-full);
  filter: blur(2px);
}
.t-fx-glass {
  position: absolute; inset: 0;
  background: var(--bg-base);
  backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass);
  border-radius: var(--radius-12);
}

/* ============ 12. Alpha ramps ============ */
.t-alpha { width: 100%; max-width: 280px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.t-alpha-group { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.t-alpha-ramp {
  display: flex; gap: 4px; padding: 8px;
  border-radius: var(--radius-10);
  border: 1px solid var(--border-base);
}
.t-alpha-ramp.light { background: #ffffff; }
.t-alpha-ramp.dark { background: #171717; }
.t-alpha-ramp i {
  flex: 1; height: 28px; border-radius: var(--radius-4);
  transition: transform .15s ease;
}
.t-alpha-ramp i:hover { transform: translateY(-2px); }

/* ============ 13. Chart palette ============ */
.t-chartpal { display: flex; flex-direction: column; gap: 14px; }
