/* ==========================================================================
   ALGENZA - Base Styles & Typography
   Matte Obsidian & Cyber Sunset Layout
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* Custom Selection */
::selection {
  background-color: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
}

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

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: var(--font-bold);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: var(--font-extrabold);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  font-weight: var(--font-bold);
}

h3 {
  font-size: 1.35rem;
  font-weight: var(--font-bold);
}

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

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-cyan-hover);
}

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

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

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

.section {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
  position: relative;
}

.section-alt {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-12) auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 14px;
  background-color: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.section-tag-green {
  background-color: var(--accent-green-subtle);
  color: var(--accent-green);
  border-color: var(--accent-green-border);
}

.section-tag-rose {
  background-color: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border-color: var(--accent-rose-border);
}

.section-title {
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Dual Gradient Text Highlights */
.highlight, .text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-cyan {
  color: var(--accent-cyan) !important;
}

.text-rose {
  color: var(--accent-rose) !important;
}

/* Background Accents (Matte Obsidian Grid & Stars) */
.bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
}

.bg-dot-pattern {
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Utility Flex & Grid */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.grid { display: grid; }
.text-center { text-align: center; }

/* Micro Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.02em;
}

.badge-blue, .badge-cyan {
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan-border);
}

.badge-green {
  background: var(--accent-green-subtle);
  color: var(--accent-green);
  border: 1px solid var(--accent-green-border);
}

.badge-rose, .badge-amber {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose-border);
}

.badge-gray {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-pulse {
  position: relative;
}

.badge-pulse::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 50%;
  background-color: inherit;
  opacity: 0.6;
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}
