/**
 * HCAIS Base Styles
 *
 * Reset, base elements, and foundational styles
 */

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

/* ===== Base HTML & Body ===== */
html {
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  width: 100%;
  font-family: var(--font-family);
  background: var(--gradient-bg);
  color: var(--color-text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  line-height: var(--line-height-normal);
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-background);
}

/* ===== Main Wrapper ===== */
.main-wrapper {
  width: 100%;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: var(--z-content);
}

/* ===== Container ===== */
.container {
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ===== Sections ===== */
section {
  min-height: auto;
  width: 100%;
  display: block;
  padding: var(--spacing-lg) var(--section-padding-x);
  position: relative;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Stagger animations for sections */
section:nth-child(1) { animation-delay: 0s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }
section:nth-child(6) { animation-delay: 0.5s; }
section:nth-child(7) { animation-delay: 0.6s; }
section:nth-child(8) { animation-delay: 0.7s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: 0;
}

h1 {
  font-size: var(--font-size-7xl);
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
}

h3 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

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

p {
  margin: 0;
  line-height: var(--line-height-relaxed);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-normal);
}

ul, ol {
  list-style: none;
}

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

/* ===== Buttons ===== */
button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* ===== Utility Classes ===== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== Focus Styles (Accessibility) ===== */
:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 4px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 4px;
}

/* ===== Selection ===== */
::selection {
  background-color: var(--color-accent-primary);
  color: var(--color-text-inverted);
}

::-moz-selection {
  background-color: var(--color-accent-primary);
  color: var(--color-text-inverted);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-accent-primary);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-secondary);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  section {
    min-height: auto;
  }
}
