/**
 * PULSE STUDIO OS — Global Base Styles
 * Resets, typography, scrollbars, utility classes, and base HTML elements.
 */

@import url('tokens.css');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

::selection {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--studio-950);
}

::-webkit-scrollbar-thumb {
  background: var(--studio-700);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Typography Utilities */
.font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

.text-2xs { font-size: var(--text-2xs); }
.text-xs  { font-size: var(--text-xs); }
.text-sm  { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg  { font-size: var(--text-lg); }
.text-xl  { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal    { font-weight: 400; }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-white   { color: var(--text-strong); }
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-primary { color: var(--color-primary-light); }
.text-emerald { color: var(--color-emerald-light); }
.text-amber   { color: var(--color-amber-light); }
.text-rose    { color: var(--color-rose-light); }
.text-sky     { color: var(--color-sky-light); }
.text-purple  { color: var(--color-purple-light); }

.tracking-tight  { letter-spacing: -0.025em; }
.tracking-wider  { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.uppercase       { text-transform: uppercase; }

/* Truncation & Wrapping */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Visibility */
.hidden {
  display: none !important;
}

.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;
}

/* Links & Buttons Reset */
a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

button:disabled, input:disabled, select:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Focus Visibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Glass Panel Utility (Signature Look) */
.glass-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

.glass-panel-subtle {
  background: var(--surface-translucent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* Alerts (login / invitation / reset pages and inline notices) */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert-error   { background: var(--color-rose-bg);    color: var(--color-rose-light);    border-color: var(--color-rose-border); }
.alert-success { background: var(--color-emerald-bg); color: var(--color-emerald-light); border-color: var(--color-emerald-border); }
.alert-info    { background: var(--color-sky-bg);     color: var(--color-sky-light);     border-color: var(--color-sky-border); }

/* Animation Utilities */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

.animate-fade-in {
  animation: fadeIn var(--transition-normal) forwards;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-pulse-subtle {
  animation: none;
}
