/*
 * Team Matrix design system: components
 * Load tokens/tokens.css first. Every class starts with .tm- so it can sit next to other CSS.
 */

/* ---------- base ---------- */
.tm-page {
  background: var(--tm-bg-main);
  color: var(--tm-text-body);
  font-family: var(--tm-font-body);
  font-size: var(--tm-size-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.tm-page *:focus-visible { outline: 2px solid var(--tm-border-focus); outline-offset: 3px; }

/* ---------- type ---------- */
.tm-display, .tm-h1, .tm-h2, .tm-h3, .tm-h4 {
  font-family: var(--tm-font-heading);
  font-weight: var(--tm-weight-heading);
  color: var(--tm-text-heading);
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
.tm-display { font-size: clamp(3.5rem, 9vw, var(--tm-size-display)); line-height: 0.92; letter-spacing: 0.01em; }
.tm-h1 { font-size: clamp(2.75rem, 7vw, var(--tm-size-h1)); line-height: 0.95; letter-spacing: 0.01em; }
.tm-h2 { font-size: clamp(2.1rem, 5vw, var(--tm-size-h2)); line-height: 1; letter-spacing: 0.015em; }
.tm-h3 { font-size: var(--tm-size-h3); line-height: 1.05; letter-spacing: 0.02em; }
.tm-h4 { font-size: var(--tm-size-h4); line-height: 1.1; letter-spacing: 0.03em; }
.tm-lead { font-size: var(--tm-size-body-lg); line-height: 1.6; max-width: 60ch; margin: 0; }
.tm-small { font-size: var(--tm-size-small); line-height: 1.55; }
.tm-muted { color: var(--tm-text-muted); } /* main background only */
.tm-label {
  font-family: var(--tm-font-body);
  font-size: var(--tm-size-caption);
  font-weight: var(--tm-weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tm-accent-default);
}
.tm-on-second .tm-label { color: var(--tm-accent-on-second); }
.tm-link { color: var(--tm-accent-default); text-underline-offset: 3px; }
.tm-on-second .tm-link { color: var(--tm-accent-on-second); }

/* Section heading: eyebrow label + Bebas heading */
.tm-section-head { display: grid; gap: var(--tm-space-2); }

/* ---------- surfaces ---------- */
.tm-on-second { background: var(--tm-bg-second); }
.tm-card {
  background: var(--tm-bg-second);
  border-radius: var(--tm-radius-md);
  padding: var(--tm-space-6);
  display: grid;
  gap: var(--tm-space-3);
  align-content: start;
  box-shadow: var(--tm-shadow-card);
}
.tm-panel {
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-default);
  border-radius: var(--tm-radius-md);
  padding: var(--tm-space-6);
}
.tm-hero {
  background: var(--tm-gradient-brand);
  border-radius: var(--tm-radius-lg);
  padding: clamp(28px, 6vw, 72px);
  display: grid;
  gap: var(--tm-space-6);
}

/* ---------- buttons ---------- */
.tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tm-space-2);
  min-height: 44px;
  padding: 0 var(--tm-space-5);
  border-radius: var(--tm-radius-md);
  border: 1.5px solid transparent;
  font-family: var(--tm-font-body);
  font-size: var(--tm-size-small);
  font-weight: var(--tm-weight-semibold);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow var(--tm-duration-base) var(--tm-ease-out), transform var(--tm-duration-fast) var(--tm-ease-out), background var(--tm-duration-base);
}
.tm-btn:active { transform: translateY(1px); }
.tm-btn--primary { background: var(--tm-accent-default); color: var(--tm-text-on-accent); }
.tm-btn--primary:hover { box-shadow: var(--tm-shadow-glow); }
.tm-btn--secondary { background: transparent; color: var(--tm-text-heading); border-color: var(--tm-border-strong); }
.tm-btn--secondary:hover { border-color: var(--tm-text-heading); }
.tm-btn--ghost { background: transparent; color: var(--tm-text-body); }
.tm-btn--ghost:hover { color: var(--tm-text-heading); background: var(--tm-border-default); }
/* On the second background, the primary button turns white so it still stands out */
.tm-on-second .tm-btn--primary, .tm-card .tm-btn--primary { background: var(--tm-text-heading); color: var(--tm-bg-second); }
.tm-btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ---------- badges ---------- */
.tm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--tm-radius-sm);
  font-size: var(--tm-size-caption);
  font-weight: var(--tm-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--tm-border-strong);
  color: var(--tm-text-heading);
}
.tm-badge--accent { background: var(--tm-accent-default); color: var(--tm-text-on-accent); border-color: transparent; }
.tm-badge--red { border-color: var(--tm-alliance-red); color: var(--tm-alliance-red); }
.tm-badge--blue { border-color: var(--tm-alliance-blue); color: var(--tm-alliance-blue); }

