/* ============================================================
   RANY WEB — Base Styles
   Reset, body, typography, links, scrollbar
   ============================================================ */

@import './tokens.css';
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

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

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl);  }
h6 { font-size: var(--text-lg);  }

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ── Links ── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--fuchsia-300); }

/* ── Images ── */
img, svg, video {
  display: block;
  max-width: 100%;
}

/* ── Forms reset ── */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button { cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* ── Selection ── */
::selection {
  background: rgba(247, 37, 133, 0.3);
  color: var(--text-primary);
}

/* ── Scrollbar (webkit) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) var(--bg-void); }

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

/* ── Utility: No Select ── */
.no-select { user-select: none; }

/* ── Loading Overlay ── */
#app-loading {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  transition: opacity var(--duration-slow) var(--ease-out);
}
#app-loading.hidden {
  opacity: 0;
  pointer-events: none;
}
