/* ============================================================
   StayMastery HUB — Base & Reset
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,400;0,600;0,700;0,800;0,900;1,400;1,600&display=swap');

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, textarea, select { font-family: var(--font); }
a { color: var(--coral); text-decoration: none; }
a:hover { color: var(--coral-h); }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: none; border-top: 1px solid var(--border); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--subtle); }

/* ── Typography scale ───────────────────────────────────────── */
.t-logo {
  font-size: 22px;
  font-weight: var(--fw-black);
  color: var(--coral);
  letter-spacing: -.03em;
  line-height: 1;
}

h1, .h1 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-black);
  color: var(--dark);
  letter-spacing: -.02em;
  line-height: var(--leading-tight);
}
h2, .h2 {
  font-size: var(--text-xl);
  font-weight: var(--fw-heavy);
  color: var(--dark);
  letter-spacing: -.01em;
  line-height: var(--leading-tight);
}
h3, .h3 {
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  color: var(--dark);
  line-height: var(--leading-tight);
}
h4, .h4 {
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: var(--dark);
}

.t-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--muted);
}
.t-muted  { color: var(--muted); }
.t-subtle { color: var(--subtle); }
.t-coral  { color: var(--coral); }
.t-green  { color: var(--green); }
.t-dark   { color: var(--dark); }
.t-white  { color: var(--white); }
.t-sm     { font-size: var(--text-sm); }
.t-xs     { font-size: var(--text-xs); }
.t-bold   { font-weight: var(--fw-bold); }
.t-heavy  { font-weight: var(--fw-heavy); }
.t-black  { font-weight: var(--fw-black); }
.t-italic { font-style: italic; }
.t-mono   { font-family: 'Courier New', monospace; font-size: var(--text-sm); }
.t-center { text-align: center; }
.t-right  { text-align: right; }
.t-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── KPI number ─────────────────────────────────────────────── */
.kpi-value {
  font-size: var(--text-2xl);
  font-weight: var(--fw-black);
  color: var(--dark);
  letter-spacing: -.03em;
  line-height: 1;
}
.kpi-value.coral { color: var(--coral); }
.kpi-value.green { color: var(--green); }

/* ── Spacing utilities ──────────────────────────────────────── */
.mt-1 { margin-top: var(--sp-1); }
.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); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

/* ── Flex/Grid helpers ──────────────────────────────────────── */
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-4); }

/* ── Misc ───────────────────────────────────────────────────── */
.hidden    { display: none !important; }
.invisible { visibility: hidden; }
.w-full    { width: 100%; }
.pointer   { cursor: pointer; }
.no-select { user-select: none; }
.relative  { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ── Focus ring ─────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
