/* ==========================================================================
   KaroPrints — Base / reset / typography
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink-strong);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--yellow-300);
  color: var(--slate-900);
}

[hidden] {
  display: none !important;
}

/* Screen-reader only ------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Typography helpers ------------------------------------------------------- */
.h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.13;
  letter-spacing: -0.025em;
}

.h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  line-height: 1.18;
}

.h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.lead {
  color: var(--ink-muted);
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.125rem);
  line-height: 1.65;
}

.muted {
  color: var(--ink-muted);
}

.faint {
  color: var(--ink-faint);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.bold {
  font-weight: 700;
}

.black {
  font-weight: 800;
}

.tiny {
  font-size: 0.6875rem;
}

.small {
  font-size: var(--text-xs);
}

.upper {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-blue { color: var(--blue-600); }
.text-yellow { color: var(--yellow-500); }
.text-ok { color: var(--emerald-600); }
.text-danger { color: var(--rose-600); }
.text-white { color: #fff; }

/* Entry animations (replace the inert `animate-in fade-in` classes) -------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgb(52 211 153 / 0.55); }
  50% { opacity: 0.75; box-shadow: 0 0 0 4px rgb(52 211 153 / 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.anim-fade { animation: fadeIn var(--dur) var(--ease) both; }
.anim-zoom { animation: zoomIn var(--dur-slow) var(--ease) both; }
.anim-up { animation: slideUp var(--dur-slow) var(--ease) both; }

.is-spinning { animation: spin 0.9s linear infinite; }

.dot-live {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--r-full);
  background: var(--emerald-500);
  animation: pulseDot 1.8s ease-in-out infinite;
  flex: 0 0 auto;
}

/* Skip link ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--slate-950);
  color: var(--yellow-400);
  font-weight: 800;
  border-radius: 0 0 var(--r-lg) 0;
}

.skip-link:focus {
  left: 0;
}

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