/* ==========================================================================
   Xedeshin Viewer — Base Reset & Accessibility
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  font-style: normal !important;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--user-font-size, 16px);
  font-weight: var(--user-font-weight, 400);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  overflow-x: hidden;
  transition:
    background-color var(--duration-layout) var(--ease-liquid),
    color var(--duration-hover) var(--ease-liquid);
}

html[data-caustics="off"] .ambient-field {
  display: none;
}

html[data-shape="classic"] .shape-sculpt-dropzone,
html[data-shape="classic"] .shape-sculpt-dropzone.is-compare,
html[data-shape="classic"] .shape-sculpt-switcher,
html[data-shape="classic"] .shape-sculpt-card,
html[data-shape="classic"] .footer-card {
  border-radius: var(--radius-2xl);
}

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

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

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

img,
svg,
canvas {
  display: block;
}

code,
pre,
kbd,
.mono {
  font-family: var(--font-mono);
}

/* Focus rings — explicit accessibility requirement */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-200);
  z-index: 9999;
  padding: var(--space-75) var(--space-100);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-3);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  transition: transform var(--duration-hover) var(--ease-liquid);
}

.skip-link:focus {
  top: var(--space-200);
}

/* Subtle custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

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

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