/* ============================================
   BASE STYLES — softwareparanutriologos.com
   Reset + Global Typography + Animations
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ── Selection ── */
::selection {
  background-color: hsla(158, 64%, 38%, 0.2);
  color: var(--color-text);
}

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

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border-light);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

/* ── Links ── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-primary-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Lists ── */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

thead {
  background-color: var(--color-primary-50);
}

th {
  font-family: var(--font-heading);
  font-weight: 600;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  color: var(--color-primary-700);
  border-bottom: 2px solid var(--color-primary-200);
  white-space: nowrap;
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

tbody tr:hover {
  background-color: var(--color-surface-hover);
}

/* ── Blockquotes ── */
blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  background-color: var(--color-primary-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* ── Code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--color-bg-alt);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-primary-600);
}

/* ── Horizontal Rule ── */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-border),
    transparent
  );
  margin: var(--space-10) 0;
}

/* ── 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-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.font-heading { font-family: var(--font-heading); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-fade-in {
  animation: fadeIn var(--duration-slow) var(--ease-out) both;
}

.animate-fade-in-up {
  animation: fadeInUp var(--duration-slower) var(--ease-out) both;
}

.animate-fade-in-down {
  animation: fadeInDown var(--duration-slow) var(--ease-out) both;
}

.animate-scale-in {
  animation: scaleIn var(--duration-slow) var(--ease-spring) both;
}

/* Staggered animations */
.animate-stagger > *:nth-child(1) { animation-delay: 0ms; }
.animate-stagger > *:nth-child(2) { animation-delay: 80ms; }
.animate-stagger > *:nth-child(3) { animation-delay: 160ms; }
.animate-stagger > *:nth-child(4) { animation-delay: 240ms; }
.animate-stagger > *:nth-child(5) { animation-delay: 320ms; }
.animate-stagger > *:nth-child(6) { animation-delay: 400ms; }
.animate-stagger > *:nth-child(7) { animation-delay: 480ms; }
.animate-stagger > *:nth-child(8) { animation-delay: 560ms; }
.animate-stagger > *:nth-child(9) { animation-delay: 640ms; }
.animate-stagger > *:nth-child(10) { animation-delay: 720ms; }

/* Scroll-triggered (activated via JS IntersectionObserver) */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive Typography ── */
@media (max-width: 768px) {
  h1 {
    font-size: var(--text-2xl);
  }

  h2 {
    font-size: var(--text-xl);
    margin-top: var(--space-8);
  }

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

@media (min-width: 1024px) {
  h1 {
    font-size: var(--text-5xl);
  }

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

/* ── Print Styles ── */
@media print {
  body {
    color: #000;
    background: #fff;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .no-print {
    display: none !important;
  }
}
