/* ═══════════════════════════════════════════════════════════════
   PPN v3 — Base: Reset · Typography · Layout · Grid
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); background-image: var(--gradient-mesh); background-attachment: fixed; color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }
ul, ol { list-style: none; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: 1.25; }
.t-xs   { font-size: 0.6875rem; }
.t-sm   { font-size: 0.8125rem; }
.t-base { font-size: 0.9375rem; }
.t-lg   { font-size: 1.125rem; }
.t-xl   { font-size: 1.25rem; }
.t-2xl  { font-size: 1.5rem; }
.t-3xl  { font-size: 1.875rem; }
.t-4xl  { font-size: 2.25rem; }
.t-display { font-family: var(--font-display); }
.t-mono { font-family: var(--font-mono); }

.fw-light    { font-weight: 300; }
.fw-normal   { font-weight: 400; }
.fw-medium   { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold     { font-weight: 700; }
.fw-heavy    { font-weight: 800; }

.tc-primary   { color: var(--primary); }
.tc-secondary { color: var(--text-secondary); }
.tc-muted     { color: var(--text-muted); }
.tc-emerald   { color: var(--emerald); }
.tc-scarlet   { color: var(--scarlet); }
.tc-gold      { color: var(--gold); }
.tc-sky       { color: var(--sky); }
.tc-white     { color: #fff; }
.tc-center    { text-align: center; }
.tc-right     { text-align: right; }

/* ── Layout Containers ── */
.container    { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--sp-4); }
.container-sm { max-width: var(--container-sm); margin: 0 auto; padding: 0 var(--sp-4); }
.container-md { max-width: var(--container-md); margin: 0 auto; padding: 0 var(--sp-4); }

/* ── Flexbox ── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.flex-1     { flex: 1; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.items-start  { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ── Grid ── */
.grid   { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .md-hide { display: none !important; }
}
@media (max-width: 480px) {
    .grid-2 { grid-template-columns: 1fr; }
    .sm-hide { display: none !important; }
}

/* ── Spacing ── */
.mb-1 { margin-bottom: var(--sp-1); } .mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); } .mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.p-4  { padding: var(--sp-4); } .p-5  { padding: var(--sp-5); }
.p-6  { padding: var(--sp-6); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }

/* ── Page Body (accounts for bottom nav) ── */
.page-body { padding: var(--sp-5) var(--sp-4); padding-bottom: calc(var(--nav-height) + var(--sp-8)); }

/* ── Animation ── */
.fade-in { animation: ppnFadeIn 0.45s var(--ease-out); }
@keyframes ppnFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hidden { display: none !important; }

/* ── Backwards-compatible aliases ── */
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.6875rem; }
.text-base { font-size: 0.9375rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-secondary); }
.text-brand { color: var(--primary); }
.text-green { color: var(--emerald); }
.text-red { color: var(--scarlet); }
.text-mono { font-family: var(--font-mono); }