/* ---------- stat ---------- */
.tm-stat { display: grid; gap: var(--tm-space-1); }
.tm-stat__value { font-family: var(--tm-font-heading); font-size: clamp(2.6rem, 6vw, 4rem); line-height: 0.9; color: var(--tm-text-heading); font-variant-numeric: tabular-nums; }
.tm-stat__value small { font-size: 0.5em; color: var(--tm-text-body); margin-left: 4px; }
.tm-stat__label { font-size: var(--tm-size-small); }

/* ---------- honours list ---------- */
.tm-honours { list-style: none; margin: 0; padding: 0; }
.tm-honours li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--tm-space-4); padding: var(--tm-space-4) 0; border-top: 1px solid var(--tm-border-default); }
.tm-honours li:last-child { border-bottom: 1px solid var(--tm-border-default); }
.tm-honours b { color: var(--tm-text-heading); font-weight: var(--tm-weight-semibold); display: block; }
.tm-honours time { font-family: var(--tm-font-heading); font-size: 22px; color: var(--tm-accent-default); line-height: 1.2; }

/* ---------- sponsor tier ---------- */
.tm-tier { background: var(--tm-bg-second); border-radius: var(--tm-radius-md); padding: var(--tm-space-5); border-top: 4px solid var(--tm-text-heading); display: grid; gap: var(--tm-space-2); align-content: start; }
.tm-tier ul { margin: 0; padding-left: 1.1em; font-size: var(--tm-size-small); }

/* ---------- match score ---------- */
.tm-match { display: grid; grid-template-columns: 1fr auto 1fr; border-radius: var(--tm-radius-md); overflow: hidden; border: 1px solid var(--tm-border-default); }
.tm-match__side { padding: var(--tm-space-4) var(--tm-space-5); background: var(--tm-bg-subtle); }
.tm-match__side--red { border-left: 4px solid var(--tm-alliance-red); }
.tm-match__side--blue { border-right: 4px solid var(--tm-alliance-blue); text-align: right; }
.tm-match__score { font-family: var(--tm-font-heading); font-size: 48px; line-height: 1; color: var(--tm-text-heading); }
.tm-match__mid { display: grid; place-items: center; padding: 0 var(--tm-space-3); font-family: var(--tm-font-heading); font-size: 20px; background: var(--tm-bg-main); }

/* ---------- form ---------- */
.tm-field { display: grid; gap: 6px; min-width: 0; }
.tm-field label { font-size: var(--tm-size-small); font-weight: var(--tm-weight-semibold); color: var(--tm-text-heading); }
.tm-input { width: 100%; min-width: 0; min-height: 44px; padding: 0 var(--tm-space-3); border-radius: var(--tm-radius-sm); border: 1px solid var(--tm-border-strong); background: var(--tm-bg-subtle); color: var(--tm-text-heading); font: inherit; }
.tm-input::placeholder { color: var(--tm-text-muted); }
.tm-input:focus { outline: none; border-color: var(--tm-accent-default); box-shadow: 0 0 0 3px rgba(165, 139, 255, 0.3); }

/* ---------- logo ---------- */
.tm-logo { display: block; width: 180px; max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  .tm-btn, .tm-btn:active { transition: none; transform: none; }
}
