/**
 * INKEGG Design System - Reset & Base Styles
 * Modern CSS reset with terminal aesthetic defaults
 */

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

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

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-primary);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY RESET ===== */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-terminal-green);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-md) 0;
}

/* ===== LINK RESET ===== */
a {
  color: var(--color-cyberpunk-pink);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--color-pink-light);
  text-shadow: var(--glow-pink);
}

a:focus {
  outline: 2px solid var(--color-cyberpunk-pink);
  outline-offset: 2px;
}

/* ===== LIST RESET ===== */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

/* ===== FORM RESET ===== */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

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

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

/* Remove default input styling */
input, textarea, select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  background: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ===== TABLE RESET ===== */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* ===== SCROLLBAR STYLING (Terminal Theme) ===== */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
  border: 1px solid var(--color-terminal-green);
}

::-webkit-scrollbar-thumb {
  background: var(--color-terminal-green);
  border: 2px solid var(--color-bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyberpunk-pink);
  box-shadow: var(--glow-pink);
}

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

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

/* ===== SELECTION STYLING ===== */
::selection {
  background: var(--color-cyberpunk-pink);
  color: var(--color-bg-black);
  text-shadow: none;
}

::-moz-selection {
  background: var(--color-cyberpunk-pink);
  color: var(--color-bg-black);
  text-shadow: none;
}

/* ===== PLACEHOLDER STYLING ===== */
::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
  font-style: italic;
}

:-ms-input-placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
  font-style: italic;
}

::-ms-input-placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
  font-style: italic;
}

/* ===== ACCESSIBILITY ===== */
.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;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-cyberpunk-pink);
  color: var(--color-bg-black);
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-fullscreen);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
}

.skip-link:focus {
  top: 0;
}

/* ===== 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;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
