/**
 * QubikStack - Base CSS & Reset
 * Includes Google Fonts, modern reset, typography, and utility classes
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ==========================================================================
   CSS Reset & Box Sizing
   ========================================================================== */
*, *::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;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  position: relative;
  min-height: 100dvh;
  transition: background-color var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6, p, a, span, label, input, select, textarea {
  overflow-wrap: break-word;
}

/* ==========================================================================
   Accessibility & Skip Link
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--color-primary);
  color: #000000;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: var(--z-modal);
  transition: top var(--transition-fast);
  text-decoration: none;
}

.skip-link:focus {
  top: 20px;
  outline: 3px solid var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: 1.25rem;
}

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

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

ul, ol {
  list-style: none;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  background: transparent;
}

button {
  cursor: pointer;
}

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

/* ==========================================================================
   Text & Color Utilities
   ========================================================================== */
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-cyan { color: var(--color-primary); }
.text-violet { color: var(--color-accent-violet); }
.text-green { color: var(--color-accent-green); }
.text-white { color: var(--text-primary); }
.text-muted { color: var(--text-secondary); }
.text-dim { color: var(--text-tertiary); }

.font-mono { font-family: var(--font-mono); }
.font-heading { font-family: var(--font-heading); }

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

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  position: relative;
  padding-top: var(--section-spacing);
  padding-bottom: var(--section-spacing);
  z-index: var(--z-base);
}

.section-sm {
  position: relative;
  padding-top: var(--section-spacing-sm);
  padding-bottom: var(--section-spacing-sm);
}

/* Background grid overlay */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
}

.bg-radial-glow {
  position: relative;
  /* Do NOT use overflow:hidden here — it clips the hero canvas and floating cards.
     The ::before glow blob is z-index:-1 and pointer-events:none so it's harmless
     if it bleeds; let the page-level overflow-x:hidden on <body> contain any bleed. */
}

.bg-radial-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: var(--grad-glow);
  pointer-events: none;
  z-index: -1;
  /* Clip the glow blob to its section without blocking content above */
  border-radius: 50%;
}

/* ==========================================================================
   Custom Cursor (Desktop Only)
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  .custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s, opacity 0.2s;
  }

  .custom-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(var(--color-primary-rgb), 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, border-color 0.2s, transform 0.1s ease-out;
  }

  .cursor-hover .custom-cursor-dot {
    width: 14px;
    height: 14px;
    background-color: var(--color-accent-violet);
  }

  .cursor-hover .custom-cursor-ring {
    width: 52px;
    height: 52px;
    border-color: rgba(var(--color-accent-violet-rgb), 0.8);
    background-color: rgba(var(--color-accent-violet-rgb), 0.08);
  }
}

@media (hover: none) or (pointer: coarse) {
  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }
}

/* Fallback for environments with disabled JavaScript */
.no-js .preloader-overlay {
  display: none !important;
}

.no-js .reveal-fade-up {
  opacity: 1 !important;
  transform: none !important;
}
