/* ==========================================================================
   AscendSAT — reset, typography, shared utilities
   ========================================================================== */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

h1 { font-size: 38px; }
h2 { font-size: 27px; }
h3 { font-size: 19.5px; }
h4 { font-size: 16px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--blue-hover); }

button { font-family: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

img, svg { max-width: 100%; }

/* Default box for inline icons emitted by ui.js `icon()`. */
.i { width: 18px; height: 18px; flex: none; }

ul, ol { margin: 0 0 12px; padding-left: 22px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

::selection { background: var(--blue-tint-2); }

/* --- Scrollbars ---------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--slate-300) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: var(--pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--slate-400); background-clip: content-box; }

/* --- Focus --------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid rgba(0, 166, 255, .45);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.row      { display: flex; align-items: center; gap: 10px; }
.row-t    { display: flex; align-items: flex-start; gap: 10px; }
.col      { display: flex; flex-direction: column; }
.wrap     { flex-wrap: wrap; }
.between  { justify-content: space-between; }
.center   { justify-content: center; }
.spacer   { flex: 1; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.mt-4 { margin-top: 4px; }  .mt-8  { margin-top: 8px; }
.mt-12{ margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20{ margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mt-32{ margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16{ margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

.tc { text-align: center; }
.tr { text-align: right; }

.muted   { color: var(--ink-2); }
.muted-2 { color: var(--ink-3); }
.tiny    { font-size: 12px; }
.sm      { font-size: 13px; }
.lg      { font-size: 17px; }
.b   { font-weight: 600; }
.bb  { font-weight: 700; }
.bbb { font-weight: 800; }
.head { font-family: var(--font-head); font-weight: 700; }
.tnum { font-variant-numeric: tabular-nums; }
.upper { text-transform: uppercase; letter-spacing: .06em; }

.hide { display: none !important; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Page heading block used at the top of every view */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 37px; letter-spacing: -.01em; }
.page-head .sub { color: var(--ink-2); margin-top: 7px; font-size: 15.5px; }

/* Responsive grid helpers */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
}

/* --- Animations ---------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  0%   { transform: scale(.9); opacity: 0; }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

.anim-rise { animation: rise .4s var(--ease) both; }
.anim-pop  { animation: pop .3s var(--spring) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Skeleton loading block */
.skel {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 37%, var(--slate-100) 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-sm);
}
