/* ==========================================================================
   PSC Components — consume tokens only, no literal values
   ==========================================================================
   Every declaration references tokens.css. A component switches from soft to
   brutal purely by the data-variant attribute on an ancestor — same markup,
   same class names, no per-variant rules.
   ========================================================================== */

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   Button — .btn (primary) · .btn.btn-secondary · .btn.btn-ghost
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--action-contrast);
  background: var(--action);
  border: var(--border-w) solid var(--border-emphasis);
  border-radius: var(--radius-action);
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--action-shadow);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--motion), box-shadow var(--motion),
              background var(--motion), border-color var(--motion),
              color var(--motion);
}
.btn:hover {
  box-shadow: var(--action-shadow-hover);
  transform: var(--action-shift-hover);
}
.btn:active {
  box-shadow: var(--action-shadow-active);
  transform: var(--action-shift-active);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--highlight);
  border-color: var(--border-emphasis);
  box-shadow: none;
  transform: none;
}
.btn-ghost:active {
  box-shadow: none;
  transform: none;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface-raised);
  border: var(--border-w-strong) solid var(--border);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  transition: box-shadow var(--motion), border-color var(--motion);
}
.card:hover {
  box-shadow: var(--shadow-lift);
  border-color: var(--border-hover);
}
.card h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}
.card p {
  font-size: var(--text-sm);
  color: var(--text-soft);
  margin: var(--space-3) 0 0;
}

/* --------------------------------------------------------------------------
   Input — .field wraps a label + .input
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field label {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}
.input {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--surface-input);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-control);
  padding: var(--space-3);
  width: 100%;
  box-shadow: none;
  transition: border-color var(--motion), box-shadow var(--motion),
              background var(--motion);
}
.input::placeholder {
  color: var(--text-muted);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: var(--focus-ring);
}

/* --------------------------------------------------------------------------
   Nav bar
   -------------------------------------------------------------------------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--nav-surface);
  color: var(--nav-text);
  border-bottom: var(--border-w-strong) solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  padding: var(--space-3) var(--space-4);
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  letter-spacing: var(--tracking-heading);
  color: var(--nav-text);
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--nav-text);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-control);
  transition: background var(--motion), color var(--motion);
}
.nav-link:hover {
  background: var(--highlight);
  color: var(--text);
}
.nav-link[aria-current="page"] {
  background: var(--highlight);
  color: var(--text);
  font-weight: var(--weight-bold);
}

/* --------------------------------------------------------------------------
   Section heading — .section-heading: .kicker + h2 + optional p
   -------------------------------------------------------------------------- */
.kicker {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
}
.section-heading h2 {
  font-size: var(--text-title);
  font-weight: var(--weight-bold);
  margin-top: var(--space-3);
}
.section-heading p {
  font-size: var(--text-md);
  color: var(--text-soft);
  margin: var(--space-4) 0 0;
  max-width: 54ch;
}

/* --------------------------------------------------------------------------
   Badge — status chips: .badge.badge-positive · .badge.badge-danger
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  padding: var(--space-1) var(--space-3);
  border: var(--border-w) solid var(--badge-border);
  border-radius: var(--radius-pill);
}
.badge-positive {
  background: var(--positive-surface);
  color: var(--positive-text);
}
.badge-danger {
  background: var(--danger-surface);
  color: var(--danger-text);
}

/* --------------------------------------------------------------------------
   Slides — 16:9 presentation patterns
   .slide (base) · .slide-title · .slide-divider · .slide-content
   -------------------------------------------------------------------------- */
.slide {
  aspect-ratio: 16 / 9;
  width: 100%;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  border: var(--border-w-strong) solid var(--border);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow);
  padding: var(--slide-pad);
  overflow: hidden;
}
.slide h1 {
  font-size: var(--slide-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  margin-top: var(--space-3);
}
.slide h2 {
  font-size: var(--slide-title);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  margin-top: var(--space-3);
}
.slide .sub {
  font-size: var(--slide-text);
  color: var(--text-soft);
  margin: var(--space-4) 0 0;
}

.slide .kicker {
  font-size: var(--slide-caption);
}

.slide-divider {
  background: var(--accent);
  color: var(--accent-contrast);
}
.slide-divider .kicker,
.slide-divider .sub {
  color: var(--accent-contrast);
}

.slide-content {
  justify-content: flex-start;
}
.slide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--slide-pad);
  align-items: center;
  flex: 1;
  margin-top: var(--slide-pad-sm);
}
.slide-content h3 {
  font-size: var(--slide-title);
  font-weight: var(--weight-semibold);
}
.slide-content ul {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-4);
  font-size: var(--slide-text);
  color: var(--text-soft);
}
.slide-content li {
  margin-top: var(--space-2);
}

.stat {
  margin-top: var(--space-6);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-2xl);
  line-height: var(--leading-display);
  color: var(--accent);
}
.slide .stat-value {
  font-size: var(--slide-display);
}
.slide .stat-label {
  font-size: var(--slide-caption);
}
.slide .chart {
  padding: var(--slide-pad-sm);
}
.slide .chart figcaption {
  font-size: var(--slide-caption);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.chart {
  background: var(--surface-raised);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-control);
  padding: var(--space-4);
}
.chart figcaption {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
}
