/* ==========================================================================
   u.cash - Base Styles
   Modern CSS reset, typography system, global defaults.
   ========================================================================== */

/* ---- Modern CSS Reset ---- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  hanging-punctuation: first last;
}

/* Remove default margins */
body,
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
dl, dd, ol, ul,
figure, hr, fieldset, legend {
  margin: 0;
}

/* Remove list styles */
ul, ol {
  list-style: none;
  padding: 0;
}

/* Core html/body setup */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease-default),
              color 0.3s var(--ease-default);
}

/* Responsive images */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Inherit fonts for form elements */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Anchor reset */
a {
  color: inherit;
  text-decoration: none;
}

/* Button reset */
button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Table reset */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ---- Typography System ---- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}

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

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

strong, b {
  font-weight: var(--weight-semibold);
}

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

/* ---- Selection Styles ---- */

::selection {
  background-color: var(--color-gold-primary);
  color: var(--color-bg-primary);
}

::-moz-selection {
  background-color: var(--color-gold-primary);
  color: var(--color-bg-primary);
}

/* ---- Gradient Text Utility ---- */

.text-gradient {
  background: linear-gradient(
    135deg,
    var(--color-gold-light) 0%,
    var(--color-gold-primary) 40%,
    var(--color-gold-dark) 70%,
    var(--color-gold-light) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-animated {
  background: linear-gradient(
    135deg,
    var(--color-gold-light) 0%,
    var(--color-gold-primary) 25%,
    var(--color-gold-dark) 50%,
    var(--color-gold-primary) 75%,
    var(--color-gold-light) 100%
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
}

/* ---- Scrollbar Styling (Dark Theme) ---- */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gold-dark);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}

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

::-webkit-scrollbar-corner {
  background: var(--color-bg-secondary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold-dark) var(--color-bg-secondary);
}

/* ---- Focus Styles (Accessibility) ---- */

:focus-visible {
  outline: 2px solid var(--color-gold-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Reduced Motion ---- */

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

/* ---- Utility Classes for Body/Root ---- */

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Smooth image loading */
img[loading="lazy"] {
  transition: opacity 0.3s var(--ease-default);
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
  opacity: 1;
}
