/* ==========================================================================
   Zylink Corp Dashboard — Base Styles
   Reset, body, typography classes, utilities, focus, scrollbar.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
  hanging-punctuation: first last;
}

body {
  min-height: 100dvh;
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-inline-size: 100%;
}

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

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY CLASSES
   -------------------------------------------------------------------------- */
.text-display {
  font-size: var(--font-size-display);
  line-height: var(--line-height-display);
  letter-spacing: var(--letter-spacing-tight);
  font-weight: var(--font-weight-bold);
}

.text-title1 {
  font-size: var(--font-size-title1);
  line-height: var(--line-height-title1);
  letter-spacing: var(--letter-spacing-tight);
  font-weight: var(--font-weight-bold);
}

.text-title2 {
  font-size: var(--font-size-title2);
  line-height: var(--line-height-title2);
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-bold);
}

.text-title3 {
  font-size: var(--font-size-title3);
  line-height: var(--line-height-title3);
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-semibold);
}

.text-headline {
  font-size: var(--font-size-headline);
  line-height: var(--line-height-headline);
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-semibold);
}

.text-body {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-regular);
}

.text-callout {
  font-size: var(--font-size-callout);
  line-height: var(--line-height-callout);
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-regular);
}

.text-subhead {
  font-size: var(--font-size-subhead);
  line-height: var(--line-height-subhead);
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-regular);
}

.text-footnote {
  font-size: var(--font-size-footnote);
  line-height: var(--line-height-footnote);
  letter-spacing: var(--letter-spacing-normal);
  font-weight: var(--font-weight-regular);
}

.text-caption {
  font-size: var(--font-size-caption);
  line-height: var(--line-height-caption);
  letter-spacing: var(--letter-spacing-wide);
  font-weight: var(--font-weight-regular);
}

/* Secondary / muted text modifier */
.text-secondary {
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   3. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  max-inline-size: var(--max-content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Screen-reader only — visually hidden but accessible */
.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;
}

/* --------------------------------------------------------------------------
   4. FOCUS STYLES
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove default focus ring for mouse users, keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   5. BASE LINK STYLES
   -------------------------------------------------------------------------- */
a:not([class]) {
  color: var(--color-accent);
  transition: color var(--duration-fast) var(--ease-standard);
}

a:not([class]):hover {
  color: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   6. BASE BUTTON RESET
   -------------------------------------------------------------------------- */
button {
  cursor: pointer;
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   7. SCROLLBAR STYLING
   -------------------------------------------------------------------------- */
/* WebKit / Blink */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

/* --------------------------------------------------------------------------
   8. SELECTION
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--color-accent);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   9. REDUCED MOTION — Global override
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
