/* ============================================================
   MODERN CSS RESET — VisionForge Technologies
   Based on Andy Bell's reset + custom additions for dark theme.
   ============================================================ */

/* ─── Box sizing ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ─── Reset margins and padding ─── */
* {
  margin: 0;
  padding: 0;
}

/* ─── Root ─── */
html {
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  tab-size: 4;
  overflow-x: hidden;
}

/* ─── Body ─── */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  overflow-x: hidden;
}

/* ─── Typography baseline ─── */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: var(--leading-tight);
}

p {
  overflow-wrap: break-word;
}

/* ─── Links ─── */
a {
  color: inherit;
  text-decoration: none;
}

/* ─── Lists ─── */
ul, ol {
  list-style: none;
}

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

img {
  height: auto;
}

svg {
  overflow: visible;
  fill: none;
}

/* ─── Form elements ─── */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  appearance: none;
  -webkit-appearance: none;
}

input,
textarea,
select {
  background: none;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  resize: vertical;
}

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

/* ─── HR ─── */
hr {
  border: none;
  border-top: 1px solid var(--color-border-default);
}

/* ─── Blockquote ─── */
blockquote,
q {
  quotes: none;
}

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

pre {
  overflow-x: auto;
  white-space: pre;
}

/* ─── Details & Summary ─── */
details {
  display: block;
}

summary {
  display: list-item;
  cursor: pointer;
}

/* ─── Abbr ─── */
abbr[title] {
  border-bottom: none;
  text-decoration: underline dotted;
  cursor: help;
}

/* ─── Strong & Em ─── */
b, strong {
  font-weight: var(--font-bold);
}

/* ─── Sub & Sup ─── */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* ─── Hidden ─── */
[hidden] {
  display: none !important;
}

/* ─── Disabled ─── */
:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ─── Selection ─── */
::selection {
  background: rgba(27, 142, 248, 0.30);
  color: var(--color-text-primary);
}

/* ─── Scrollbar (WebKit) ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

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

/* ─── Focus visible (accessibility) ─── */
:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

/* ─── Skip link (accessibility) ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  z-index: var(--z-tooltip);
  padding: var(--space-1) var(--space-2);
  background: var(--color-brand-primary);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--duration-quick) var(--ease-out);
}

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