/* ============================================================
   HDS Computer — Base Styles & Reset
   ============================================================ */

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

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

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

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg-primary);
  background: var(--space-900);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--fg-primary);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

p { color: var(--fg-secondary); max-width: 70ch; }

a {
  color: var(--cyan-500);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--cyan-300); }
a:focus-visible {
  outline: 2px solid var(--cyan-500);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

strong, b { color: var(--fg-primary); font-weight: 600; }
code, pre { font-family: var(--font-mono); }
code { background: var(--space-700); padding: 0.15em 0.4em; border-radius: var(--radius-sm); font-size: 0.9em; }

/* --- Selection --- */
::selection { background: var(--cyan-500); color: var(--space-900); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--space-800); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan-500), var(--purple-500));
  border-radius: var(--radius-full);
  border: 2px solid var(--space-800);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--cyan-300), var(--purple-300)); }

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-wide { max-width: var(--container-wide); }

.section { padding: var(--space-16) 0; }
.section-sm { padding: var(--space-10) 0; }
.section-lg { padding: var(--space-20) 0; }

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; gap: var(--space-4); }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }

/* --- Responsive Grid --- */
@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--space-10) 0; }
}

/* --- Focus Visible --- */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--cyan-500); outline-offset: 2px; }

/* --- Image --- */
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }

/* --- Utility Classes --- */
.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;
}

.text-gradient {
  background: linear-gradient(135deg, var(--cyan-500), var(--purple-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-cyan { color: var(--cyan-500); }
.text-purple { color: var(--purple-500); }
.text-muted { color: var(--fg-muted); }

.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }