/* ==========================================================================
   StrangeInfinity — Base Styles & Reset
   base.css
   ========================================================================== */

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

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

/* ── Root & Scroll behavior ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── Body ── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-base);
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ── Selection ── */
::selection {
  background: rgba(124, 58, 237, 0.4);
  color: var(--text-primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-light); }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: clamp(var(--text-3xl), 6vw, var(--text-7xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { color: var(--text-secondary); }

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

/* ── Code & Pre Blocks ── */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.45em;
  color: var(--color-primary-light);
  font-size: 0.85em;
}

pre {
  background: var(--bg-elevated);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  color: var(--text-primary);
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
  margin: var(--space-4) 0;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Lists ── */
ul, ol { list-style: none; }

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

/* ── Button reset ── */
button {
  font-family: var(--font-sans);
  border: none;
  background: none;
  cursor: pointer;
}

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

/* ── Gradient Text utility ── */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding-bottom: 0.18em;
  padding-right: 0.05em;
}

/* ── Section title ── */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section-label::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--color-secondary);
  opacity: 0.7;
}

.section-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-5xl));
  font-weight: 800;
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  color: var(--text-secondary);
  max-width: 600px;
}

/* ── Loading Screen ── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: var(--z-top);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-6);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  animation: loaderPulse 1.5s ease-in-out infinite;
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  animation: loaderFill 1.8s ease-in-out forwards;
}

.loader-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* ── Utility classes ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.no-select {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.revealed { opacity: 1; transform: none; }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.revealed { opacity: 1; transform: none; }

/* Stagger delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
