/* ==========================================================================
   MODERN CSS RESET & A11Y FOUNDATION
   Portfolio: Aylin Aslı Altınkılıç
   ========================================================================== */

/* 1. Box Sizing Rules */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 2. Document & Root Configuration */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--line-height-base);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 3. Body Setup */
body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  overflow-x: clip;
  position: relative;
}

/* 4. Fluid Media & Replaced Elements */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 5. Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

p {
  overflow-wrap: break-word;
}

/* 6. Form & Button Resets */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
  user-select: none;
}

/* 7. Anchor Resets */
a {
  color: inherit;
  text-decoration: none;
}

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

/* 9. Accessible Keyboard Focus Visible (Using Accent Monospace) */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent-purple);
  outline-offset: 3px;
  border-radius: 2px;
  box-shadow: 0 0 0 4px var(--color-accent-purple-glow);
}

/* 10. Screen Reader Only Utility (a11y) */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sr-only-focusable:focus-visible {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* 11. Custom Dark Scrollbar (Engineered Cyber Style) */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-base);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background-color: #27272A;
  border: 2px solid var(--color-bg-base);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-accent-purple);
  box-shadow: 0 0 10px var(--color-accent-purple-glow);
}

/* Firefox standard scrollbar properties */
* {
  scrollbar-width: thin;
  scrollbar-color: #27272A var(--color-bg-base);
}
