/* ============================================
   DGH ETIQUETAS — BASE STYLES
   Reset, Typography, Utilities
   ============================================ */

/* ── Google Fonts ───────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--color-text-secondary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Typography ────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--color-text-primary);
}

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

p {
  color: var(--color-text-secondary);
  line-height: var(--lh-body);
  max-width: 70ch;
}

a {
  color: var(--color-brand-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-primary);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--fs-body);
}

/* ── Selection ─────────────────────────────── */
::selection {
  background-color: rgba(192, 36, 36, 0.3);
  color: var(--color-text-primary);
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-bg-card);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-primary);
}

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

.container--wide {
  max-width: 1440px;
}

.container--narrow {
  max-width: 900px;
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section--alt {
  background-color: var(--color-bg-secondary);
}

.section--gradient {
  background: var(--gradient-section-fade);
}

/* ── Flex Utilities ────────────────────────── */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* ── Grid Utilities ────────────────────────── */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Text Utilities ────────────────────────── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-red {
  background: var(--gradient-red-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent {
  color: var(--color-brand-primary-light);
}

.text-white {
  color: var(--color-text-primary);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
}

/* ── Section Headers ───────────────────────── */
.section-label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-brand-primary-light);
  margin-bottom: var(--space-md);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--gradient-cta);
  border-radius: var(--radius-full);
}

.section-title {
  font-size: var(--fs-h1);
  font-weight: var(--fw-extrabold);
  margin-bottom: var(--space-lg);
  max-width: 700px;
}

.section-subtitle {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-3xl);
}

.section-header {
  margin-bottom: var(--space-3xl);
}

.section-header.text-center .section-title,
.section-header.text-center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* ── Glass Panel ───────────────────────────── */
.glass-panel {
  background: var(--color-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-lg);
}

.glass-panel:hover {
  background: var(--color-glass-bg-hover);
  border-color: var(--color-border-glass-hover);
}

/* ── Scroll Progress Bar ───────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-cta);
  z-index: var(--z-top);
  transition: width 50ms linear;
  box-shadow: var(--shadow-glow);
}

/* ── Screen Reader Only ────────────────────── */
.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;
}

/* ── Loading State ─────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: calc(var(--z-top) + 1);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border-glass);
  border-top-color: var(--color-brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
