/**
 * base.css — Reset, typography, layout primitives
 */

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

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--t1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--sp-3); line-height: 1.25; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-xl); font-weight: 700; }
h3 { font-size: var(--fs-lg); font-weight: 600; }

p { margin: 0 0 var(--sp-3); }

/* App shell — mobile first */
.app {
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 80px; /* space for bottom nav */
}

.container {
  padding: var(--sp-4);
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--sp-5) var(--sp-4);
  border-bottom-left-radius: var(--r3);
  border-bottom-right-radius: var(--r3);
}

.app-header h1 {
  color: white;
  margin: 0;
  font-size: var(--fs-xl);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.app-header .tagline {
  font-size: var(--fs-sm);
  opacity: 0.9;
  margin: var(--sp-2) 0 0;
}

.endorsers {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
}

.endorsers .pill {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--r2);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-3);
}

.card-title {
  font-weight: 600;
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-2);
  color: var(--t1);
}

.card-meta {
  font-size: var(--fs-xs);
  color: var(--t3);
}

/* Mitra card */
.mitra-card {
  background: var(--card);
  border-radius: var(--r2);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-3);
  border: 1px solid var(--g2);
}

.mitra-card .photo-placeholder {
  height: 140px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.mitra-card .body {
  padding: var(--sp-4);
}

.mitra-card .label {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0 0 var(--sp-1);
  color: var(--t1);
}

.mitra-card .meta {
  font-size: var(--fs-sm);
  color: var(--t2);
  margin-bottom: var(--sp-2);
}

.mitra-card .tagline {
  font-size: var(--fs-sm);
  color: var(--t2);
  margin-bottom: var(--sp-3);
}

.mitra-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--t2);
  border-top: 1px solid var(--g2);
  padding-top: var(--sp-3);
}

.rating { color: var(--accent); font-weight: 600; }

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  background: var(--card);
  border-top: 1px solid var(--g2);
  display: flex;
  justify-content: space-around;
  padding: var(--sp-2) 0;
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, .06);
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--t3);
  padding: var(--sp-2);
  text-decoration: none;
}

.bottom-nav a.active { color: var(--primary); }

.bottom-nav .icon {
  font-size: 22px;
  display: block;
  margin-bottom: 2px;
}

/* Pills / badges */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--g1);
  color: var(--t2);
}

.pill.primary { background: var(--primary-light); color: var(--primary-dark); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.info { background: var(--info-bg); color: var(--info); }

/* Section heading */
.section-title {
  font-weight: 600;
  font-size: var(--fs-md);
  margin: var(--sp-5) var(--sp-4) var(--sp-2);
  color: var(--t1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title small {
  font-weight: 400;
  color: var(--t3);
  font-size: var(--fs-xs);
}

/* Footer / poweredBy */
.app-footer {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--t3);
  padding: var(--sp-5) var(--sp-4);
  margin-top: var(--sp-5);
}

/* Stack OK indicator (Phase 1 proof) */
.stack-ok {
  background: var(--ok-bg);
  color: var(--ok);
  padding: var(--sp-3);
  border-radius: var(--r);
  font-size: var(--fs-sm);
  border: 1px solid #86efac;
  margin-bottom: var(--sp-3);
}

.stack-ok strong { font-weight: 600; }
